blob: c5149be525f6506a68124a0cf2d0454c449d3f29 [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
2884- Add support for unary plus and unary minus to collections.Counter().
2885 Issue #13121: Also add support for inplace math operators.
2886
2887- Issue #12683: urlparse updated to include svn as schemes that uses relative
2888 paths. (svn from 1.5 onwards support relative path).
2889
2890- Issue #12655: Expose functions from sched.h in the os module: sched_yield(),
2891 sched_setscheduler(), sched_getscheduler(), sched_setparam(),
2892 sched_get_min_priority(), sched_get_max_priority(), sched_rr_get_interval(),
2893 sched_getaffinity(), sched_setaffinity().
2894
2895- Add ThreadError to threading.__all__.
2896
2897- Issues #11104, #8688: Fix the behavior of distutils' sdist command with
2898 manually-maintained MANIFEST files.
2899
2900- Issue #11281: smtplib.STMP gets source_address parameter, which adds the
2901 ability to bind to specific source address on a machine with multiple
2902 interfaces. Patch by Paulo Scardine.
2903
2904- Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow
2905 symlinks: fix it. Patch by Petri Lehtinen.
2906
2907- Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
2908 in Python code) now finds the doc of the method.
2909
2910- Issue #10968: Remove indirection in threading. The public names (Thread,
2911 Condition, etc.) used to be factory functions returning instances of hidden
2912 classes (_Thread, _Condition, etc.), because (if Guido recalls correctly) this
2913 code pre-dates the ability to subclass extension types. It is now possible to
2914 inherit from Thread and other classes, without having to import the private
2915 underscored names like multiprocessing did.
2916
2917- Issue #9723: Add shlex.quote functions, to escape filenames and command
2918 lines.
2919
2920- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
2921
2922- Issue #12514: Use try/finally to assure the timeit module restores garbage
2923 collections when it is done.
2924
2925- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
2926 given as a low fd, it gets overwritten.
2927
2928- Issue #12590: IDLE editor window now always displays the first line
2929 when opening a long file. With Tk 8.5, the first line was hidden.
2930
2931- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
2932 Connection:close header.
2933
2934- Issue #12102: Document that buffered files must be flushed before being used
2935 with mmap. Patch by Steffen Daode Nurpmeso.
2936
2937- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
2938
2939- Issue #1813: Fix codec lookup under Turkish locales.
2940
2941- Issue #12591: Improve support of "universal newlines" in the subprocess
2942 module: the piped streams can now be properly read from or written to.
2943
2944- Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
2945 a read1() method), and add a *write_through* parameter to mandate
2946 unbuffered writes.
2947
2948- Issue #10883: Fix socket leaks in urllib.request when using FTP.
2949
2950- Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
2951
2952- Issue #12372: POSIX semaphores are broken on AIX: don't use them.
2953
2954- Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
2955 to get channel binding data for the current SSL session (only the
2956 "tls-unique" channel binding is implemented). This allows the implementation
2957 of certain authentication mechanisms such as SCRAM-SHA-1-PLUS. Patch by
2958 Jacek Konieczny.
2959
2960- Issue #665194: email.utils now has format_datetime and parsedate_to_datetime
2961 functions, allowing for round tripping of RFC2822 format dates.
2962
2963- Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2
2964 directory, so that "import DLFCN" and other similar imports work on
2965 Linux 3.0.
2966
2967- Issue #7484: smtplib no longer puts <> around addresses in VRFY and EXPN
2968 commands; they aren't required and in fact postfix doesn't support that form.
2969
2970- Issue #12273: Remove ast.__version__. AST changes can be accounted for by
2971 checking sys.version_info or sys._mercurial.
2972
2973- Silence spurious "broken pipe" tracebacks when shutting down a
2974 ProcessPoolExecutor.
2975
2976- Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
2977 by joining all queues and processes when shutdown() is called.
2978
2979- Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by
2980 Andreas Stührk.
2981
2982- Issue #11321: Fix a crash with multiple imports of the _pickle module when
2983 embedding Python. Patch by Andreas Stührk.
2984
2985- Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo
2986 Serna.
2987
2988- Add cgi.closelog() function to close the log file.
2989
2990- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
2991
2992- Issue #4376: ctypes now supports nested structures in a endian different than
2993 the parent structure. Patch by Vlad Riscutia.
2994
2995- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
2996 TextIOWrapper to a huge value, not TypeError.
2997
2998- Issue #12504: Close file handles in a timely manner in packaging.database.
2999 This fixes a bug with the remove (uninstall) feature on Windows.
3000
3001- Issues #12169 and #10510: Factor out code used by various packaging commands
3002 to make HTTP POST requests, and make sure it uses CRLF.
3003
3004- Issue #12016: Multibyte CJK decoders now resynchronize faster. They only
3005 ignore the first byte of an invalid byte sequence. For example,
3006 b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of '\ufffd'.
3007
3008- Issue #12459: time.sleep() now raises a ValueError if the sleep length is
3009 negative, instead of an infinite sleep on Windows or raising an IOError on
3010 Linux for example, to have the same behaviour on all platforms.
3011
3012- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
3013 Python scripts using a encoding different than UTF-8 (read the coding cookie
3014 of the script).
3015
3016- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
3017 if the process has only one pipe.
3018
3019- Issue #12467: warnings: fix a race condition if a warning is emitted at
3020 shutdown, if globals()['__file__'] is None.
3021
3022- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
3023 instead of text mode using the locale encoding, to avoid encoding issues.
3024
3025- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
3026 instead of text mode using the locale encoding, to support other encodings
3027 than UTF-8 (scripts using the coding cookie).
3028
3029- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
3030 of the text mode (using the locale encoding) to avoid encoding issues.
3031
3032- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
3033 conformance to the RFCs: correctly handle Sender and Resent- headers.
3034
3035- Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
3036 the garbage collector while the Heap lock is held.
3037
R David Murray8155ff42012-10-02 18:26:31 -04003038- Issue #12462: time.sleep() now immediately calls the (Python) signal handler
Georg Brandl86dc7322012-10-01 18:58:45 +02003039 if it is interrupted by a signal, instead of having to wait until the next
3040 instruction.
3041
3042- Issue #12442: new shutil.disk_usage function, providing total, used and free
3043 disk space statistics.
3044
3045- Issue #12451: The XInclude default loader of xml.etree now decodes files from
3046 UTF-8 instead of the locale encoding if the encoding is not specified. It now
3047 also opens XML files for the parser in binary mode instead of the text mode
3048 to avoid encoding issues.
3049
3050- Issue #12451: doctest.debug_script() doesn't create a temporary file
3051 anymore to avoid encoding issues.
3052
3053- Issue #12451: pydoc.synopsis() now reads the encoding cookie if available,
3054 to read the Python script from the right encoding.
3055
3056- Issue #12451: distutils now opens the setup script in binary mode to read the
3057 encoding cookie, instead of opening it in UTF-8.
3058
3059- Issue #9516: On Mac OS X, change Distutils to no longer globally attempt to
3060 check or set the MACOSX_DEPLOYMENT_TARGET environment variable for the
3061 interpreter process. This could cause failures in non-Distutils subprocesses
3062 and was unreliable since tests or user programs could modify the interpreter
3063 environment after Distutils set it. Instead, have Distutils set the the
3064 deployment target only in the environment of each build subprocess. It is
3065 still possible to globally override the default by setting
3066 MACOSX_DEPLOYMENT_TARGET before launching the interpreter; its value must be
3067 greater or equal to the default value, the value with which the interpreter
3068 was built. Also, implement the same handling in packaging.
3069
3070- Issue #12422: In the copy module, don't store objects that are their own copy
3071 in the memo dict.
3072
3073- Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.
3074
3075- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
3076 Kitada.
3077
3078- Issue #1874: email now detects and reports as a defect the presence of
3079 any CTE other than 7bit, 8bit, or binary on a multipart.
3080
3081- Issue #12383: Fix subprocess module with env={}: don't copy the environment
3082 variables, start with an empty environment.
3083
3084- Issue #11637: Fix support for importing packaging setup hooks from the
3085 project directory.
3086
3087- Issue #6771: Moved the curses.wrapper function from the single-function
3088 wrapper module into __init__, eliminating the module. Since __init__ was
3089 already importing the function to curses.wrapper, there is no API change.
3090
3091- Issue #11584: email.header.decode_header no longer fails if the header
3092 passed to it is a Header object, and Header/make_header no longer fail
3093 if given binary unknown-8bit input.
3094
3095- Issue #11700: mailbox proxy object close methods can now be called multiple
3096 times without error.
3097
3098- Issue #11767: Correct file descriptor leak in mailbox's __getitem__ method.
3099
3100- Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
3101 connection if its getresponse() method fails with a socket error. Patch
3102 written by Ezio Melotti.
3103
3104- Issue #12240: Allow multiple setup hooks in packaging's setup.cfg files.
3105 Original patch by Erik Bray.
3106
3107- Issue #9284: Allow inspect.findsource() to find the source of doctest
3108 functions.
3109
3110- Issue #11595: Fix assorted bugs in packaging.util.cfg_to_args, a
3111 compatibility helper for the distutils-packaging transition. Original patch
3112 by Erik Bray.
3113
3114- Issue #12287: In ossaudiodev, check that the device isn't closed in several
3115 methods.
3116
3117- Issue #12009: Fixed regression in netrc file comment handling.
3118
3119- Issue #12246: Warn and fail when trying to install a third-party project from
3120 an uninstalled Python (built in a source checkout). Original patch by
3121 Tshepang Lekhonkhobe.
3122
3123- Issue #10694: zipfile now ignores garbage at the end of a zipfile.
3124
3125- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
3126
3127- Issue #10424: Argparse now includes the names of the missing required
3128 arguments in the missing arguments error message.
3129
3130- Issue #12168: SysLogHandler now allows NUL termination to be controlled using
3131 a new 'append_nul' attribute on the handler.
3132
3133- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
3134 instead of os.stat.
3135
3136- Issue #12021: Make mmap's read() method argument optional. Patch by Petri
3137 Lehtinen.
3138
3139- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
3140 children and raises BrokenProcessPool in such a situation. Previously it
3141 would reliably freeze/deadlock.
3142
3143- Issue #12040: Expose a new attribute ``sentinel`` on instances of
3144 ``multiprocessing.Process``. Also, fix Process.join() to not use polling
3145 anymore, when given a timeout.
3146
3147- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
3148 smtplib module. Patch by Catalin Iacob.
3149
3150- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
3151 to compute.
3152
3153- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile,
3154 pydoc, tkinter, and xml.parsers.expat. This were useless version constants
3155 left over from the Mercurial transition
3156
3157- Named tuples now work correctly with vars().
3158
3159- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
3160 constructor has failed, e.g. because of an undeclared keyword argument. Patch
3161 written by Oleg Oshmyan.
3162
3163- Issue #12028: Make threading._get_ident() public, rename it to
3164 threading.get_ident() and document it. This function was already used using
3165 _thread.get_ident().
3166
3167- Issue #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
3168 encreset() instead of decreset().
3169
3170- Issue #12218: Removed wsgiref.egg-info.
3171
3172- Issue #12196: Add pipe2() to the os module.
3173
3174- Issue #985064: Make plistlib more resilient to faulty input plists.
3175 Patch by Mher Movsisyan.
3176
3177- Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
3178 Initial patch by Nir Aides.
3179
3180- Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
3181
3182- Issue #12175: FileIO.readall() now only reads the file position and size
3183 once.
3184
3185- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
3186
3187- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
3188 if the file is closed.
3189
R David Murray6e7bd652012-10-01 21:47:57 -04003190- Issue #11109: New service_action method for BaseServer, used by ForkingMixIn
3191 class for cleanup. Initial Patch by Justin Warkentin.
Georg Brandl86dc7322012-10-01 18:58:45 +02003192
3193- Issue #12045: Avoid duplicate execution of command in
3194 ctypes.util._get_soname(). Patch by Sijin Joseph.
3195
3196- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
3197 pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
3198 server.
3199
3200- Issue #1441530: In imaplib, read the data in one chunk to speed up large
3201 reads and simplify code.
3202
3203- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
3204 correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
3205
3206- Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
3207 their encode() method anymore, but continue to call the reset() method if the
3208 final argument is True.
3209
3210- Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
3211 module.
3212
3213- Issue #6501: os.device_encoding() returns None on Windows if the application
3214 has no console.
3215
3216- Issue #12105: Add O_CLOEXEC to the os module.
3217
3218- Issue #12079: Decimal('Infinity').fma(Decimal('0'), (3.91224318126786e+19+0j))
3219 now raises TypeError (reflecting the invalid type of the 3rd argument) rather
3220 than Decimal.InvalidOperation.
3221
3222- Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
3223 to be able to unload the module.
3224
3225- Add the packaging module, an improved fork of distutils (also known as
3226 distutils2).
3227
3228- Issue #12065: connect_ex() on an SSL socket now returns the original errno
3229 when the socket's timeout expires (it used to return None).
3230
3231- Issue #8809: The SMTP_SSL constructor and SMTP.starttls() now support
3232 passing a ``context`` argument pointing to an ssl.SSLContext instance.
3233 Patch by Kasun Herath.
3234
3235- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
3236 with Tk 8.5.
3237
3238- Issue #9516: Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET
3239 is set in shell.
3240
3241- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and
3242 their incremental counterparts now raise OverflowError if given an input
3243 larger than 4GB, instead of silently truncating the input and returning
3244 an incorrect result.
3245
3246- Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
3247 attribute when called without a max_length argument.
3248
3249- Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
3250 on a file opened in read+write mode (namely: reading, seeking a bit forward,
3251 writing, then seeking before the previous write but still within buffered
3252 data, and writing again).
3253
3254- Issue #9971: Write an optimized implementation of BufferedReader.readinto().
3255 Patch by John O'Connor.
3256
3257- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
3258 With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
3259 IDLE to exit. Converted to valid Unicode null in PythonCmd().
3260
3261- Issue #11799: urllib.request Authentication Handlers will raise a ValueError
3262 when presented with an unsupported Authentication Scheme. Patch contributed
3263 by Yuval Greenfield.
3264
3265- Issue #10419, #6011: build_scripts command of distutils handles correctly
3266 non-ASCII path (path to the Python executable). Open and write the script in
3267 binary mode, but ensure that the shebang is decodable from UTF-8 and from the
3268 encoding of the script.
3269
3270- Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
3271 order to accept exactly one connection. Patch by Daniel Evers.
3272
3273- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
3274 instead of a RuntimeError: OSError has an errno attribute.
3275
3276- Issue #3709: add a flush_headers method to BaseHTTPRequestHandler, which
3277 manages the sending of headers to output stream and flushing the internal
3278 headers buffer. Patch contribution by Andrew Schaaf
3279
3280- Issue #11743: Rewrite multiprocessing connection classes in pure Python.
3281
3282- Issue #11164: Stop trying to use _xmlplus in the xml module.
3283
3284- Issue #11888: Add log2 function to math module. Patch written by Mark
3285 Dickinson.
3286
3287- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional.
3288
3289- Issue #8407: The signal handler writes the signal number as a single byte
3290 instead of a nul byte into the wakeup file descriptor. So it is possible to
3291 wait more than one signal and know which signals were raised.
3292
3293- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
3294 signal module.
3295
3296- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
3297 by Kasun Herath.
3298
3299- Issue #12002: ftplib's abort() method raises TypeError.
3300
3301- Issue #11916: Add a number of MacOSX specific definitions to the errno module.
3302 Patch by Pierre Carrier.
3303
3304- Issue #11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
3305 detect mtime changes by comparing to the system clock instead of to the
3306 previous value of the mtime.
3307
3308- Issue #11072: added MLSD command (RFC-3659) support to ftplib.
3309
3310- Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
3311 parameter to control parameters of the secure channel. Patch by Sijin
3312 Joseph.
3313
3314- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
3315 file on Windows XP. As noticed in issue #10684.
3316
3317- Issue #12000: When a SSL certificate has a subjectAltName without any
3318 dNSName entry, ssl.match_hostname() should use the subject's commonName.
3319 Patch by Nicolas Bareil.
3320
3321- Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and
3322 assertWarnsRegex now accept a keyword argument 'msg' when used as context
3323 managers. Initial patch by Winston Ewert.
3324
3325- Issue #10684: shutil.move used to delete a folder on case insensitive
3326 filesystems when the source and destination name where the same except
3327 for the case.
3328
3329- Issue #11647: objects created using contextlib.contextmanager now support
3330 more than one call to the function when used as a decorator. Initial patch
3331 by Ysj Ray.
3332
3333- Issue #11930: Removed deprecated time.accept2dyear variable.
3334 Removed year >= 1000 restriction from datetime.strftime.
3335
3336- logging: don't define QueueListener if Python has no thread support.
3337
3338- functools.cmp_to_key() now works with collections.Hashable().
3339
3340- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
3341 around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
3342
3343- Issue #8407: Add signal.pthread_sigmask() function to fetch and/or change the
3344 signal mask of the calling thread.
3345
3346- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
3347 names.
3348
3349- Issue #11324: ConfigParser(interpolation=None) now works correctly.
3350
3351- Issue #11811: ssl.get_server_certificate() is now IPv6-compatible. Patch
3352 by Charles-François Natali.
3353
3354- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
3355 strings are too long.
3356
3357- Issue #11236: getpass.getpass responds to ctrl-c or ctrl-z on terminal.
3358
3359- Issue #11856: Speed up parsing of JSON numbers.
3360
3361- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the
3362 lock was not acquired.
3363
3364- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor
3365 of 5 to 10. Initial patch by Jonas H.
3366
3367- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
3368 release the GIL. Patch by Charles-François Natali.
3369
3370- Issue #11223: Add threading._info() function providing informations about
3371 the thread implementation.
3372
3373- Issue #11731: simplify/enhance email parser/generator API by introducing
3374 policy objects.
3375
3376- Issue #11768: The signal handler of the signal module only calls
3377 Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
3378 parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
3379
3380- Issue #11492: fix several issues with header folding in the email package.
3381
3382- Issue #11852: Add missing imports and update tests.
3383
3384- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
3385 mutating the object instead of just working on a copy.
3386
3387- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
3388 specific part only digits. Patch by Santoso Wijaya.
3389
3390- collections.Counter().copy() now works correctly for subclasses.
3391
3392- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
3393 Patch by Santoso Wijaya.
3394
3395- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser.
3396
3397- The bz2 module now handles 4GiB+ input buffers correctly.
3398
3399- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
3400 _json is not available.
3401
3402- Issue #11830: Remove unnecessary introspection code in the decimal module.
3403
3404- Issue #11703: urllib2.geturl() does not return correct url when the original
3405 url contains #fragment.
3406
3407- Issue #10019: Fixed regression in json module where an indent of 0 stopped
3408 adding newlines and acted instead like 'None'.
3409
3410- Issue #11186: pydoc ignores a module if its name contains a surrogate
3411 character in the index of modules.
3412
3413- Issue #11815: Use a light-weight SimpleQueue for the result queue in
3414 concurrent.futures.ProcessPoolExecutor.
3415
3416- Issue #5162: Treat services like frozen executables to allow child spawning
3417 from multiprocessing.forking on Windows.
3418
3419- logging.basicConfig now supports an optional 'handlers' argument taking an
3420 iterable of handlers to be added to the root logger. Additional parameter
3421 checks were also added to basicConfig.
3422
3423- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
3424
3425- Issue #11747: Fix range formatting in difflib.context_diff() and
3426 difflib.unified_diff().
3427
3428- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
3429 worker processes: new processes would be spawned while the pool is being
3430 shut down. Patch by Charles-François Natali.
3431
3432- Issue #2650: re.escape() no longer escapes the '_'.
3433
3434- Issue #11757: select.select() now raises ValueError when a negative timeout
3435 is passed (previously, a select.error with EINVAL would be raised). Patch
3436 by Charles-François Natali.
3437
3438- Issue #7311: fix html.parser to accept non-ASCII attribute values.
3439
3440- Issue #11605: email.parser.BytesFeedParser was incorrectly converting
3441 multipart subparts with an 8-bit CTE into unicode instead of preserving the
3442 bytes.
3443
3444- Issue #1690608: email.util.formataddr is now RFC 2047 aware: it now has a
3445 charset parameter that defaults to utf-8 and is used as the charset for RFC
3446 2047 encoding when the realname contains non-ASCII characters.
3447
3448- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
3449
3450- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile
3451 to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda.
3452
3453- Issue #11707: Added a fast C version of functools.cmp_to_key().
3454 Patch by Filip Gruszczyński.
3455
3456- Issue #11688: Add sqlite3.Connection.set_trace_callback(). Patch by
3457 Torsten Landschoff.
3458
3459- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
3460 private keys.
3461
3462- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
3463 file-like objects using a new ``fileobj`` constructor argument. Patch by
3464 Nadeem Vawda.
3465
3466- unittest.TestCase.assertSameElements has been removed.
3467
3468- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
3469 called yet: detect bootstrap (startup) issues earlier.
3470
3471- Issue #11393: Add the new faulthandler module.
3472
3473- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
3474
3475- Removed the 'strict' argument to email.parser.Parser, which has been
3476 deprecated since Python 2.4.
3477
3478- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
3479 arguments.
3480
3481- Issue #11696: Fix ID generation in msilib.
3482
3483- itertools.accumulate now supports an optional *func* argument for
3484 a user-supplied binary function.
3485
3486- Issue #11692: Remove unnecessary demo functions in subprocess module.
3487
3488- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
3489 trying to pack a negative (in-range) integer.
3490
3491- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
3492 are now zeroed on creation. This matches the behaviour specified by the
3493 documentation.
3494
3495- Issue #7639: Fix short file name generation in bdist_msi
3496
3497- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
3498 Patch by Ben Hayden.
3499
3500- Issue #11635: Don't use polling in worker threads and processes launched by
3501 concurrent.futures.
3502
3503- Issue #6811: Allow importlib to change a code object's co_filename attribute
3504 to match the path to where the source code currently is, not where the code
3505 object originally came from.
3506
3507- Issue #8754: Have importlib use the repr of a module name in error messages.
3508
3509- Issue #11591: Prevent "import site" from modifying sys.path when python
3510 was started with -S.
3511
3512- collections.namedtuple() now adds a _source attribute to the generated
3513 class. This make the source more accessible than the outdated
3514 "verbose" option which prints to stdout but doesn't make the source
3515 string available.
3516
3517- Issue #11371: Mark getopt error messages as localizable. Patch by Filip
3518 Gruszczyński.
3519
3520- Issue #11333: Add __slots__ to collections ABCs.
3521
3522- Issue #11628: cmp_to_key generated class should use __slots__.
3523
3524- Issue #11666: let help() display named tuple attributes and methods
3525 that start with a leading underscore.
3526
3527- Issue #11662: Make urllib and urllib2 ignore redirections if the
3528 scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
3529
3530- Issue #5537: Fix time2isoz() and time2netscape() functions of
3531 httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
3532
3533- Issue #4391: Use proper gettext plural forms in optparse.
3534
3535- Issue #11127: Raise a TypeError when trying to pickle a socket object.
3536
3537- Issue #11563: Connection:close header is sent by requests using URLOpener
3538 class which helps in closing of sockets after connection is over. Patch
3539 contributions by Jeff McNeil and Nadeem Vawda.
3540
3541- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
3542 unbuffered pipes, such that select() works properly on them.
3543
3544- Issue #5421: Fix misleading error message when one of socket.sendto()'s
3545 arguments has the wrong type. Patch by Nikita Vetoshkin.
3546
3547- Issue #10812: Add some extra posix functions to the os module.
3548
3549- Issue #10979: unittest stdout buffering now works with class and module
3550 setup and teardown.
3551
3552- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
3553
3554- Issue #11243: fix the parameter querying methods of Message to work if
3555 the headers contain un-encoded non-ASCII data.
3556
3557- Issue #11401: fix handling of headers with no value; this fixes a regression
3558 relative to Python2 and the result is now the same as it was in Python2.
3559
3560- Issue #9298: base64 bodies weren't being folded to line lengths less than 78,
3561 which was a regression relative to Python2. Unlike Python2, the last line
3562 of the folded body now ends with a carriage return.
3563
3564- Issue #11560: shutil.unpack_archive now correctly handles the format
3565 parameter. Patch by Evan Dandrea.
3566
3567- Issue #5870: Add `subprocess.DEVNULL` constant.
3568
3569- Issue #11133: fix two cases where inspect.getattr_static can trigger code
3570 execution. Patch by Andreas Stührk.
3571
3572- Issue #11569: use absolute path to the sysctl command in multiprocessing to
3573 ensure that it will be found regardless of the shell PATH. This ensures
3574 that multiprocessing.cpu_count works on default installs of MacOSX.
3575
3576- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is
3577 not installed. Instead, the zipfile.ZIP_STORED compression is used to create
3578 the ZipFile. Patch by Natalia B. Bidart.
3579
3580- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
3581 in a `with` statement. Contributed by Giampaolo Rodola.
3582
3583- Issue #11554: Fixed support for Japanese codecs; previously the body output
3584 encoding was not done if euc-jp or shift-jis was specified as the charset.
3585
3586- Issue #11509: Significantly increase test coverage of fileinput.
3587 Patch by Denver Coneybeare at PyCon 2011 Sprints.
3588
3589- Issue #11407: `TestCase.run` returns the result object used or created.
3590 Contributed by Janathan Hartley.
3591
3592- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
3593 IP addresses in the proxy exception list.
3594
3595- Issue #11491: dbm.error is no longer raised when dbm.open is called with
3596 the "n" as the flag argument and the file exists. The behavior matches
3597 the documentation and general logic.
3598
3599- Issue #1162477: Postel Principle adjustment to email date parsing: handle the
3600 fact that some non-compliant MUAs use '.' instead of ':' in time specs.
3601
3602- Issue #11131: Fix sign of zero in decimal.Decimal plus and minus
3603 operations when the rounding mode is ROUND_FLOOR.
3604
3605- Issue #9935: Speed up pickling of instances of user-defined classes.
3606
3607- Issue #5622: Fix curses.wrapper to raise correct exception if curses
3608 initialization fails.
3609
3610- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
3611 really necessary. Patch by Charles-François Natali.
3612
3613- Issue #11391: Writing to a mmap object created with
3614 ``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
3615 TypeError. Patch by Charles-François Natali.
3616
3617- Issue #9795: add context manager protocol support for nntplib.NNTP class.
3618
3619- Issue #11306: mailbox in certain cases adapts to an inability to open
3620 certain files in read-write mode. Previously it detected this by
3621 checking for EACCES, now it also checks for EROFS.
3622
3623- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
3624 on accept(), send() and recv().
3625
3626- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().
3627
3628- Issue #8513: On UNIX, subprocess supports bytes command string.
3629
3630- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
3631
3632- Issue #11140: Lock.release() now raises a RuntimeError when attempting
3633 to release an unacquired lock, as claimed in the threading documentation.
3634 The _thread.error exception is now an alias of RuntimeError. Patch by
3635 Filip Gruszczyński. Patch for _dummy_thread by Aymeric Augustin.
3636
3637- Issue #8594: ftplib now provides a source_address parameter to specify which
3638 (address, port) to bind to before connecting.
3639
3640- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
3641 and make it work for non-blocking connects.
3642
3643- Issue #11297: Add collections.ChainMap().
3644
3645- Issue #10755: Add the posix.flistdir() function. Patch by Ross Lagerwall.
3646
3647- Issue #4761: Add the ``*at()`` family of functions (openat(), etc.) to the
3648 posix module. Patch by Ross Lagerwall.
3649
3650- Issue #7322: Trying to read from a socket's file-like object after a timeout
3651 occurred now raises an error instead of silently losing data.
3652
3653- Issue #11291: poplib.POP no longer suppresses errors on quit().
3654
3655- Issue #11177: asyncore's create_socket() arguments can now be omitted.
3656
3657- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread
3658 and multiprocessing.Process constructors in order to override the
3659 default behaviour of inheriting the daemonic property from the current
3660 thread/process.
3661
3662- Issue #10956: Buffered I/O classes retry reading or writing after a signal
3663 has arrived and the handler returned successfully.
3664
3665- Issue #10784: New os.getpriority() and os.setpriority() functions.
3666
3667- Issue #11114: Fix catastrophic performance of tell() on text files (up
3668 to 1000x faster in some cases). It is still one to two order of magnitudes
3669 slower than binary tell().
3670
3671- Issue #10882: Add os.sendfile function.
3672
3673- Issue #10868: Allow usage of the register method of an ABC as a class
3674 decorator.
3675
3676- Issue #11224: Fixed a regression in tarfile that affected the file-like
3677 objects returned by TarFile.extractfile() regarding performance, memory
3678 consumption and failures with the stream interface.
3679
3680- Issue #10924: Adding salt and Modular Crypt Format to crypt library.
3681 Moved old C wrapper to _crypt, and added a Python wrapper with
3682 enhanced salt generation and simpler API for password generation.
3683
3684- Issue #11074: Make 'tokenize' so it can be reloaded.
3685
3686- Issue #11085: Moved collections abstract base classes into a separate
3687 module called collections.abc, following the pattern used by importlib.abc.
3688 For backwards compatibility, the names are imported into the collections
3689 module.
3690
3691- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
3692 4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
3693 32-bit Windows.
3694
3695- Issue #11169: compileall module uses repr() to format filenames and paths to
3696 escape surrogate characters and show spaces.
3697
3698- Issue #11089: Fix performance issue limiting the use of ConfigParser()
3699 with large config files.
3700
3701- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
3702 larger than 4GB. Patch by Nadeem Vawda.
3703
3704- Issue #11388: Added a clear() method to MutableSequence
3705
3706- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names
3707 for the names of optional and positional arguments in help messages.
3708
3709- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
3710
3711- Issue #8982: Improve the documentation for the argparse Namespace object.
3712
3713- Issue #9343: Document that argparse parent parsers must be configured before
3714 their children.
3715
3716- Issue #9026: Fix order of argparse sub-commands in help messages.
3717
3718- Issue #9347: Fix formatting for tuples in argparse type= error messages.
3719
3720- Issue #12191: Added shutil.chown() to change user and/or group owner of a
3721 given path also specifying their names.
3722
3723- Issue #13988: The _elementtree accelerator is used whenever available.
3724 Now xml.etree.cElementTree becomes a deprecated alias to ElementTree.
3725
3726Build
3727-----
3728
3729- Issue #6807: Run msisupport.mak earlier.
3730
3731- Issue #10580: Minor grammar change in Windows installer.
3732
3733- Issue #13326: Clean __pycache__ directories correctly on OpenBSD.
3734
3735- PEP 393: the configure option --with-wide-unicode is removed.
3736
3737- Issue #12852: Set _XOPEN_SOURCE to 700, instead of 600, to get POSIX 2008
3738 functions on OpenBSD (e.g. fdopendir).
3739
3740- Issue #11863: Remove support for legacy systems deprecated in Python 3.2
3741 (following PEP 11). These systems are systems using Mach C Threads,
3742 SunOS lightweight processes, GNU pth threads and IRIX threads.
3743
3744- Issue #8746: Correct faulty configure checks so that os.chflags() and
3745 os.lchflags() are once again built on systems that support these
3746 functions (BSD and OS X). Also add new stat file flags for OS X
3747 (UF_HIDDEN and UF_COMPRESSED).
3748
3749- Issue #10645: Installing Python no longer creates a
3750 Python-X.Y.Z-pyX.Y.egg-info file in the lib-dynload directory.
3751
3752- Do not accidentally include the directory containing sqlite.h twice when
3753 building sqlite3.
3754
3755- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
3756 ensure "make install" creates symlinks in --prefix bin for the "-32"
3757 files in the framework bin directory like the installer does.
3758
3759- Issue #11347: Use --no-as-needed when linking libpython3.so.
3760
3761- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
3762
3763- Issue #11268: Prevent Mac OS X Installer failure if Documentation
3764 package had previously been installed.
3765
3766- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2.
3767
3768
3769IDLE
3770----
3771
3772- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
3773 file in a package.
3774
3775Tools/Demos
3776-----------
3777
3778- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
3779 Patch by Francisco Martín Brugué.
3780
3781- Issue #13930: 2to3 is now able to write its converted output files to another
3782 directory tree as well as copying unchanged files and altering the file
3783 suffix. See its new -o, -W and --add-suffix options. This makes it more
3784 useful in many automated code translation workflows.
3785
3786- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
3787 traceback if Python is optimized.
3788
3789- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
3790 add a smarter "py-bt" command printing a classic Python traceback.
3791
3792- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
3793
3794- Issue #10639: reindent.py no longer converts newlines and will raise
3795 an error if attempting to convert a file with mixed newlines.
3796 "--newline" option added to specify new line character.
3797
3798Extension Modules
3799-----------------
3800
3801- Issue #13840: The error message produced by ctypes.create_string_buffer
3802 when given a Unicode string has been fixed.
3803
3804- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
3805 Vilmos Nebehaj.
3806
3807- Issue #7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
3808
3809- Issue #13159: FileIO and BZ2Compressor/BZ2Decompressor now use a linear-time
3810 buffer growth strategy instead of a quadratic-time one.
3811
3812- Issue #10141: socket: Add SocketCAN (PF_CAN) support. Initial patch by
3813 Matthias Fuchs, updated by Tiago Gonçalves.
3814
3815- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
3816 would be finalized after the reference to its underlying BufferedRWPair's
3817 writer got cleared by the GC.
3818
3819- Issue #12881: ctypes: Fix segfault with large structure field names.
3820
3821- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
3822 Thomas Jarosch.
3823
3824- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
3825 Thanks to Suman Saha for finding the bug and providing a patch.
3826
3827- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
3828 file descriptor was actually received.
3829
3830- Issue #1172711: Add 'long long' support to the array module.
3831 Initial patch by Oren Tirosh and Hirokazu Yamamoto.
3832
3833- Issue #12483: ctypes: Fix a crash when the destruction of a callback
3834 object triggers the garbage collector.
3835
3836- Issue #12950: Fix passing file descriptors in multiprocessing, under
3837 OpenIndiana/Illumos.
3838
3839- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
3840 a string.
3841
3842- Issue #11241: subclasses of ctypes.Array can now be subclassed.
3843
3844- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
3845 some functions like file.write().
3846
3847- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
3848 signature. Without this, architectures where sizeof void* != sizeof int are
3849 broken. Patch given by Hallvard B Furuseth.
3850
3851- Issue #12051: Fix segfault in json.dumps() while encoding highly-nested
3852 objects using the C accelerations.
3853
3854- Issue #12017: Fix segfault in json.loads() while decoding highly-nested
3855 objects using the C accelerations.
3856
3857- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
3858 to an instance of the class.
3859
3860Tests
3861-----
3862
3863- Issue #11689: Fix a variable scoping error in an sqlite3 test
3864
3865- Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
3866
3867- Issue #13725: Fix regrtest to recognize the documented -d flag.
3868 Patch by Erno Tukia.
3869
3870- Issue #13304: Skip test case if user site-packages disabled (-s or
3871 PYTHONNOUSERSITE). (Patch by Carl Meyer)
3872
3873- Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
3874 by Xavier de Gaye.
3875
3876- Issue #13218: Fix test_ssl failures on Debian/Ubuntu.
3877
3878- Re-enable lib2to3's test_parser.py tests, though with an expected failure
3879 (see issue 13125).
3880
3881- Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
3882
3883- Issue #6484: Add unit tests for mailcap module (patch by Gregory Nofi)
3884
3885- Issue #11651: Improve the Makefile test targets to run more of the test suite
3886 more quickly. The --multiprocess option is now enabled by default, reducing
3887 the amount of time needed to run the tests. "make test" and "make quicktest"
3888 now include some resource-intensive tests, but no longer run the test suite
3889 twice to check for bugs in .pyc generation. Tools/scripts/run_test.py provides
3890 an easy platform-independent way to run test suite with sensible defaults.
3891
3892- Issue #12331: The test suite for the packaging module can now run from an
3893 installed Python.
3894
3895- Issue #12331: The test suite for lib2to3 can now run from an installed
3896 Python.
3897
3898- Issue #12626: In regrtest, allow to filter tests using a glob filter
3899 with the ``-m`` (or ``--match``) option. This works with all test cases
3900 using the unittest module. This is useful with long test suites
3901 such as test_io or test_subprocess.
3902
3903- Issue #12624: It is now possible to fail after the first failure when
3904 running in verbose mode (``-v`` or ``-W``), by using the ``--failfast``
3905 (or ``-G``) option to regrtest. This is useful with long test suites
3906 such as test_io or test_subprocess.
3907
3908- Issue #12587: Correct faulty test file and reference in test_tokenize.
3909 (Patch by Robert Xiao)
3910
3911- Issue #12573: Add resource checks for dangling Thread and Process objects.
3912
3913- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
3914 as the processor type on some Mac systems.
3915
3916- Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
3917 failure in name resolution.
3918
3919- Issue #11812: Solve transient socket failure to connect to 'localhost'
3920 in test_telnetlib.py.
3921
3922- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
3923
3924- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
3925 an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
3926 Web site.
3927
3928- Avoid failing in test_urllibnet.test_bad_address when some overzealous
3929 DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test
3930 is now skipped instead.
3931
3932- Issue #12440: When testing whether some bits in SSLContext.options can be
3933 reset, check the version of the OpenSSL headers Python was compiled against,
3934 rather than the runtime version of the OpenSSL library.
3935
3936- Issue #11512: Add a test suite for the cgitb module. Patch by Robbie Clemons.
3937
3938- Issue #12497: Install test/data to prevent failures of the various codecmaps
3939 tests.
3940
3941- Issue #12496: Install test/capath directory to prevent test_connect_capath
3942 testcase failure in test_ssl.
3943
3944- Issue #12469: Run wakeup and pending signal tests in a subprocess to run the
3945 test in a fresh process with only one thread and to not change signal
3946 handling of the parent process.
3947
3948- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
3949 test_tk or test_ttk_guionly under a username that is not currently logged
3950 in to the console windowserver (as may be the case under buildbot or ssh).
3951
3952- Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows.
3953
3954- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
3955 the output and displays it on failure instead. regrtest -v doesn't print the
3956 error twice anymore if there is only one error.
3957
3958- Issue #12141: Install copies of template C module file so that
3959 test_build_ext of test_distutils and test_command_build_ext of
3960 test_packaging are no longer silently skipped when
3961 run outside of a build directory.
3962
3963- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
3964 Patch by Garrett Cooper.
3965
3966- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
3967 2.8 + on Mac OS X. (Patch by Ronald Oussoren)
3968
3969- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
3970 iso2022_kr).
3971
3972- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
3973 written by Charles-François Natali.
3974
3975- Issue #11614: import __hello__ prints "Hello World!". Patch written by
3976 Andreas Stührk.
3977
3978- Issue #5723: Improve json tests to be executed with and without accelerations.
3979
3980- Issue #12041: Make test_wait3 more robust.
3981
3982- Issue #11873: Change regex in test_compileall to fix occasional failures when
3983 when the randomly generated temporary path happened to match the regex.
3984
3985- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
3986 Patch written by Charles-Francois Natali.
3987
3988- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
3989 pthread_sigmask() to ensure that the SIGALRM signal is received by the main
3990 thread.
3991
3992- Issue #11811: Factor out detection of IPv6 support on the current host
3993 and make it available as ``test.support.IPV6_ENABLED``. Patch by
3994 Charles-François Natali.
3995
3996- Issue #10914: Add a minimal embedding test to test_capi.
3997
3998- Issue #11223: Skip test_lock_acquire_interruption() and
3999 test_rlock_acquire_interruption() of test_threadsignals if a thread lock is
4000 implemented using a POSIX mutex and a POSIX condition variable. A POSIX
4001 condition variable cannot be interrupted by a signal (e.g. on Linux, the
4002 futex system call is restarted).
4003
4004- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
4005
4006- Fix possible "file already exists" error when running the tests in parallel.
4007
4008- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
4009 platforms. Patch by Nadeem Vawda.
4010
4011- Issue #11727: Add a --timeout option to regrtest: if a test takes more than
4012 TIMEOUT seconds, dumps the traceback of all threads and exits.
4013
4014- Issue #11653: fix -W with -j in regrtest.
4015
4016- The email test suite now lives in the Lib/test/test_email package. The test
4017 harness code has also been modernized to allow use of new unittest features.
4018
4019- regrtest now discovers test packages as well as test modules.
4020
4021- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
4022
4023- New test_crashers added to exercise the scripts in the Lib/test/crashers
4024 directory and confirm they fail as expected
4025
4026- Issue #11578: added test for the timeit module. Patch by Michael Henry.
4027
4028- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
4029
4030- Issue #11505: improves test coverage of string.py, increases granularity of
4031 string.Formatter tests. Initial patch by Alicia Arlen.
4032
4033- Issue #11548: Improve test coverage of the shutil module. Patch by
4034 Evan Dandrea.
4035
4036- Issue #11554: Reactivated test_email_codecs.
4037
4038- Issue #11505: improves test coverage of string.py. Patch by Alicia
4039 Arlen
4040
4041- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a
4042 false positive if the last directory in the path is inaccessible.
4043
4044- Issue #11223: Fix test_threadsignals to fail, not hang, when the
4045 non-semaphore implementation of locks is used under POSIX.
4046
4047- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
4048 Pierre Quentel.
4049
4050- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
4051 Patch by Hirokazu Yamamoto.
4052
4053- Issue #10512: Properly close sockets under test.test_cgi.
4054
4055- Issue #10992: Make tests pass under coverage.
4056
4057- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
4058 to open door files.
4059
4060- Issue #10990: Prevent tests from clobbering a set trace function.
4061
4062C-API
4063-----
4064
4065- Add PyObject_GenericGetDict and PyObject_GeneriSetDict. They are generic
4066 implementations for the getter and setter of a ``__dict__`` descriptor of C
4067 types.
4068
4069- Issue #13727: Add 3 macros to access PyDateTime_Delta members:
4070 PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
4071 PyDateTime_DELTA_GET_MICROSECONDS.
4072
4073- Issue #10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE,
4074 Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE,
4075 Py_UNICODE_JOIN_SURROGATES.
4076
4077- Issue #12724: Add Py_RETURN_NOTIMPLEMENTED macro for returning NotImplemented.
4078
4079- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
4080 Mercurial.
4081
4082- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
4083 char *` instead of `char *`.
4084
4085- Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
4086
4087Documentation
4088-------------
4089
4090- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
4091 Initial patch for #13491 by Johannes Vogel.
4092
4093- Issue #13402: Document absoluteness of sys.executable.
4094
4095- Issue #13883: PYTHONCASEOK also works on OS X.
4096
4097- Issue #12949: Document the kwonlyargcount argument for the PyCode_New
4098 C API function.
4099
4100- Issue #13513: Fix io.IOBase documentation to correctly link to the
4101 io.IOBase.readline method instead of the readline module.
4102
4103- Issue #13237: Reorganise subprocess documentation to emphasise convenience
4104 functions and the most commonly needed arguments to Popen.
4105
4106- Issue #13141: Demonstrate recommended style for socketserver examples.
4107
4108- Issue #11818: Fix tempfile examples for Python 3.
4109
4110
4111What's New in Python 3.2?
4112=========================
4113
4114*Release date: 20-Feb-2011*
4115
4116Core and Builtins
4117-----------------
4118
4119- Issue #11249: Fix potential crashes when using the limited API.
4120
4121Build
4122-----
4123
4124- Issue #11222: Fix non-framework shared library build on Mac OS X.
4125
4126- Issue #11184: Fix large-file support on AIX.
4127
4128- Issue #941346: Fix broken shared library build on AIX.
4129
4130Documentation
4131-------------
4132
4133- Issue #10709: Add updated AIX notes in Misc/README.AIX.
4134
4135
4136What's New in Python 3.2 Release Candidate 3?
4137=============================================
4138
4139*Release date: 13-Feb-2011*
4140
4141Core and Builtins
4142-----------------
4143
4144- Issue #11134: Add missing fields to typeslots.h.
4145
4146- Issue #11135: Remove redundant doc field from PyType_Spec.
4147
4148- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
4149 ABI.
4150
4151- Issue #11118: Fix bogus export of None in python3.dll.
4152
4153Library
4154-------
4155
4156- Issue #11116: any error during addition of a message to a mailbox now causes a
4157 rollback, instead of leaving the mailbox partially modified.
4158
4159- Issue #11132: Fix passing of "optimize" parameter when recursing in
4160 compileall.compile_dir().
4161
4162- Issue #11110: Fix a potential decref of a NULL in sqlite3.
4163
4164- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
4165 by Stan Mihai.
4166
4167Build
4168-----
4169
4170- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
4171 installers now includes a link to the installed documentation and no longer
4172 includes an Extras directory. The Tools directory is now installed in the
4173 framework under share/doc.
4174
4175- Issue #11121: Fix building with --enable-shared.
4176
4177Tests
4178-----
4179
4180- Issue #10971: test_zipimport_support is once again compatible with the refleak
4181 hunter feature of test.regrtest.
4182
4183
4184What's New in Python 3.2 Release Candidate 2?
4185=============================================
4186
4187*Release date: 30-Jan-2011*
4188
4189Core and Builtins
4190-----------------
4191
4192- Issue #10451: memoryview objects could allow to mutate a readable buffer.
4193 Initial patch by Ross Lagerwall.
4194
4195Library
4196-------
4197
4198- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
4199 files in binary mode, using the email package's binary support to parse
4200 arbitrary email messages. StringIO and text file input is deprecated,
4201 and string input fails early if non-ASCII characters are used, where
4202 previously it would fail when the email was processed in a later step.
4203
4204- Issue #10845: Mitigate the incompatibility between the multiprocessing
4205 module on Windows and the use of package, zipfile or directory execution
4206 by special casing main modules that actually *are* called __main__.py.
4207
4208- Issue #11045: Protect logging call against None argument.
4209
4210- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
4211 commands.
4212
4213- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
4214 preventing a confusing hung appearance on OS X with the windows
4215 obscured.
4216
4217- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
4218 menu accelerators for Open Module, Go to Line, and New Indent Width.
4219 The accelerators still work but no longer appear in the menu items.
4220
4221- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
4222
4223- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
4224 conversion.
4225
4226- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
4227 with a None body.
4228
4229- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
4230 keyword-only argument. The preceding positional argument was deprecated,
4231 so it made no sense to add filter as a positional argument.
4232
4233- Issue #11004: Repaired edge case in deque.count().
4234
4235- Issue #10974: IDLE no longer crashes if its recent files list includes files
4236 with non-ASCII characters in their path names.
4237
4238- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
4239 return sets instead of one returning a tuple and the other a frozenset.
4240
4241- Issue #10987: Fix the recursion limit handling in the _pickle module.
4242
4243- Issue #10983: Fix several bugs making tunnel requests in http.client.
4244
4245- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
4246 filenames, at bootstrap, if the codec registry is not ready yet. It is still
4247 possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
4248 for all file entries in the ZIP file.
4249
4250- Issue #10949: Improved robustness of rotating file handlers.
4251
4252- Issue #10955: Fix a potential crash when trying to mmap() a file past its
4253 length. Initial patch by Ross Lagerwall.
4254
4255- Issue #10898: Allow compiling the posix module when the C library defines
4256 a symbol named FSTAT.
4257
4258- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
4259 encoding. This is the preferred encoding of PEP 3333 and the base encoding
4260 of HTTP 1.1.
4261
4262- To match the behaviour of HTTP server, the HTTP client library now also
4263 encodes headers with iso-8859-1 (latin1) encoding. It was already doing
4264 that for incoming headers which makes this behaviour now consistent in
4265 both incoming and outgoing direction.
4266
4267- Issue #9509: argparse now properly handles IOErrors raised by
4268 argparse.FileType.
4269
4270- Issue #10961: The new pydoc server now better handles exceptions raised
4271 during request handling.
4272
4273- Issue #10680: Fix mutually exclusive arguments for argument groups in
4274 argparse.
4275
4276Build
4277-----
4278
4279- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
4280 the system-provided Python.
4281
4282
4283What's New in Python 3.2 Release Candidate 1
4284============================================
4285
4286*Release date: 16-Jan-2011*
4287
4288Core and Builtins
4289-----------------
4290
4291- Issue #10889: range indexing and slicing now works correctly on ranges with
4292 a length that exceeds sys.maxsize.
4293
4294- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
4295 class.
4296
4297- Issue #8020: Avoid a crash where the small objects allocator would read
4298 non-Python managed memory while it is being modified by another thread. Patch
4299 by Matt Bandy.
4300
4301- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
4302 io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
4303 translates newlines (\r\n => \n).
4304
4305- Remove buffer API from stable ABI for now, see #10181.
4306
4307- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
4308 doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
4309 (length bigger than 2^31-1 bytes).
4310
4311- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
4312 stdprinter.write() clamp the length to INT_MAX on Windows.
4313
4314- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
4315 can now handle dates after 2038.
4316
4317- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
4318 PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
4319 filesystem encoding instead of UTF-8.
4320
4321- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
4322 encoding instead of UTF-8.
4323
4324- Add sys.flags attribute for the new -q command-line option.
4325
4326- Issue #11506: Trying to assign to a bytes literal should result in a
4327 SyntaxError.
4328
4329Library
4330-------
4331
4332- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
4333 and a non-zero offset, and an attempt to read past the end of file is made
4334 (IndexError is raised instead). Patch by Ross Lagerwall.
4335
4336- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
4337 of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
4338
4339- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
4340 than the currently problematic Apple-supplied one, when running with the
4341 64-/32-bit installer variant.
4342
4343- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
4344 as unicode, and accept binary files. Add encoding and errors attributes to
4345 cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
4346 Linderman).
4347
4348- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
4349
4350- Issue #10899: No function type annotations in the standard library. Removed
4351 function type annotations from _pyio.py.
4352
4353- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
4354
4355- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
4356 if available.
4357
4358- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
4359 twice.
4360
4361- Issue #5871: email.header.Header.encode now raises an error if any
4362 continuation line in the formatted value has no leading white space and looks
4363 like a header. Since Generator uses Header to format all headers, this check
4364 is made for all headers in any serialized message at serialization time. This
4365 provides protection against header injection attacks.
4366
4367- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
4368 private by renaming it to ``_GeneratorContextManager``.
4369
4370- Issue #10042: Fixed the total_ordering decorator to handle cross-type
4371 comparisons that could lead to infinite recursion.
4372
4373- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
4374 non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
4375 presentation, instead of replacing them with ?s.
4376
4377- email.header.Header was incorrectly encoding folding whitespace when
4378 rfc2047-encoding header values with embedded newlines, leaving them without
4379 folding whitespace. It now uses the continuation_ws, as it does for
4380 continuation lines that it creates itself.
4381
4382- Issue #1777412, #10827: Changed the rules for 2-digit years. The
4383 time.asctime(), time.ctime() and time.strftime() functions will now format
4384 any year when ``time.accept2dyear`` is False and will accept years >= 1000
4385 otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
4386 supported by the OS. With Visual Studio or on Solaris, the year is limited to
4387 the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
4388
4389- Issue #7858: Raise an error properly when os.utime() fails under Windows
4390 on an existing file.
4391
4392- Issue #3839: wsgiref should not override a Content-Length header set by
4393 the application. Initial patch by Clovis Fabricio.
4394
4395- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
4396 compilation (if the input is a string).
4397
4398- Issue #7995: When calling accept() on a socket with a timeout, the returned
4399 socket is now always blocking, regardless of the operating system.
4400
4401- Issue #10756: atexit normalizes the exception before displaying it. Patch by
4402 Andreas Stührk.
4403
4404- Issue #10790: email.header.Header.append's charset logic now works correctly
4405 for charsets whose output codec is different from its input codec.
4406
4407- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
4408 raising a ValueError, to fix repr().
4409
4410- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
4411 the input buffer length doesn't fit into an unsigned int (length bigger than
4412 2^32-1 bytes).
4413
4414- Issue #6643: Reinitialize locks held within the threading module after fork to
4415 avoid a potential rare deadlock or crash on some platforms.
4416
4417- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
4418 descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
4419 Lagerwall.
4420
4421- `unittest.TestCase` can be instantiated without a method name; for simpler
4422 exploration from the interactive interpreter.
4423
4424- Issue #10798: Reject supporting concurrent.futures if the system has too
4425 few POSIX semaphores.
4426
4427- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
4428 the codec aliases. They are still accessible via codecs.lookup().
4429
4430- Issue #10801: In zipfile, support different encodings for the header and the
4431 filenames.
4432
4433- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
4434 David Daniels.
4435
4436- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
4437 define __missing__().
4438
4439- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
4440 time. `sys.stderr` now looked up at instantiation time. Fix contributed by
4441 Mark Roddy.
4442
4443- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
4444 won't be quoted when the URI is constructed by the wsgiref.util's request_uri
4445 method. According to RFC 3986, these characters can be a part of params in
4446 PATH component of URI and need not be quoted.
4447
4448- Issue #10738: Fix webbrowser.Opera.raise_opts.
4449
4450- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
4451 browsers actually parse cookies.
4452
4453- Issue #9333: os.symlink now available regardless of user privileges. The
4454 function now raises OSError on Windows >=6.0 when the user is unable to create
4455 symbolic links. XP and 2003 still raise NotImplementedError.
4456
4457- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
4458
4459- Issue #10730: Add SVG mime types to mimetypes module.
4460
4461- Issue #10768: Make the Tkinter ScrolledText widget work again.
4462
4463- Issue #10777: Fix "dictionary changed size during iteration" bug in
4464 ElementTree register_namespace().
4465
4466- Issue #10626: test_logging now preserves logger disabled states.
4467
4468- Issue #10774: test_logging now removes temp files created during tests.
4469
4470- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
4471 it now prints the filename, line number, and traceback to stderr and skips
4472 the rest of that individual file, instead of stopping processing entirely.
4473
4474- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
4475 pipes (bug specific to Windows).
4476
4477- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
4478 compliance (no "s around encoded values).
4479
4480- Improved the diff message in the unittest module's assertCountEqual().
4481
4482- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
4483 the '-' of a timezone field as well as before a '+'.
4484
4485- Issue #4871: The zipfile module now gives a more useful error message if
4486 an attempt is made to use a string to specify the archive password.
4487
4488- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
4489
4490- Deprecated assertDictContainsSubset() in the unittest module.
4491
4492C-API
4493-----
4494
4495- PyObject_CallMethod now passes along any underlying AttributeError from
4496 PyObject_GetAttr, instead of replacing it with something less informative
4497
4498- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
4499 PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
4500
4501- Issue #10333: Remove ancient GC API, which has been deprecated since Python
4502 2.2.
4503
4504Build
4505-----
4506
4507- Issue #10843: Update third-party library versions used in OS X 32-bit
4508 installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
4509 and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
4510
4511- Issue #10820: Fix OS X framework installs to support version-specific
4512 scripts (#10679).
4513
4514- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
4515 the configure script but use $GREP instead. Patch by Fabian Groffen.
4516
4517- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
4518 and DragonFly BSD. Patch by Nicolas Joly.
4519
4520- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
4521 a version-specific suffix on "make altinstall".
4522
4523- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
4524 timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
4525 support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
4526 only be present on OS X; the former is the correct one for Linux with GCC.
4527
4528- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
4529 using GCC 4.0.
4530
4531Tools/Demos
4532-----------
4533
4534- Issue #10843: Install the Tools directory on OS X in the applications Extras
4535 (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
4536 installed.
4537
4538- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
4539 demos have been removed, others integrated in documentation or a new
4540 Tools/demo subdirectory.
4541
4542- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
4543 Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
4544 Curtin.
4545
4546Tests
4547-----
4548
4549- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
4550
4551- Fix test_startfile to wait for child process to terminate before finishing.
4552
4553- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
4554 by Ross Lagerwall.
4555
4556- Make the --coverage flag work for test.regrtest.
4557
4558- Issue #1677694: Refactor and improve test_timeout. Original patch by
4559 Björn Lindqvist.
4560
4561- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
4562 Patch by Jean-Paul Calderone and Sandro Tosi.
4563
4564- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
4565 whole runs and enabled selectively using ``--header`` when running an explicit
4566 list of tests. Original patch by Collin Winter.
4567
4568
4569What's New in Python 3.2 Beta 2?
4570================================
4571
4572*Release date: 19-Dec-2010*
4573
4574Core and Builtins
4575-----------------
4576
4577- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
4578 by signals on platforms using pthreads. Patch by Reid Kleckner.
4579
4580- Issue #4236: PyModule_Create2 now checks the import machinery directly
4581 rather than the Py_IsInitialized flag, avoiding a Fatal Python
4582 error in certain circumstances when an import is done in __del__.
4583
4584- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
4585 Daniel Urban.
4586
4587Library
4588-------
4589
4590- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
4591 Xuanji Li and Chris AtLee.
4592
4593- Issue #10611: SystemExit exception will no longer kill a unittest run.
4594
4595- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
4596 up function.
4597
4598- Issue #10573: use actual/expected consistently in unittest methods.
4599 The order of the args of assertCountEqual is also changed.
4600
4601- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
4602 words in the local part of email addresses, thereby preserving the input.
4603
4604- Issue #6791: Limit header line length (to 65535 bytes) in http.client
4605 and http.server, to avoid denial of services from the other party.
4606
4607- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
4608
4609- Issue #9907: Fix tab handling on OSX when using editline by calling
4610 rl_initialize first, then setting our custom defaults, then reading .editrc.
4611
4612- Issue #4188: Avoid creating dummy thread objects when logging operations
4613 from the threading module (with the internal verbose flag activated).
4614
4615- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
4616 parameter to HTTPConnection and friends is deprecated.
4617
4618- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
4619 ';' character. Patch by Wes Chow.
4620
4621- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
4622 for security reasons. Initial patch by Ross Lagerwall.
4623
4624- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
4625
4626- Issue #10667: Fast path for collections.Counter().
4627
4628- Issue #10695: passing the port as a string value to telnetlib no longer
4629 causes debug mode to fail.
4630
4631- Issue #1078919: add_header now automatically RFC2231 encodes parameters
4632 that contain non-ascii values.
4633
4634- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
4635 a warning on sys.stderr rather than throwing a misleading exception
4636 if cleanup fails due to nulling out of modules during shutdown.
4637 Also avoids an AttributeError when mkdtemp call fails and issues
4638 a ResourceWarning on implicit cleanup via __del__.
4639
4640- Issue #10107: Warn about unsaved files in IDLE on OSX.
4641
4642- Issue #7213: subprocess.Popen's default for close_fds has been changed.
4643 It is now True in most cases other than on Windows when input, output or
4644 error handles are provided.
4645
4646- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
4647 added in 3.2beta1) to allow specifying a specific list of file descriptors
4648 to keep open in the child process.
4649
4650- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
4651 OSError exception when The OS had been told to ignore SIGCLD in our process
4652 or otherwise not wait for exiting child processes.
4653
4654Tests
4655-----
4656
4657- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
4658 encountering them.
4659
4660Tools/Demos
4661-----------
4662
4663- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
4664 Cocoa AquaTk.
4665
4666- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
4667
4668- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
4669 or ``python -m test`` should be used instead.
4670
4671Build
4672-----
4673
4674- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
4675
4676- Issue #9234: argparse supports alias names for subparsers.
4677
4678
4679What's New in Python 3.2 Beta 1?
4680================================
4681
4682*Release date: 05-Dec-2010*
4683
4684Core and Builtins
4685-----------------
4686
4687- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
4688 methods.
4689
4690- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
4691 with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
4692
4693- Issue #1772833: Add the -q command-line option to suppress copyright and
4694 version output in interactive mode.
4695
4696- Provide an *optimize* parameter in the built-in compile() function.
4697
4698- Fixed several corner case issues on Windows in os.stat/os.lstat related to
4699 reparse points.
4700
4701- PEP 384 (Defining a Stable ABI) is implemented.
4702
4703- Issue #2690: Range objects support negative indices and slicing.
4704
4705- Issue #9915: Speed up sorting with a key.
4706
4707- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
4708 larger than operand ``b``. Patch by Andrew Bennetts.
4709
4710- Issue #10518: Bring back the callable() builtin.
4711
4712- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
4713 method of float, complex, and Decimal. This allows more precise control over
4714 when decimal points are displayed.
4715
4716- Issue #10474: range.count() should return integers.
4717
4718- Issue #1574217: isinstance now catches only AttributeError, rather than
4719 masking all errors.
4720
4721Library
4722-------
4723
4724- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
4725
4726- test.support: Added TestHandler and Matcher classes for better support of
4727 assertions about logging.
4728
4729- Issue #4391: Use proper plural forms in argparse.
4730
4731- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
4732 UnicodeEncodeError.
4733
4734- Add the "display" and "undisplay" pdb commands.
4735
4736- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
4737 after a "continue" command.
4738
4739- Add the "interact" pdb command.
4740
4741- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
4742
4743- Issue #1569291: Speed up array.repeat().
4744
4745- Provide an interface to set the optimization level of compilation in
4746 py_compile, compileall and zipfile.PyZipFile.
4747
4748- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
4749 RFC3986. Anything before :// is considered a scheme and is followed by an
4750 authority (or netloc) and by '/' led path, which is optional.
4751
4752- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
4753
4754- Issue #10620: `python -m unittest` can accept file paths instead of module
4755 names for running specific tests.
4756
4757- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
4758 `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
4759 and replace them with the correct methods in the Python test suite.
4760
4761- Issue #10272: The ssl module now raises socket.timeout instead of a generic
4762 SSLError on socket timeouts.
4763
4764- Issue #10528: Allow translators to reorder placeholders in localizable
4765 messages from argparse.
4766
4767- Issue #10497: Fix incorrect use of gettext in argparse.
4768
4769- Issue #10478: Reentrant calls inside buffered IO objects (for example by
4770 way of a signal handler) now raise a RuntimeError instead of freezing the
4771 current process.
4772
4773- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
4774
4775- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
4776
4777- Issue #2001: New HTML server with enhanced Web page features. Patch by Ron
4778 Adam.
4779
4780- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
4781 of non-weakrefable objects.
4782
4783- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
4784
4785- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
4786 DoS attacks. Patch by Savio Sena.
4787
4788- Issue #4925: Add filename to error message when executable can't be found in
4789 subprocess.
4790
4791- Issue #10391: Don't dereference invalid memory in error messages in the ast
4792 module.
4793
4794- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
4795 os.lstat. Patch by Hirokazu Yamamoto.
4796
4797- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
4798 held by the user's account, i.e., when the function can actually be used.
4799
4800- Issue #8879: Add os.link support for Windows.
4801
4802- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
4803 failure messages by default. Patch by Mark Roddy.
4804
4805- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
4806 guess at the correct parsing of invalid html.
4807
4808- Issue #10554: Add context manager support to subprocess.Popen objects.
4809
4810- Issue #8989: email.utils.make_msgid now has a domain parameter that can
4811 override the domain name used in the generated msgid.
4812
4813- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
4814 exists' exception when a target directory already exists with the specified
4815 mode. Patch by Ray Allen.
4816
4817- Issue #9573: os.fork() now works correctly when triggered as a side effect of
4818 a module import.
4819
4820- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
4821
4822- Added itertools.accumulate().
4823
4824- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
4825 Original patch by Daniel Urban.
4826
4827- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
4828 `assertRegex` and `assertRaisesRegex`.
4829
4830- Issue #10535: Enable silenced warnings in unittest by default.
4831
4832- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
4833 sequences as input in addition to character strings.
4834
4835- Issue #10586: The statistics API for the new functools.lru_cache has been
4836 changed to a single cache_info() method returning a named tuple.
4837
4838- Issue #10323: itertools.islice() now consumes the minimum number of inputs
4839 before stopping. Formerly, the final state of the underlying iterator was
4840 undefined.
4841
4842- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
4843 __next__.
4844
4845- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
4846 more informative name, unittest.CountEqual.
4847
4848- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
4849
4850- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
4851 be set to False to turn off the previously undocumented 'popularity'
4852 heuristic. Patch by Terry Reedy and Eli Bendersky.
4853
4854- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
4855 undocumented and now redundant isbjunk and isbpopular methods.
4856
4857- Issue #9846: zipfile is now correctly closing underlying file objects.
4858
4859- Issue #10459: Update CJK character names to Unicode 6.0.
4860
4861- Issue #4493: urllib.request adds '/' in front of path components which does not
4862 start with '/. Common behavior exhibited by browsers and other clients.
4863
4864- Issue #6378: idle.bat now runs with the appropriate Python version rather than
4865 the system default. Patch by Sridhar Ratnakumar.
4866
4867- Issue #10470: 'python -m unittest' will now run test discovery by default,
4868 when no extra arguments have been provided.
4869
4870- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
4871 output stream only when end_headers is invoked. This is a speedup and an
4872 internal optimization. Patch by Andrew Shaaf.
4873
4874- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
4875 Eckhardt.
4876
4877- Issue #10453: compileall now uses argparse instead of getopt, and thus
4878 provides clean output when called with '-h'.
4879
4880- Issue #8078: Add constants for higher baud rates in the termios module. Patch
4881 by Rodolpho Eckhardt.
4882
4883- Issue #10407: Fix two NameErrors in distutils.
4884
4885- Issue #10371: Deprecated undocumented functions in the trace module.
4886
4887- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
4888 end of the file.
4889
4890- configparser: 100% test coverage.
4891
4892- Issue #10499: configparser supports pluggable interpolation handlers. The
4893 default classic interpolation handler is called BasicInterpolation. Another
4894 interpolation handler added (ExtendedInterpolation) which supports the syntax
4895 used by zc.buildout (e.g. interpolation between sections).
4896
4897- configparser: the SafeConfigParser class has been renamed to ConfigParser.
4898 The legacy ConfigParser class has been removed but its interpolation mechanism
4899 is still available as LegacyInterpolation.
4900
4901- configparser: Usage of RawConfigParser is now discouraged for new projects
4902 in favor of ConfigParser(interpolation=None).
4903
4904- Issue #1682942: configparser supports alternative option/value delimiters.
4905
4906- Issue #5412: configparser supports mapping protocol access.
4907
4908- Issue #9411: configparser supports specifying encoding for read operations.
4909
4910- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
4911 accept vars and default arguments just like get() does.
4912
4913- Issue #9452: configparser supports reading from strings and dictionaries
4914 (thanks to the mapping protocol API, the latter can be used to copy data
4915 between parsers).
4916
4917- configparser: accepted INI file structure is now customizable, including
4918 comment prefixes, name of the DEFAULT section, empty lines in multiline
4919 values, and indentation.
4920
4921- Issue #10326: unittest.TestCase instances can be pickled.
4922
4923- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
4924
4925- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
4926 zeros on systems where the log1p function fails to respect the sign of zero.
4927 This fixes a test failure on AIX.
4928
4929- Issue #9732: Addition of getattr_static to the inspect module.
4930
4931- Issue #10446: Module documentation generated by pydoc now links to a
4932 version-specific online reference manual.
4933
4934- Make the 'No module named' exception message from importlib consistent.
4935
4936- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
4937
4938- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
4939 Patch by Robert Collins.
4940
4941- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
4942 than strings.
4943
4944C-API
4945-----
4946
4947- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
4948 which transforms non-ASCII decimal digits in a Unicode string to their ASCII
4949 equivalents.
4950
4951- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
4952 zero-initialize all fields, fixing compiler warnings seen when building
4953 extension modules with gcc with "-Wmissing-field-initializers" (implied by
4954 "-W").
4955
4956- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
4957 Schemenauer.
4958
4959- structseq.h is now included in Python.h.
4960
4961- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
4962
4963Tests
4964-----
4965
4966- regrtest.py once again ensures the test directory is removed from sys.path
4967 when it is invoked directly as the __main__ module.
4968
4969- `python -m test` can be used to run the test suite as well as `python -m
4970 test.regrtest`.
4971
4972- Do not fail test_socket when the IP address of the local hostname cannot be
4973 looked up.
4974
4975- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
4976 Carstensen.
4977
4978Build
4979-----
4980
4981- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
4982 PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
4983
4984Documentation
4985-------------
4986
4987- Issue #10299: List the built-in functions in a table in functions.rst.
4988
4989
4990What's New in Python 3.2 Alpha 4?
4991=================================
4992
4993*Release date: 13-Nov-2010*
4994
4995Core and Builtins
4996-----------------
4997
4998- Issue #10372: Import the warnings module only after the IO library is
4999 initialized, so as to avoid bootstrap issues with the '-W' option.
5000
5001- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
5002 undocumented value PyBUF_SHADOW, and strangely-looking code in
5003 PyMemoryView_GetContiguous.
5004
5005- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
5006
5007- If FileIO.__init__ fails, close the file descriptor.
5008
5009- Issue #10221: dict.pop(k) now has a key error message that includes the
5010 missing key (same message d[k] returns for missing keys).
5011
5012- Issue #5437: A preallocated MemoryError instance should not keep traceback
5013 data (including local variables caught in the stack trace) alive infinitely.
5014
5015- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
5016 of the offending line.
5017
5018- Issue #10089: Add support for arbitrary -X options on the command line. They
5019 can be retrieved through a new attribute ``sys._xoptions``.
5020
5021- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
5022 the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
5023 variable is not set, the locale encoding is ISO-8859-1, whereas most programs
5024 (including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
5025 encoding and to encode command line arguments on this OS.
5026
5027- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
5028 filenames encoded to the filesystem encoding with the surrogateescape error
5029 handler (to support undecodable bytes), instead of UTF-8 in strict mode.
5030
5031- Issue #9997: Don't let the name "top" have special significance in scope
5032 resolution.
5033
5034- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
5035 the default 512 when compiling on AIX.
5036
5037- Use locale encoding instead of UTF-8 to encode and decode filenames if
5038 Py_FileSystemDefaultEncoding is not set.
5039
5040- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
5041 descriptor.
5042
5043- Issue #9418: Moved private string methods ``_formatter_parser`` and
5044 ``_formatter_field_name_split`` into a new ``_string`` module.
5045
5046- Issue #9992: Remove PYTHONFSENCODING environment variable.
5047
5048Library
5049-------
5050
5051- Issue #12943: python -m tokenize support has been added to tokenize.
5052
5053- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
5054
5055- Issue #10356: Decimal.__hash__(-1) should return -2.
5056
5057- Issue #1553375: logging: Added stack_info kwarg to display stack information.
5058
5059- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
5060
5061- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
5062 #10356.)
5063
5064- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
5065 IMAP4 connections. Original patch by Lorenzo M. Catucci.
5066
5067- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
5068 there are non-base64 alphabet characters in the input.
5069
5070- Issue #10386: Add __all__ to token module; this simplifies importing in
5071 tokenize module and prevents leaking of private names through ``import *``.
5072
5073- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
5074 M. Catucci.
5075
5076- Fix IMAP.login() to work properly.
5077
5078- Issue #9244: multiprocessing pool worker processes could terminate
5079 unexpectedly if the return value of a task could not be pickled. Only the
5080 ``repr`` of such errors are now sent back, wrapped in an
5081 ``MaybeEncodingError`` exception.
5082
5083- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
5084 ``multiprocessing.Pool`` now accepts a ``error_callback`` argument. This can
5085 be a callback with the signature ``callback(exc)``, which will be called if
5086 the target raises an exception.
5087
5088- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
5089 sockets now has additional items such as ``issuer`` and ``notBefore``.
5090
5091- ``usenetrc`` is now false by default for NNTP objects.
5092
5093- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
5094 Patch by Andrew Vant.
5095
5096- Issue #10335: Add tokenize.open(), detect the file encoding using
5097 tokenize.detect_encoding() and open it in read only mode.
5098
5099- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
5100 method send_message to send an email.message.Message object.
5101
5102- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
5103 handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
5104 code directory name contains a non-ASCII character and the locale encoding is
5105 ASCII.
5106
5107- Issue #10329: The trace module writes reports using the input Python script
5108 encoding, instead of the locale encoding. Patch written by Alexander
5109 Belopolsky.
5110
5111- Issue #10126: Fix distutils' test_build when Python was built with
5112 --enable-shared.
5113
5114- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
5115 Arfrever.
5116
5117- Issue #10229: Fix caching error in gettext.
5118
5119- Issue #10252: Close file objects in a timely manner in distutils code and
5120 tests. Patch by Brian Brazil, completed by Éric Araujo.
5121
5122- Issue #10180: Pickling file objects is now explicitly forbidden, since
5123 unpickling them produced nonsensical results.
5124
5125- Issue #10311: The signal module now restores errno before returning from its
5126 low-level signal handler. Patch by Hallvard B Furuseth.
5127
5128- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
5129
5130- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
5131
5132- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
5133 environment better, and to correct unicode environment values for WSGI 1.0.1.
5134
5135- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
5136 response, instead of raising an exception.
5137
5138- wsgiref now implements and validates PEP 3333, rather than an experimental
5139 extension of PEP 333. (Note: earlier versions of Python 3.x may have
5140 incorrectly validated some non-compliant applications as WSGI compliant; if
5141 your app validates with Python <3.2b1+, but not on this version, it is likely
5142 the case that your app was not compliant.)
5143
5144- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
5145 by the server.
5146
5147- Issue #10184: Touch directories only once when extracting a tarfile.
5148
5149- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
5150 that were formerly found under Demo/turtle.
5151
5152- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
5153
5154- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
5155 filename. Patch by Brian Brazil.
5156
5157- Issue #10110: Queue objects didn't recognize full queues when the maxsize
5158 parameter had been reduced.
5159
5160- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
5161
5162- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
5163
5164- Issue #5729: json.dumps() now supports using a string such as '\t' for
5165 pretty-printing multilevel objects.
5166
5167- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
5168 append that isn't seekable. Patch by Brian Brazil.
5169
5170- Support context manager protocol for file-like objects returned by mailbox
5171 ``get_file()`` methods.
5172
5173- Issue #10246: uu.encode didn't close file objects explicitly when filenames
5174 were given to it. Patch by Brian Brazil.
5175
5176- Issue #10198: fix duplicate header written to wave files when writeframes() is
5177 called without data.
5178
5179- Close file objects in modulefinder in a timely manner.
5180
5181- Close a io.TextIOWrapper object in email.parser in a timely manner.
5182
5183- Close a file object in distutils.sysconfig in a timely manner.
5184
5185- Close a file object in pkgutil in a timely manner.
5186
5187- Issue #10233: Close file objects in a timely manner in the tarfile module and
5188 its test suite.
5189
5190- Issue #10093: ResourceWarnings are now issued when files and sockets are
5191 deallocated without explicit closing. These warnings are silenced by default,
5192 except in pydebug mode.
5193
5194- tarfile.py: Add support for all missing variants of the GNU sparse extensions
5195 and create files with holes when extracting sparse members.
5196
5197- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
5198
5199- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
5200 deprecate the old name ``zipfile.BadZipfile``.
5201
5202- Issue #5027: The standard ``xml`` namespace is now understood by
5203 xml.sax.saxutils.XMLGenerator as being bound to
5204 http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
5205
5206- Issue #5975: Add csv.unix_dialect class.
5207
5208- Issue #7761: telnetlib.interact failures on Windows fixed.
5209
5210- logging: Added style option to Formatter to allow %, {} or $-formatting.
5211
5212- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
5213 context manager.
5214
5215- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
5216 encode method now support a 'linesep' argument.
5217
5218- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
5219 order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
5220 also use this argument, so that HTTPS virtual hosts are now supported.
5221
5222- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
5223
5224- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
5225
5226- logging: Made StreamHandler terminator configurable.
5227
5228- logging: Allowed filters to be just callables.
5229
5230- logging: Added tests for _logRecordClass changes.
5231
5232- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
5233
5234- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
5235 increase flexibility of LogRecord creation.
5236
5237- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
5238 root directory issue on posixpath.relpath(). (Ported working fixes from
5239 ntpath.)
5240
5241- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
5242 short_empty_elements to direct it to use self-closing tags when appropriate.
5243
5244- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
5245 switch to python-config for command line access.
5246
5247- Issue #6098: Don't claim DOM level 3 conformance in minidom.
5248
5249- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
5250 XML namespace attribute is encountered.
5251
5252- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
5253 characters by default. Deprecate ``cgi.escape()``.
5254
5255- Issue #9409: Fix the regex to match all kind of filenames, for interactive
5256 debugging in doctests.
5257
5258- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
5259 same instance as ``datetime.timezone.utc``.
5260
5261- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
5262 supported by the system. Patch by Nikita Vetoshkin.
5263
5264- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
5265 protocol. file:// urls had fallback to access remote hosts via ftp. This was
5266 not correct, change is made to raise a URLError when a remote host is tried to
5267 access via file:// scheme.
5268
5269- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
5270 created in modes 'a' or 'w' and then closed without adding any files. Raise
5271 BadZipfile (rather than IOError) when opening small non-ZIP files.
5272
5273- Issue #10041: The signature of optional arguments in socket.makefile() didn't
5274 match that of io.open(), and they also didn't get forwarded properly to
5275 TextIOWrapper in text mode. Patch by Kai Zhu.
5276
5277- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
5278 urllib.request.urlopen now take optional arguments to allow for server
5279 certificate checking, as recommended in public uses of HTTPS.
5280
5281- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
5282 current directory was deleted. Patch written by W. Trevor King.
5283
5284- Issue #3873: Speed up unpickling from file objects that have a peek() method.
5285
5286- Issue #10075: Add a session_stats() method to SSLContext objects.
5287
5288- Issue #9948: Fixed problem of losing filename case information.
5289
5290Extension Modules
5291-----------------
5292
5293- Issue #5109: array.array constructor will now use fast code when
5294 initial data is provided in an array object with correct type.
5295
5296- Issue #6317: Now winsound.PlaySound only accepts unicode.
5297
5298- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
5299
5300- Issue #9377: Use Unicode API for gethostname on Windows.
5301
5302- Issue #10143: Update "os.pathconf" values.
5303
5304- Issue #6518: Support context manager protcol for ossaudiodev types.
5305
5306- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
5307
5308- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
5309 version 2.0.1.
5310
5311- Issue #5355: Provide mappings from Expat error numbers to string descriptions
5312 and backwards, in order to actually make it possible to analyze error codes
5313 provided by ExpatError.
5314
5315- The Unicode database was updated to 6.0.0.
5316
5317C-API
5318-----
5319
5320- Issue #10288: The deprecated family of "char"-handling macros
5321 (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
5322
5323- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
5324 type has been introduced.
5325
5326Tools/Demos
5327-----------
5328
5329- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
5330 encoding other than ASCII or UTF-8. Source encoding is preserved when
5331 reindented code is written to a file.
5332
5333- Issue #7287: Demo/imputil/knee.py was removed.
5334
5335Tests
5336-----
5337
5338- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
5339 as unicode strings. Initial patch by Sandro Tosi.
5340
5341- Issue #10294: Remove dead code form test_unicode_file.
5342
5343- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
5344 test specific to unicode (non-ascii name and filename).
5345
5346Build
5347-----
5348
5349- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
5350
5351- Issue #8852: Allow the socket module to build on OpenSolaris.
5352
5353- Drop -OPT:Olimit compiler option.
5354
5355- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
5356
5357- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
5358
5359- Issue #7473: avoid link errors when building a framework with a different set
5360 of architectures than the one that is currently installed.
5361
5362
5363What's New in Python 3.2 Alpha 3?
5364=================================
5365
5366*Release date: 09-Oct-2010*
5367
5368Core and Builtins
5369-----------------
5370
5371- Issue #10068: Global objects which have reference cycles with their module's
5372 dict are now cleared again. This causes issue #7140 to appear again.
5373
5374- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
5375 encodings.
5376
5377- ast.literal_eval() can now handle negative numbers. It is also a little more
5378 liberal in what it accepts without compromising the safety of the evaluation.
5379 For example, 3j+4 and 3+4+5 are both accepted.
5380
5381- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
5382 result metaclasses can now be ABCs (see #9533).
5383
5384- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
5385
5386- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
5387 UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
5388 32 bits wchar_t (eg. Linux in narrow build).
5389
5390- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
5391 introduced by issue #9324.
5392
5393- Issue #9979: Create function PyUnicode_AsWideCharString().
5394
5395- Issue #7397: Mention that importlib.import_module() is probably what someone
5396 really wants to be using in __import__'s docstring.
5397
5398- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
5399 to use named arguments.
5400
5401- Issue #9930: Remove bogus subtype check that was causing (e.g.)
5402 float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
5403
5404- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
5405
5406- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
5407 threads are still running. Instead, reinitialize the GIL on a second call to
5408 Py_Initialize().
5409
5410- All SyntaxErrors now have a column offset and therefore a caret when the error
5411 is printed.
5412
5413- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
5414 module that was imported, but instead gets the module from sys.modules.
5415
5416- Issue #9213: The range type_items now provides index() and count() methods, to
5417 conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
5418
5419- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
5420 with a non-empty format string. This is an effort to future-proof user
5421 code. If a derived class does not currently implement __format__ but later
5422 adds its own __format__, it would most likely break user code that had
5423 supplied a format string. This will be changed to a DeprecationWaring in
5424 Python 3.3 and it will be an error in Python 3.4.
5425
5426- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
5427 re-created on a subsequent call to Py_Initialize(). The problem (a crash)
5428 wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
5429
5430- Issue #9210: Configure option --with-wctype-functions was removed. Using the
5431 functions from the libc caused the methods .upper() and lower() to become
5432 locale aware and created subtly wrong results.
5433
5434- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
5435 non-ASCII byte in the format string.
5436
5437- Issue #4617: Previously it was illegal to delete a name from the local
5438 namespace if it occurs as a free variable in a nested block. This limitation
5439 of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
5440
5441- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
5442 ``\UXXXXXXXX``, regardless of whether the character is printable or not.
5443 Also, the "backslashreplace" error handler now joins surrogate pairs into a
5444 single character on UCS-2 builds.
5445
5446- Issue #9757: memoryview objects get a release() method to release the
5447 underlying buffer (previously this was only done when deallocating the
5448 memoryview), and gain support for the context management protocol.
5449
5450- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
5451 thread-local storage key.
5452
5453Library
5454-------
5455
5456- Issue #2236: distutils' mkpath ignored the mode parameter.
5457
5458- Fix typo in one sdist option (medata-check).
5459
5460- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
5461
5462- Issue #1718574: Fix options that were supposed to accept arguments but did
5463 not in build_clib.
5464
5465- Issue #9437: Fix building C extensions with non-default LDFLAGS.
5466
5467- Issue #4661: email can now parse bytes input and generate either converted
5468 7bit output or bytes output. Email version bumped to 5.1.0.
5469
5470- Issue #1589: Add ssl.match_hostname(), to help implement server identity
5471 verification for higher-level protocols.
5472
5473- Issue #9759: GzipFile now raises ValueError when an operation is attempted
5474 after the file is closed. Patch by Jeffrey Finkelstein.
5475
5476- Issue #9042: Fix interaction of custom translation classes and caching in
5477 gettext.
5478
5479- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
5480 returning a (sock, addr) pair which is called when a connection has been
5481 established with a new remote endpoint. This is supposed to be used as a
5482 replacement for old handle_accept() and avoids the user to call accept()
5483 directly.
5484
5485- Issue #9065: tarfile no longer uses "root" as the default for the uname and
5486 gname field.
5487
5488- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
5489 an environment that does not have docutils. Patch by Arfrever.
5490
5491- Issue #1050268: parseaddr now correctly quotes double quote and backslash
5492 characters that appear inside quoted strings in email addresses.
5493
5494- Issue #10004: quoprimime no longer generates a traceback when confronted with
5495 invalid characters after '=' in a Q-encoded word.
5496
5497- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
5498 sending a 200 OK for the Expect: 100-continue request header.
5499
5500- Issue #9360: Cleanup and improvements to the nntplib module. The API now
5501 conforms to the philosophy of bytes and unicode separation in Python 3. A
5502 test suite has also been added.
5503
5504- Issue #9962: GzipFile now has the peek() method.
5505
5506- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
5507 retry the select() loop instead of bailing out. This is because select() can
5508 incorrectly report a socket as ready for reading (for example, if it received
5509 some data with an invalid checksum).
5510
5511- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
5512
5513- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
5514 received. Now sendall() properly calls signal handlers if necessary, and
5515 retries sending if these returned successfully, including on sockets with a
5516 timeout.
5517
5518- Issue #9947: logging: Fixed locking bug in stopListening.
5519
5520- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
5521
5522- Issue #9936: Fixed executable lines' search in the trace module.
5523
5524- Issue #9790: Rework imports necessary for samefile and sameopenfile
5525 in ntpath.
5526
5527- Issue #9928: Properly initialize the types exported by the bz2 module.
5528
5529- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
5530 Florian Festi.
5531
5532- Logging: Added QueueListener class to facilitate logging usage for
5533 performance-critical threads.
5534
5535- Issue #9916: Add some missing errno symbols.
5536
5537- Issue #9877: Expose sysconfig.get_makefile_filename()
5538
5539- logging: Added hasHandlers() method to Logger and LoggerAdapter.
5540
5541- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
5542
5543- Issue #2643: msync() is not called anymore when deallocating an open mmap
5544 object, only munmap().
5545
5546- logging: Changed LoggerAdapter implementation internally, to make it easier to
5547 subclass in a useful way.
5548
5549- logging: hasHandlers method was added to Logger, and isEnabledFor,
5550 getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
5551 LoggerAdapter was introduced into the unit tests for logging.
5552
5553- Issue #1686: Fix string.Template when overriding the pattern attribute.
5554
5555- Issue #9854: SocketIO objects now observe the RawIOBase interface in
5556 non-blocking mode: they return None when an operation would block (instead of
5557 raising an exception).
5558
5559- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
5560 another kind.
5561
5562- Issue #9441: logging has better coverage for rotating file handlers.
5563
5564- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
5565
5566- Issue #9854: The default read() implementation in io.RawIOBase now handles
5567 non-blocking readinto() returning None correctly.
5568
5569- Issue #1552: socket.socketpair() now returns regular socket.socket objects
5570 supporting the whole socket API (rather than the "raw" _socket.socket
5571 objects).
5572
5573- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
5574 to match the corresponding socket methods.
5575
5576- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
5577 them handle recursive calls within the same thread.
5578
5579- logging: Enhanced HTTPHandler with secure and credentials initializers.
5580
5581- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
5582
5583- Issue #9837: The read() method of ZipExtFile objects (as returned by
5584 ZipFile.open()) could return more bytes than requested.
5585
5586- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
5587 d['x'] = d.
5588
5589- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
5590 it possible for the user to create self-referencing ordered dictionaries which
5591 become permanently uncollectable GC garbage. Reinstated the Python 3.1
5592 approach of using weakref proxies so that reference cycles never get created
5593 in the first place.
5594
5595- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
5596 encode the value with filesystem encoding and surrogateescape (instead of
5597 utf-8 in strict mode) . Patch written by David Watson.
5598
5599- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
5600 environment variable to set the filesystem encoding at Python startup.
5601 sys.setfilesystemencoding() creates inconsistencies because it is unable to
5602 reencode all filenames in all objects.
5603
5604- Issue #9410: Various optimizations to the pickle module, leading to speedups
5605 up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
5606 initial patch by Alexandre Vassalotti.
5607
5608- The pprint module now supports printing OrderedDicts in their given order
5609 (formerly, it would sort the keys).
5610
5611- Logging: Added QueueHandler class to facilitate logging usage with
5612 multiprocessing.
5613
5614- Issue #9707: Rewritten reference implementation of threading.local which is
5615 friendlier towards reference cycles. This change is not normally visible
5616 since an optimized C implementation (_thread._local) is used instead.
5617
5618- Issue #6394: os.getppid() is now supported on Windows. Note that it will
5619 still return the id of the parent process after it has exited. This process
5620 id may even have been reused by another unrelated process.
5621
5622- Issue #9792: In case of connection failure, socket.create_connection() would
5623 swallow the exception and raise a new one, making it impossible to fetch the
5624 original errno, or to filter timeout errors. Now the original error is
5625 re-raised.
5626
5627- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
5628 the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
5629 back after the system call. Original patch by Brian Brazil.
5630
5631- Updates to the random module:
5632
5633 * Document which parts of the module are guaranteed to stay the same across
5634 versions and which parts are subject to change.
5635
5636 * Update the seed() method to use all of the bits in a string instead of just
5637 the hash value. This makes better use of the seed value and assures the
5638 seeding is platform independent. Issue #7889.
5639
5640 * Improved the random()-->integer algorithm used in choice(), shuffle(),
5641 sample(), randrange(), and randint(). Formerly, it used int(n*random())
5642 which has a slight bias whenever n is not a power of two. Issue #9025.
5643
5644 * Improved documentation of arguments to randrange(). Issue #9379.
5645
5646- collections.OrderedDict now supports a new method for repositioning keys to
5647 either end.
5648
5649- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
5650 cases now also have assertWarns and assertWarnsRegexp methods to check that a
5651 given warning type was triggered by the code under test.
5652
5653- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
5654 their contents without duplicating them. The view is both readable and
5655 writable.
5656
5657- Issue #7566: Implement os.path.sameopenfile for Windows.
5658
5659- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
5660 unsupported operation is attempted (for example, writing to a file open only
5661 for reading).
5662
5663- hashlib has two new constant attributes: algorithms_guaranteed and
5664 algorithms_avaiable that respectively list the names of hash algorithms
5665 guaranteed to exist in all Python implementations and the names of hash
5666 algorithms available in the current process.
5667
5668- A new package ``concurrent.futures`` as defined by PEP 3148.
5669
5670C-API
5671-----
5672
5673- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
5674
5675- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
5676 PySequence_DelSlice when the object doesn't have any mapping operations
5677 defined.
5678
5679Tools/Demos
5680-----------
5681
5682- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
5683 wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
5684 and the interpreter under test.
5685
5686Tests
5687-----
5688
5689- Issue #9308: Added tests for importing encoded modules that do not
5690 depend on specific stdlib modules being encoded in a certain way.
5691
5692- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
5693 certificate and private key files used by SSL-related certs.
5694
5695- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
5696 in test_os)
5697
5698- Issue #7110: regrtest now sends test failure reports and single-failure
5699 tracebacks to stderr rather than stdout.
5700
5701- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
5702
5703- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
5704 Deily.
5705
5706- Issue #9894: Do not hardcode ENOENT in test_subprocess.
5707
5708- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
5709
5710- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
5711 case when running profile or trace, for example.
5712
5713- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
5714
5715Build
5716-----
5717
5718- Issue #10062: Allow building on platforms which do not have sem_timedwait.
5719
5720- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
5721 Kitada.
5722
5723- Issue #10055: Make json C89-compliant in UCS4 mode.
5724
5725- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
5726
5727- Issue #1633863: Don't ignore $CC under AIX.
5728
5729- Issue #9810: Compile bzip2 source files in Python's project file directly. It
5730 used to be built with bzip2's makefile.
5731
5732- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
5733 module.
5734
5735- Issue #9806: python-config now has an ``--extension-suffix`` option that
5736 outputs the suffix for dynamic libraries including the ABI version name
5737 defined by PEP 3149.
5738
5739- Issue #941346: Improve the build process under AIX and allow Python to be
5740 built as a shared library. Patch by Sébastien Sablé.
5741
5742- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
5743 Sablé.
5744
5745- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
5746 the "bin" directory inside the framework is on the shell's search path. This
5747 feature now also supports the ZSH shell.
5748
5749
5750What's New in Python 3.2 Alpha 2?
5751=================================
5752
5753*Release date: 05-Sep-2010*
5754
5755Core and Builtins
5756-----------------
5757
5758- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
5759 the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
5760 bytecode is a bit simplified. Patch by Demur Rumed.
5761
5762- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
5763 confusion with the proper variables names from 'warnings' itself.
5764
5765- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
5766 conform to the Set ABC. Patch by Daniel Urban.
5767
5768- Issue #9737: Fix a crash when trying to delete a slice or an item from a
5769 memoryview object.
5770
5771- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
5772 now removed, since their effect was inexistent in 3.x (the default encoding is
5773 hardcoded to utf-8 and cannot be changed).
5774
5775- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
5776 properly. Patch by Stefan Behnel.
5777
5778- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
5779 platforms. Previously, it inlined only when using Microsoft Visual C.
5780
5781- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
5782
5783- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
5784
5785- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
5786 the pyconfig.h generated by configure on other systems.
5787
5788- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
5789 occur during attribute lookup are now propagated to the caller.
5790
5791- Issue #8622: Add PYTHONFSENCODING environment variable to override the
5792 filesystem encoding.
5793
5794- Issue #5127: The C functions that access the Unicode Database now accept and
5795 return characters from the full Unicode range, even on narrow unicode builds
5796 (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
5797 in Python is that unicodedata.numeric() now returns the correct value for
5798 large code points, and repr() may consider more characters as printable.
5799
5800- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
5801 as a unicode object, instead of a byte string. Function needed to support
5802 unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
5803 function.
5804
5805- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
5806
5807- Issue #9612: The set object is now 64-bit clean under Windows.
5808
5809- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
5810 the module file to be executed with the -m command line option.
5811
5812- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
5813 write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
5814 sys.stderr.
5815
5816- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
5817 decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
5818 objects are output as-is.
5819
5820- Issue #9203: Computed gotos are now enabled by default on supported compilers
5821 (which are detected by the configure script). They can still be disable
5822 selectively by specifying --without-computed-gotos.
5823
5824- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
5825 use PyUnicode_FromFormatV() to format the warning message.
5826
5827- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
5828 array.
5829
5830- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
5831
5832- Issue #9337: The str() of a float or complex number is now identical to its
5833 repr().
5834
5835- Issue #9416: Fix some issues with complex formatting where the output with no
5836 type specifier failed to match the str output:
5837
5838 - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
5839 - format(complex(0.0, 2.0), '-') included a sign and parentheses.
5840
5841Extension Modules
5842-----------------
5843
5844- Issue #8013: time.asctime and time.ctime no longer call system
5845 asctime and ctime functions. The year range for time.asctime is now
5846 1900 through maxint. The range for time.ctime is the same as for
5847 time.localtime. The string produced by these functions is longer
5848 than 24 characters when year is greater than 9999.
5849
5850- Issue #6608: time.asctime is now checking struct tm fields its input
5851 before passing it to the system asctime. Patch by MunSic Jeong.
5852
5853- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
5854 descriptor is provided. Patch by Pascal Chambon.
5855
5856- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
5857 posix module. Patch by Marcin Bachry.
5858
5859- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
5860 socket module, and fix the width of socket descriptors to be correctly
5861 detected under 64-bit Windows.
5862
5863- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
5864 and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
5865 input.
5866
5867- Issue #9214: Set operations on a KeysView or ItemsView in collections now
5868 correctly return a set. Patch by Eli Bendersky.
5869
5870- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
5871 Matthew Ahrens.
5872
5873- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
5874 the surrogate error handler.
5875
5876- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
5877 than ``TypeError`` raised by the iterator argument.
5878
5879- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
5880
5881- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
5882 Lock around all system calls. Original patch by Ryan Kelly.
5883
5884- Issue #8524: Add a detach() method to socket objects, so as to put the socket
5885 into the closed state without closing the underlying file descriptor.
5886
5887- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
5888
5889- Issue #6869: Fix a refcount problem in the _ctypes extension.
5890
5891- Issue #5504: ctypes should now work with systems where mmap can't be
5892 PROT_WRITE and PROT_EXEC.
5893
5894- Issue #9507: Named tuple repr will now automatically display the right name in
5895 a tuple subclass.
5896
5897- Issue #9324: Add parameter validation to signal.signal on Windows in order to
5898 prevent crashes.
5899
5900- Issue #9526: Remove some outdated (int) casts that were preventing the array
5901 module from working correctly with arrays of more than 2**31 elements.
5902
5903- Fix memory leak in ssl._ssl._test_decode_cert.
5904
5905- Issue #8065: Fix memory leak in readline module (from failure to free the
5906 result of history_get_history_state()).
5907
5908- Issue #9450: Fix memory leak in readline.replace_history_item and
5909 readline.remove_history_item for readline version >= 5.0.
5910
5911- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
5912
5913- Issue #8046: Add context manager protocol support and .closed property to mmap
5914 objects.
5915
5916Library
5917-------
5918
5919- Issue #7451: Improve decoding performance of JSON objects, and reduce the
5920 memory consumption of said decoded objects when they use the same strings as
5921 keys.
5922
5923- Issue #1100562: Fix deep-copying of objects derived from the list and dict
5924 types. Patch by Michele Orrù and Björn Lindqvist.
5925
5926- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
5927
5928- Issue #9421: Made the get<type> methods consistently accept the vars and
5929 default arguments on all parser classes.
5930
5931- Issue #7005: Fixed output of None values for RawConfigParser.write and
5932 ConfigParser.write.
5933
5934- Issue #8990: array.fromstring() and array.tostring() get renamed to
5935 frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
5936 array.frombytes(), array.extend() as well as the array.array() constructor now
5937 accept bytearray objects. Patch by Thomas Jollans.
5938
5939- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
5940 issues when socket.close is called from a __del__ method.
5941
5942- Issue #9706: ssl module provides a better error handling in various
5943 circumstances.
5944
5945- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
5946 rid of the cached copy of thread-local attribute dictionary.
5947
5948- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
5949 are rounded to the nearest integer.
5950
5951- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
5952 falling into recursion.
5953
5954- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
5955 character years even if the message contains RFC822 two character years.
5956
5957- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
5958 operations on its self, namely x -= x and x ^= x.
5959
5960- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
5961 handling when accepting a new connection.
5962
5963- Issue #9601: ftplib now provides a workaround for non-compliant
5964 implementations such as IIS shipped with Windows server 2003 returning invalid
5965 response codes for MKD and PWD commands.
5966
5967- Issue #658749: asyncore's connect() method now correctly interprets winsock
5968 errors.
5969
5970- Issue #9501: Fixed logging regressions in cleanup code.
5971
5972- Fix functools.total_ordering() to skip methods inherited from object.
5973
5974- Issue #9572: Importlib should not raise an exception if a directory it thought
5975 it needed to create was done concurrently by another process.
5976
5977- Issue #9617: Signals received during a low-level write operation aren't
5978 ignored by the buffered IO layer anymore.
5979
5980- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
5981
5982- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
5983 error handler, or strict error handler on Windows.
5984
5985- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
5986 ``gzip.decompress``. Original patch by Anand B. Pillai.
5987
5988- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
5989 ssl.SSLContext object allowing bundling SSL configuration options,
5990 certificates and private keys into a single (potentially long-lived)
5991 structure.
5992
5993- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
5994 single keyword arguments.
5995
5996- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
5997 compiler flag values over defining its own.
5998
5999- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
6000 formatted code information in a string rather than displaying on screen.
6001
6002- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
6003 pointing to the original callable.
6004
6005- Issue #3445: functools.update_wrapper now tolerates missing attributes on
6006 wrapped callables.
6007
6008- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
6009
6010- Issue #9605: posix.getlogin() decodes the username with file filesystem
6011 encoding and surrogateescape error handler. Patch written by David Watson.
6012
6013- Issue #9604: posix.initgroups() encodes the username using the fileystem
6014 encoding and surrogateescape error handler. Patch written by David Watson.
6015
6016- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
6017 using the filesystem encoding and surrogateescape error handler. Patch written
6018 by David Watson.
6019
6020- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
6021 for use with the statvfs() function. Patch by Adam Jackson.
6022
6023- Issue #8688: MANIFEST files created by distutils now include a magic comment
6024 indicating they are generated. Manually maintained MANIFESTs without this
6025 marker will not be overwritten or removed.
6026
6027- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
6028 BadZipfile error is raised if it doesn't match (as used to be the case in
6029 Python 2.5 and earlier).
6030
6031- Issue #9550: a BufferedReader could issue an additional read when the original
6032 read request had been satisfied, which could block indefinitely when the
6033 underlying raw IO channel was e.g. a socket. Report and original patch by
6034 Jason V. Miller.
6035
6036- Issue #3757: thread-local objects now support cyclic garbage collection.
6037 Thread-local objects involved in reference cycles will be deallocated timely
6038 by the cyclic GC, even if the underlying thread is still running.
6039
6040- Issue #9452: Add read_file, read_string, and read_dict to the configparser
6041 API; new source attribute to exceptions.
6042
6043- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
6044 node.
6045
6046- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
6047 ``encoding="unicode"`` to generate a Unicode string.
6048
6049- Issue #8280: urllib2's Request method will remove fragments in the url. This
6050 is how it is supposed to work, wget and curl do the same. Previous behavior
6051 was wrong.
6052
6053- Issue #6683: For SMTP logins we now try all authentication methods advertised
6054 by the server. Many servers are buggy and advertise authentication methods
6055 they do not support in reality.
6056
6057- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
6058 included in the set of attributes copied by default by functools.wraps and
6059 functools.update_wrapper. Patch by Terrence Cole.
6060
6061- Issue #2944: asyncore doesn't handle connection refused correctly.
6062
6063- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
6064 the private attributes. Add tests for smtpd module.
6065
6066- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
6067 encoded in base64 is lacking padding.
6068
6069- Issue #9444: Argparse now uses the first element of prefix_chars as the option
6070 character for the added 'h/help' option if prefix_chars does not contain a
6071 '-', instead of raising an error.
6072
6073- Issue #7372: Fix pstats regression when stripping paths from profile data
6074 generated with the profile module.
6075
6076- Issue #9428: Fix running scripts with the profile/cProfile modules from the
6077 command line.
6078
6079- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
6080 browser.
6081
6082- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
6083 expressions.
6084
6085- Update collections.OrderedDict to match the implementation in Py2.7 (based on
6086 lists instead of weakly referenced Link objects).
6087
6088- Issue #8397: Raise an error when attempting to mix iteration and regular reads
6089 on a BZ2File object, rather than returning incorrect results.
6090
6091- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
6092 re-initializing a buffered IO object by calling its ``__init__`` method.
6093
6094- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
6095 across devices.
6096
6097- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
6098
6099- Issue #1690103: Fix initial namespace for code run with trace.main().
6100
6101- Issue #7395: Fix tracebacks in pstats interactive browser.
6102
6103- Issue #8230: Fix Lib/test/sortperf.py.
6104
6105- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
6106 newline, it no longer truncates the last character of the last command line.
6107
6108- Issue #5146: Handle UID THREAD command correctly in imaplib.
6109
6110- Issue #5147: Fix the header generated for cookie files written by
6111 http.cookiejar.MozillaCookieJar.
6112
6113- Issue #8198: In pydoc, output all help text to the correct stream when
6114 sys.stdout is reassigned.
6115
6116- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
6117 in ntpath.normpath().
6118
6119- Issue #1286: Allow using fileinput.FileInput as a context manager.
6120
6121- Add lru_cache() decorator to the functools module.
6122
6123Tools/Demos
6124-----------
6125
6126- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
6127
6128- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
6129 non-ASCII content.
6130
6131Tests
6132-----
6133
6134- Issue #9601: Provide a test case for ftplib.parse257.
6135
6136- Issue #8857: Provide a test case for socket.getaddrinfo.
6137
6138- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
6139
6140- Issue #8433: Fix test_curses failure with newer versions of ncurses.
6141
6142- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
6143 Michele Orrù.
6144
6145- Issue #8687: provide a test suite for sched.py module.
6146
6147Build
6148-----
6149
6150- Issue #1303434: Generate ZIP file containing all PDBs.
6151
6152- Issue #9193: PEP 3149 is accepted.
6153
6154- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
6155 become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
6156
6157- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
6158 Sébastien Sablé.
6159
6160- Don't run pgen twice when using make -j.
6161
6162
6163What's New in Python 3.2 Alpha 1?
6164=================================
6165
6166*Release date: 01-Aug-2010*
6167
6168Core and Builtins
6169-----------------
6170
6171- Issue #8991: convertbuffer() rejects discontigious buffers.
6172
6173- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
6174 compiler.
6175
6176- Issue #8413: structsequence now subclasses tuple.
6177
6178- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
6179 start byte and the continuation byte(s) are now considered invalid, instead of
6180 the number of bytes specified by the start byte. E.g.:
6181 '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
6182 with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
6183 even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
6184 returned a single u'\ufffd'.
6185
6186- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
6187 rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
6188
6189- Be more specific in error messages about positional arguments.
6190
6191- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
6192 objects, as described in the documentation.
6193
6194- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
6195 Fix the encoding of the modules filename. Patch written by Amaury Forgeot
6196 d'Arc.
6197
6198- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
6199 dealing with unary minus applied to a constant. The removed code was mutating
6200 the ST, causing a second compilation to fail.
6201
6202- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
6203 mode raises unicode errors. The encoder only supports "strict" and "replace"
6204 error handlers, the decoder only supports "strict" and "ignore" error
6205 handlers. Patch written by Mark Hammond.
6206
6207- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
6208 "w*" format instead. Add tests for "w*" format.
6209
6210- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
6211 formats if the string contains a null byte/character. Write unit tests for
6212 string formats.
6213
6214- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
6215 suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
6216 location of the raised exception.
6217
6218- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
6219 filenames and enable os.fsencode().
6220
6221- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
6222
6223- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
6224 interpreter with characters outside the Basic Multilingual Plane (higher than
6225 0x10000).
6226
6227- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
6228 TypeError instead of giving a DeprecationWarning when a float is parsed using
6229 the 'L' code (for long long). (All other integer codes already raise
6230 TypeError in this case.)
6231
6232- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
6233 enable shortcuts for upper case encoding name. Add also a shortcut for
6234 "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
6235
6236- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
6237 doesn't support "char buffer" anymore in Python 3.
6238
6239- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
6240 instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
6241 like bytearray.
6242
6243- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
6244 used anymore and it was never documented.
6245
6246- In str.format(), raise a ValueError when indexes to arguments are too large.
6247
6248- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
6249 integers n (including n = -909).
6250
6251- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
6252 of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
6253 easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
6254 equal value.
6255
6256- Issue #8748: Fix two issues with comparisons between complex and integer
6257 objects. (1) The comparison could incorrectly return True in some cases
6258 (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
6259 (2) The comparison raised an OverflowError for large integers, leading to
6260 unpredictable exceptions when combining integers and complex objects in sets
6261 or dicts.
6262
6263- Issue #8766: Initialize _warnings module before importing the first module.
6264 Fix a crash if an empty directory called "encodings" exists in sys.path.
6265
6266- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
6267 encoding and surrogateescape error handler instead of the locale encoding to
6268 be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
6269
6270- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
6271 of strict) error handler to escape surrogates.
6272
6273- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
6274 object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
6275 handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
6276 back to UTF-8.
6277
6278- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
6279 error handler, not only the default error handler (strict).
6280
6281- Issue #8610: Load file system codec at startup, and display a fatal error on
6282 failure. Set the file system encoding to utf-8 (instead of None) if getting
6283 the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
6284
6285- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
6286 PyUnicode_FromString() to support surrogates in the filename and use the right
6287 encoding.
6288
6289- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
6290
6291- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
6292
6293- Issue #8419: Prevent the dict constructor from accepting non-string keyword
6294 arguments.
6295
6296- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
6297 indirectly Python signal handlers anymore because mywrite() ignores exceptions
6298 (KeyboardInterrupt).
6299
6300- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
6301 unicode string (eg. backslashreplace).
6302
6303- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
6304 anymore, you have to convert your bytearray filenames to bytes.
6305
6306- Issue #7332: Remove the 16KB stack-based buffer in
6307 PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
6308 compared to the dynamic memory allocation fallback. Patch by Charles-François
6309 Natali.
6310
6311- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
6312 passed to bytes or bytearray.
6313
6314- Issue #7301: Add environment variable $PYTHONWARNINGS.
6315
6316- Issue #8329: Don't return the same lists from select.select when no fds are
6317 changed.
6318
6319- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
6320 64-bit machines. The shift count for either left or right shift is permitted
6321 to be up to sys.maxsize.
6322
6323- Ensure that tokenization of identifiers is not affected by locale.
6324
6325- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
6326
6327- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
6328
6329- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
6330 is set.
6331
6332- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
6333 is unknown.
6334
6335- Issue #1583863: A str subclass can now override the __str__ method.
6336
6337- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
6338 PyMemberDefs could produce an internal error; raise TypeError instead.
6339
6340- Issue #7845: Rich comparison methods on the complex type now return
6341 NotImplemented rather than raising a TypeError when comparing with an
6342 incompatible type; this allows user-defined classes to implement their own
6343 comparisons with complex.
6344
6345- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
6346 (SIGINT). If an error occurs while importing the site module, the error is
6347 printed and Python exits. Initialize the GIL before importing the site module.
6348
6349- Issue #7173: Generator finalization could invalidate sys.exc_info().
6350
6351- Issue #7544: Preallocate thread memory before creating the thread to avoid a
6352 fatal error in low memory condition.
6353
6354- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
6355 check fails.
6356
6357- Handle errors from looking up __prepare__ correctly.
6358
6359- Issue #5939: Add additional runtime checking to ensure a valid capsule in
6360 Modules/_ctypes/callproc.c.
6361
6362- Issue #7309: Fix unchecked attribute access when converting
6363 UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
6364
6365- Issue #6902: Fix problem with built-in types format incorrectly with 0
6366 padding.
6367
6368- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
6369 Now it matches other numeric types.
6370
6371- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
6372 PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
6373 PyOS_string_to_double instead. See issue #5835 for the original deprecations.
6374
6375- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
6376 fails. Patch by Florent Xicluna.
6377
6378- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
6379 very large step value.
6380
6381- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
6382 add the additional members returned in an OSVERSIONINFOEX structure. The new
6383 members are service_pack_major, service_pack_minor, suite_mask, and
6384 product_type.
6385
6386- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
6387 crash in many places because of the PyByteArray_AS_STRING() macro returning
6388 NULL. The macro now returns a statically allocated empty string instead.
6389
6390- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
6391 where the right hand operand is a set of constants, by turning the set into a
6392 frozenset and pre-building it as a constant. The comparison operation is made
6393 against the constant instead of building a new set each time it is executed (a
6394 similar optimization already existed which turned a list of constants into a
6395 pre-built tuple). Patch and additional tests by Dave Malcolm.
6396
6397- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
6398 of bytes, bytearray and unicode objects by using a common implementation based
6399 on stringlib's fast search. Patch by Florent Xicluna.
6400
6401- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
6402 including: (1) a serious 'wrong output' bug that could occur for long (> 40
6403 digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
6404 parsing certain long numeric strings corresponding to subnormal values, (3) a
6405 memory leak for some values large enough to cause overflow, and (4) a number
6406 of flaws that could lead to incorrectly rounded results.
6407
6408- The __complex__ method is now looked up on the class of instances to make it
6409 consistent with other special methods.
6410
6411- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
6412 `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
6413
6414- Issue #7604: Deleting an unset slotted attribute did not raise an
6415 AttributeError.
6416
6417- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
6418 in ** operator. The behaviour now conforms to that described in C99 Annex F.
6419
6420- Issue #1811: improve accuracy and cross-platform consistency for true division
6421 of integers: the result of a/b is now correctly rounded for ints a and b (at
6422 least on IEEE 754 platforms), and in particular does not depend on the
6423 internal representation of an int.
6424
6425- Issue #6834: replace the implementation for the 'python' and 'pythonw'
6426 executables on OSX.
6427
6428 These executables now work properly with the arch(1) command: ``arch -ppc
6429 python`` will start a universal binary version of python in PPC mode (unlike
6430 previous releases).
6431
6432- Issue #7466: Segmentation fault when the garbage collector is called in the
6433 middle of populating a tuple. Patch by Florent Xicluna.
6434
6435- Issue #7419: setlocale() could crash the interpreter on Windows when called
6436 with invalid values.
6437
6438- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
6439 mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
6440
6441- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
6442 10.6.
6443
6444- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
6445
6446- Issue #6970: Remove redundant calls when comparing objects that don't
6447 implement the relevant rich comparison methods.
6448
6449- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
6450 range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
6451 long but the length of the range did not. Also fix several cases where
6452 reversed(range(a, b, c)) gave wrong results, and fix a refleak for
6453 reversed(range(a, b, c)) with large arguments.
6454
6455- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
6456 during the formation of an output tuple.
6457
6458- Issue #3297: On wide unicode builds, do not split unicode characters into
6459 surrogates.
6460
6461- Remove length limitation when constructing a complex number from a string.
6462
6463- Issue #1087418: Boost performance of bitwise operations for longs.
6464
6465- Support for AtheOS has been completely removed from the code base. It was
6466 disabled since Python 3.0.
6467
6468- Support for several legacy threading libraries has been disabled. These
6469 libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
6470 will be entirely removed in 3.3.
6471
6472- Support for OSF* has been disabled. If nobody stands up, support will be
6473 removed in 3.3. See <http://bugs.python.org/issue8606>.
6474
6475- Peephole constant folding had missed UNARY_POSITIVE.
6476
6477- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
6478 fixes the problem of some exceptions being thrown at shutdown when the
6479 interpreter is killed. Patch by Adam Olsen.
6480
6481- Issue #7147: Remove support for compiling Python without complex number
6482 support.
6483
6484- Issue #7120: logging: Removed import of multiprocessing which is causing crash
6485 in GAE.
6486
6487- Issue #1754094: Improve the stack depth calculation in the compiler. There
6488 should be no other effect than a small decrease in memory use. Patch by
6489 Christopher Tur Lesniewski-Laas.
6490
6491- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
6492 byte values greater than 127. Patch by Derk Drukker.
6493
6494- Issue #1571184: The Unicode database contains properties for more characters.
6495 The tables for code points representing numeric values, white spaces or line
6496 breaks are now generated from the official Unicode Character Database files,
6497 and include information from the Unihan.txt file.
6498
6499- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
6500 producing internally inconsistent Python longs.
6501
6502- Issue #6990: Fix threading.local subclasses leaving old state around after a
6503 reference cycle GC which could be recycled by new locals.
6504
6505- Issue #5460: Fix an ambiguity in the grammar.
6506
6507- Issue #1766304: Improve performance of membership tests on range objects.
6508
6509- Issue #6713: Improve performance of integer -> string conversions.
6510
6511- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
6512
6513- Issue #6750: A text file opened with io.open() could duplicate its output when
6514 writing from multiple threads at the same time.
6515
6516- Issue #6707: dir() on an uninitialized module caused a crash.
6517
6518- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
6519
6520- Issue #6573: set.union() stopped processing inputs if an instance of self
6521 occurred in the argument chain.
6522
6523- Issue #6070: On posix platforms import no longer copies the execute bit from
6524 the .py file to the .pyc file if it is set.
6525
6526- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
6527
6528- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
6529 and not an int. Fix the corresponding error message, and the documentation.
6530
6531- The deprecated PyCObject has been removed.
6532
6533- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
6534 build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
6535 of stdint.h on that platform.
6536
6537- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
6538 'surrogateescape' error handler, a string which contains unpaired surrogates.
6539
6540- Issue #4856: Remove checks for win NT.
6541
6542- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
6543 to construct a null-initialized bytes object.
6544
6545- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
6546 methods allow the conversion of integers to bytes, and vice-versa.
6547
6548- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
6549 from being copied with copy.copy(), and bytes subclasses from being pickled
6550 properly.
6551
6552- Code objects now support weak references.
6553
6554- Issue #7072: isspace(0xa0) is true on Mac OS X.
6555
6556- Issue #8084: PEP 370 now conforms to system conventions for framework builds
6557 on MacOS X. That is, "python setup.py install --user" will install into
6558 "~/Library/Python/2.7" instead of "~/.local".
6559
6560C-API
6561-----
6562
6563- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
6564 variable argument list. `Py_VA_COPY` is equivalent to C99
6565 `va_copy`, but available on all python platforms.
6566
6567- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
6568 instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
6569 "step = -step" when reversing a slice.
6570
6571- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
6572 interpreter to set sys.argv without also modifying sys.path. This helps fix
6573 `CVE-2008-5983
6574 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
6575
6576- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
6577 strings in an efficient manner.
6578
6579- Issue #8276: PyEval_CallObject() is now only available in macro form. The
6580 function declaration, which was kept for backwards compatibility reasons, is
6581 now removed (the macro was introduced in 1997!).
6582
6583- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
6584 PyLong_AsLongAndOverflow.
6585
6586- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
6587 has '\0' at the end.
6588
6589- Issue #5080: The argument parsing functions PyArg_ParseTuple,
6590 PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
6591 PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
6592 'L' format code. This will become a TypeError in a future version of Python,
6593 to match the behaviour of the other integer format codes.
6594
6595- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
6596
6597- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
6598 PyArg_ParseTupleAndKeywords.
6599
6600- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
6601 PyErr_Format, on machines with HAVE_LONG_LONG defined.
6602
6603- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
6604 PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for
6605 accessing the d_type and d_name members of structures using PyDescr_COMMON.
6606
6607- Issue #6405: Remove duplicate type declarations in descrobject.h.
6608
6609- The code flags for old __future__ features are now available again.
6610
6611- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
6612 PyCode_Addr2Line().
6613
6614- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
6615 object at a specified file, function, and line number.
6616
6617- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
6618 ``const char *`` as the string is stored beyond the call.
6619
6620- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
6621 allocator will be automatically disabled when running under Valgrind. This
6622 gives improved memory leak detection when running under Valgrind, while taking
6623 advantage of pymalloc at other times.
6624
6625Library
6626-------
6627
6628- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
6629 old commands are restored.
6630
6631- For traceback debugging, the pdb listing now also shows the locations where
6632 the exception was originally (re)raised, if it differs from the last line
6633 executed (e.g. in case of finally clauses).
6634
6635- The pdb command "source" has been added. It displays the source code for a
6636 given object, if possible.
6637
6638- The pdb command "longlist" has been added. It displays the whole source code
6639 for the current function.
6640
6641- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
6642 output into methods.
6643
6644- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
6645 emit a message when a breakpoint is enabled or disabled.
6646
6647- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
6648 top-level debugged frame.
6649
6650- Issue #5727: Restore the ability to use readline when calling into pdb in
6651 doctests.
6652
6653- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
6654 source file to be debugged is in a non-builtin encoding.
6655
6656- Issue #8048: Prevent doctests from failing when sys.displayhook has been
6657 reassigned.
6658
6659- Issue #8015: In pdb, do not crash when an empty line is entered as a
6660 breakpoint command.
6661
6662- In pdb, allow giving a line number to the "until" command.
6663
6664- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
6665 files. Also, add a command-line option "-c" that runs a command as if given
6666 in .pdbrc.
6667
6668- Issue #4179: In pdb, allow "list ." as a command to return to the currently
6669 debugged line.
6670
6671- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
6672 entries, consider the first one.
6673
6674- Issue #6630: Allow customizing regex flags when subclassing the
6675 string.Template class.
6676
6677- Issue #9411: Allow specifying an encoding for config files in the configparser
6678 module.
6679
6680- Issue #1682942: Improvements to configparser: support alternate delimiters,
6681 alternate comment prefixes and empty lines in values.
6682
6683- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
6684
6685- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
6686
6687- Issue #9378: python -m pickle <pickle file> will now load and display the
6688 first object in the pickle file.
6689
6690- Issue #4770: Restrict binascii module to accept only bytes (as specified).
6691 And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
6692 before ASCII-to-binary decoding.
6693
6694- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
6695
6696- The default size of the re module's compiled regular expression cache has been
6697 increased from 100 to 500 and the cache replacement policy has changed from
6698 simply clearing the entire cache on overflow to forgetting the least recently
6699 used cached compiled regular expressions. This is a performance win for
6700 applications that use a lot of regular expressions and limits the impact of
6701 the performance hit anytime the cache is exceeded.
6702
6703- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
6704
6705- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
6706 error occurs when the server closes the socket and the client sends a big
6707 XML-RPC request.
6708
6709- Issue #4629: getopt raises an error if an argument ends with "=", whereas
6710 getopt doesn't accept a value (eg. --help= is rejected if getopt uses
6711 ['help='] long options).
6712
6713- Issue #7989: Added pure python implementation of the `datetime` module. The C
6714 module is renamed to `_datetime` and if available, overrides all classes
6715 defined in datetime with fast C impementation. Python implementation is based
6716 on the original python prototype for the datetime module by Tim Peters with
6717 minor modifications by the PyPy project. The test suite now tests `datetime`
6718 module with and without `_datetime` acceleration using the same test cases.
6719
6720- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
6721
6722- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
6723 script being traced. Patch by Eli Bendersky.
6724
6725- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
6726 the patch.
6727
6728- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
6729 parameters.
6730
6731- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
6732 which controls printing of opcode descriptions in ``dis()`` output.
6733
6734- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
6735 crosses an 8192 byte boundary.
6736
6737- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
6738
6739- ``ast.literal_eval()`` now allows byte literals.
6740
6741- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
6742 keyword arguments called 'self' or 'other' specially.
6743
6744- ``ast.literal_eval()`` now allows set literals.
6745
6746- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
6747
6748- Issue #7646: The fnmatch pattern cache no longer grows without bound.
6749
6750- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
6751 produced when profiling the decimal module. This was due to a dangerous
6752 iteration over 'locals()' in Context.__init__.
6753
6754- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
6755 and the exponent is tiny (for example, ``Decimal(10) **
6756 Decimal('1e-999999999')``).
6757
6758- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
6759
6760- Issue #9130: Fix validation of relative imports in parser module.
6761
6762- Issue #9128: Fix validation of class decorators in parser module.
6763
6764- Issue #9094: python -m pickletools will now disassemble pickle files listed in
6765 the command line arguments. See output of python -m pickletools -h for more
6766 details.
6767
6768- Issue #5468: urlencode to handle bytes type and other encodings in its query
6769 parameter. Patch by Dan Mahn.
6770
6771- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
6772 ensure that the input string length is a multiple of the frame size.
6773
6774- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
6775 Urban.
6776
6777- Issue #7829: Clearly document that the dis module is exposing an
6778 implementation detail that is not stable between Python VMs or releases.
6779
6780- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
6781 raises an exception.
6782
6783- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
6784 that act as both context managers and decorators. contextmanager changes to
6785 use ContextDecorator.
6786
6787- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
6788 for removal in Python 3.4.
6789
6790- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
6791 giving the number of frames to go.
6792
6793- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
6794 ``str`` or ``bytes``.
6795
6796- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
6797 OpenSSL structure.
6798
6799- Issue #8682: The ssl module now temporary increments the reference count of a
6800 socket object got through ``PyWeakref_GetObject``, so as to avoid possible
6801 deallocation while the object is still being used.
6802
6803- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
6804 password instead of presenting an interactive prompt. Older behavior can be
6805 obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
6806
6807- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
6808 smart enough to find source files in the linecache.
6809
6810- Issue #5610: feedparser no longer eats extra characters at the end of a body
6811 part if the body part ends with a ``\r\n``.
6812
6813- Issue #8986: math.erfc was incorrectly raising OverflowError for values
6814 between -27.3 and -30.0 on some platforms.
6815
6816- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
6817
6818- Issue #8966: If a ctypes structure field is an array of c_char, convert its
6819 value to bytes instead of str (as done for c_char and c_char_p).
6820
6821- Issue #8188: Comparisons between Decimal and Fraction objects are now
6822 permitted, returning a result based on the exact numerical values of the
6823 operands. This builds on issue #2531, which allowed Decimal-to-float
6824 comparisons; all comparisons involving numeric types (bool, int, float,
6825 complex, Decimal, Fraction) should now act as expected.
6826
6827- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
6828 Thomas Jollans.
6829
6830- Issue #8899: time.struct_time now has class and attribute docstrings.
6831
6832- Issue #6470: Drop UNC prefix in FixTk.
6833
6834- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
6835 strings. They are now correctly converted to strings.
6836
6837- Issue #8833: tarfile created hard link entries with a size field != 0 by
6838 mistake.
6839
6840- Charset.body_encode now correctly handles base64 encoding by encoding with the
6841 output_charset before calling base64mime.encode. Passes the tests from 2.x
6842 issue #1368247.
6843
6844- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
6845 attribute that is True iff there are uncommitted changes.
6846
6847- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
6848 divided by float and int objects. Results are rounded to the nearest multiple
6849 of timedelta.resolution with ties resolved using round-half-to-even method.
6850
6851- Issue #7150: Raise OverflowError if the result of adding or subtracting
6852 timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
6853
6854- Issue #8806: add SSL contexts support to ftplib.
6855
6856- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
6857 and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
6858 API.
6859
6860- Issue #8770: Now sysconfig displays information when it's called as a script.
6861 Initial idea by Sridhar Ratnakumar.
6862
6863- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
6864 Fredrik Håård.
6865
6866- Issue #8540: Decimal module: rename the Context._clamp attribute to
6867 Context.clamp and make it public. This is useful in creating contexts that
6868 correspond to the decimal interchange formats specified in IEEE 754.
6869
6870- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
6871 twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
6872 StreamWriter classes.
6873
6874- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
6875 of the C file stderr, to use stderr encoding and error handler.
6876
6877- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
6878 of files without one.
6879
6880- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
6881 comparing to a non-mapping.
6882
6883- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
6884 correct encoding.
6885
6886- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
6887 ``OP_*`` constants to the `ssl` module. This allows to selectively disable
6888 protocol versions, when used in combination with `PROTOCOL_SSLv23`.
6889
6890- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
6891
6892- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
6893 compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
6894 stdout is not a TTY).
6895
6896- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
6897 subprocess.Popen() and os._execvpe() support bytes program name. Add
6898 os.supports_bytes_environ flag: True if the native OS type of the environment
6899 is bytes (eg. False on Windows).
6900
6901- Issue #8633: tarfile is now able to read and write archives with "raw" binary
6902 pax headers as described in POSIX.1-2008.
6903
6904- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
6905 unquote, unquote_to_bytes.
6906
6907- Issue #8688: Distutils now recalculates MANIFEST everytime.
6908
6909- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
6910 surrogates and bytes for the filename.
6911
6912- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
6913
6914- Issue #8681: Make the zlib module's error messages more informative when the
6915 zlib itself doesn't give any detailed explanation.
6916
6917- The audioop module now supports sound fragments of length greater than 2**31
6918 bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
6919
6920- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
6921 class.
6922
6923- Issue #8664: In py_compile, create __pycache__ when the compiled path is
6924 given.
6925
6926- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
6927 for use in the file system, environment variables or the command line.
6928
6929- Issue #8571: Fix an internal error when compressing or decompressing a chunk
6930 larger than 1GB with the zlib module's compressor and decompressor objects.
6931
6932- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
6933 mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
6934 file system encoding with the surrogateescape error handler (instead of
6935 utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
6936
6937- Issue #8573: asyncore _strerror() function might throw ValueError.
6938
6939- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
6940 messages when accessing undefined class attributes because of the cheap
6941 inheritance with the underlying socket object. The cheap inheritance has been
6942 deprecated.
6943
6944- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
6945 Patch by Tres Seaver.
6946
6947- Issue #8390: tarfile uses surrogateescape as the default error handler
6948 (instead of replace in read mode or strict in write mode).
6949
6950- Issue #7755: Use an unencumbered audio file for tests.
6951
6952- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
6953 and any children created using ``os.fork`` on MacOS X 10.6.
6954
6955- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
6956 operation raises multiple signals and more than one of those signals is
6957 trapped, the specification determines the order in which the signals should be
6958 handled. In many cases this order wasn't being followed, leading to the wrong
6959 Python exception being raised.
6960
6961- Issue #7865: The close() method of ``io`` objects should not swallow
6962 exceptions raised by the implicit flush(). Also qensure that calling close()
6963 several times is supported. Patch by Pascal Chambon.
6964
6965- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
6966 gc.DEBUG_STATS.
6967
6968- Issue #8354: The siginterrupt setting is now preserved for all signals, not
6969 just SIGCHLD.
6970
6971- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
6972 webbrowser.get("safari").
6973
6974- Issue #8464: tarfile no longer creates files with execute permissions set when
6975 mode="w|" is used.
6976
6977- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
6978 the Linux kernel. Patch by Yaniv Aknin.
6979
6980- Issue #8295: Added shutil.unpack_archive.
6981
6982- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
6983 It should correctly return an empty response now.
6984
6985- Issue #8546: Reject None given as the buffering argument to _pyio.open.
6986
6987- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
6988 Sridhar Ratnakumar.
6989
6990- Issue #6656: fix locale.format_string to handle escaped percents
6991 and mappings.
6992
6993- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
6994 the method could block indefinitely if called just before the event loop
6995 started running. This also fixes the occasional freezes witnessed in
6996 test_httpservers.
6997
6998- Issue #8524: When creating an SSL socket, the timeout value of the original
6999 socket wasn't retained (instead, a socket with a positive timeout would be
7000 turned into a non-blocking SSL socket).
7001
7002- Issue #5103: SSL handshake would ignore the socket timeout and block
7003 indefinitely if the other end didn't respond.
7004
7005- The do_handshake() method of SSL objects now adjusts the blocking mode of the
7006 SSL structure if necessary (as other methods already do).
7007
7008- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
7009 bytes strings for environment keys and values.
7010
7011- Issue #8467: Pure Python implementation of subprocess encodes the error
7012 message using surrogatepass error handler to support surrogates in the
7013 message.
7014
7015- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
7016
7017- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
7018 string "python" as the *ident*. openlog() arguments are all optional and
7019 keywords.
7020
7021- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
7022 non-infinite timeout. Also make that method friendlier with applications
7023 wanting to continue using the socket in clear-text mode, by disabling
7024 OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
7025
7026- Issue #8496: make mailcap.lookup() always return a list, rather than an
7027 iterator. Patch by Gregory Nofi.
7028
7029- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
7030 collation name contains a surrogate character.
7031
7032- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
7033 extension, such that verification of some SSL certificates doesn't fail
7034 because of an "unknown algorithm".
7035
7036- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
7037
7038- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
7039
7040- Issue #4814: timeout parameter is now applied also for connections resulting
7041 from PORT/EPRT commands.
7042
7043- Issue #8463: added missing reference to bztar in shutil's documentation.
7044
7045- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
7046 long as the user didn't specify 'automatic proxy configuration').
7047
7048- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
7049 as stated in RFC-959 at chapter 5.4.
7050
7051- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
7052 surrogates.
7053
7054- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
7055 `threading.Semaphore` objects. Original patch by Torsten Landschoff.
7056
7057- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
7058 available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
7059
7060- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
7061 the current working directory.
7062
7063- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
7064 using backslashreplace error handler.
7065
7066- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
7067
7068- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
7069 Locke and Hans Ulrich Niedermann.
7070
7071- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
7072
7073- Issue #7316: The acquire() method of lock objects in the ``threading``
7074 module now takes an optional timeout argument in seconds. Timeout support
7075 relies on the system threading library, so as to avoid a semi-busy wait loop.
7076
7077- Issue #8383: pickle and pickletools use surrogatepass error handler when
7078 encoding unicode as utf8 to support lone surrogates and stay compatible with
7079 Python 2.x and 3.x.
7080
7081- Issue #7585: difflib context and unified diffs now place a tab between
7082 filename and date, conforming to the 'standards' they were originally designed
7083 to follow. This improves compatibility with patch tools.
7084
7085- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
7086 character sets will now consistently use a Content-Transfer-Encoding of 7bit
7087 rather than sometimes being marked as 8bit.
7088
7089- Issue #8375: test_distutils now checks if the temporary directory are still
7090 present before it cleans them.
7091
7092- Issue #8374: Update the internal alias table in the ``locale`` module to
7093 cover recent locale changes and additions.
7094
7095- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
7096 using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
7097 `ssl.OPENSSL_VERSION_NUMBER`.
7098
7099- Add functools.total_ordering() and functools.cmp_to_key().
7100
7101- Issue #8257: The Decimal construct now accepts a float instance directly,
7102 converting that float to a Decimal of equal value:
7103
7104 >>> Decimal(1.1)
7105 Decimal('1.100000000000000088817841970012523233890533447265625')
7106
7107- Issue #8294: The Fraction constructor now accepts Decimal and float instances
7108 directly.
7109
7110- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
7111 InvalidOperation instead of returning False. (Comparisons involving a quiet
7112 NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
7113 signaling NaNs remain unhashable.
7114
7115- Issue #2531: Comparison operations between floats and Decimal instances now
7116 return a result based on the numeric values of the operands; previously they
7117 returned an arbitrary result based on the relative ordering of id(float) and
7118 id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
7119 comparisons.
7120
7121- Added a subtract() method to collections.Counter().
7122
7123- Issue #8233: When run as a script, py_compile.py optionally takes a single
7124 argument `-` which tells it to read files to compile from stdin. Each line is
7125 read on demand and the named file is compiled immediately. (Original patch by
7126 Piotr Ożarowski).
7127
7128- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
7129 form feed (0x0C) are now considered linebreaks, as specified in Unicode
7130 Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
7131
7132- Comparisons using one of <, <=, >, >= between a complex instance and a
7133 Fractions instance now raise TypeError instead of returning True/False. This
7134 makes Fraction <=> complex comparisons consistent with int <=> complex, float
7135 <=> complex, and complex <=> complex comparisons.
7136
7137- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
7138 methods (such as oss_mixer_device.fileno()) were not available. Initial patch
7139 by Bertrand Janin.
7140
7141- Issue #8205: Remove the "Modules" directory from sys.path when Python is
7142 running from the build directory (POSIX only).
7143
7144- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
7145 didn't support chflags() (for example ZFS under FreeBSD). The error is now
7146 silenced.
7147
7148- Issue #7860: platform.uname now reports the correct 'machine' type when Python
7149 is running in WOW64 mode on 64 bit Windows.
7150
7151- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
7152 Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
7153 reads and writes are always retried by OpenSSL itself.
7154
7155- Issue #4282: Fix the main function of the profile module for a non-ASCII
7156 script, open the file in binary mode and not in text mode with the default
7157 (utf8) encoding.
7158
7159- Issue #8179: Fix macpath.realpath() on a non-existing path.
7160
7161- Issue #8024: Update the Unicode database to 5.2.
7162
7163- Issue #8168: py_compile now handles files with utf-8 BOMS.
7164
7165- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
7166 detected.
7167
7168- Issue #6716/2: Backslash-replace error output in compilall.
7169
7170- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
7171 with Tcl/Tk-8.5.
7172
7173- Issue #8140: extend compileall to compile single files. Add -i option.
7174
7175- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
7176 locale.
7177
7178- The internals of the subprocess module on POSIX systems have been replaced by
7179 an extension module (_posixsubprocess) so that the fork()+exec() can be done
7180 safely without the possibility of deadlock in multithreaded applications.
7181
7182- subprocess.Popen now has restore_signals and start_new_session features. The
7183 default of restore_signals=True is a new behavior compared to earlier Python
7184 versions. This means that signals such as SIGPIPE are not ignored by default
7185 in subprocesses launched by Python (Issue #1652).
7186
7187- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
7188 cElementTree module is updated too.
7189
7190- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
7191 an non existent program name and Python is unable to retrieve the real program
7192 name.
7193
7194- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
7195
7196- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
7197 replacement were all bytes. Patch by Antoine Pitrou.
7198
7199- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
7200 bugs and allows loading SQLite extensions from shared libraries.
7201
7202- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
7203 Review Issue #29 (http://unicode.org/review/pr-29.html).
7204
7205- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
7206 reset also the pointer to the current pointer context.
7207
7208- Issue #7232: Add support for the context manager protocol to the TarFile
7209 class.
7210
7211- Issue #7250: Fix info leak of os.environ across multi-run uses of
7212 wsgiref.handlers.CGIHandler.
7213
7214- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
7215
7216- Issue #691291: codecs.open() should not convert end of lines on reading and
7217 writing.
7218
7219- Issue #7869: logging: improved diagnostic for format-time errors.
7220
7221- Issue #7868: logging: added loggerClass attribute to Manager.
7222
7223- logging: Implemented PEP 391.
7224
7225- Issue #1537721: Add a writeheader() method to csv.DictWriter.
7226
7227- Issue #7959: ctypes callback functions are now registered correctly with the
7228 cycle garbage collector.
7229
7230- Issue #5801: removed spurious empty lines in wsgiref.
7231
7232- Issue #6666: fix bug in trace.py that applied the list of directories to be
7233 ignored only to the first file. Noted by Bogdan Opanchuk.
7234
7235- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
7236 Kan-Ru Chen.
7237
7238- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
7239
7240- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
7241 messages parsed by email.Parser.HeaderParser.
7242
7243- Issue #7361: Importlib was not properly checking the number of bytes in
7244 bytecode file when it was less then 8 bytes.
7245
7246- Issue #7633: In the decimal module, Context class methods (with the exception
7247 of canonical and is_canonical) now accept instances of int and long wherever a
7248 Decimal instance is accepted, and implicitly convert that argument to Decimal.
7249 Previously only some arguments were converted.
7250
7251- Issue #7835: shelve should no longer produce mysterious warnings during
7252 interpreter shutdown.
7253
7254- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
7255 processing instructions and comments. These raw characters are allowed by the
7256 XML specification, and are necessary when outputting e.g. PHP code in a
7257 processing instruction. Patch by Neil Muller.
7258
7259- Issue #6233: ElementTree failed converting unicode characters to XML entities
7260 when they could't be represented in the requested output encoding. Patch by
7261 Jerry Chen.
7262
7263- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
7264 compression type.
7265
7266- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
7267 specified, rather than fall through to AF_PACKET (in the `socket` module).
7268 Also, raise ValueError rather than TypeError when an unknown TIPC address type
7269 is specified. Patch by Brian Curtin.
7270
7271- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
7272 position when calling `truncate()`. It would previously change the file
7273 position to the given argument, which goes against the tradition of
7274 ftruncate() and other truncation APIs. Patch by Pascal Chambon.
7275
7276- Issue #7610: Reworked implementation of the internal
7277 ``zipfile.ZipExtFile`` class used to represent files stored inside an
7278 archive. The new implementation is significantly faster and can be wrapped in
7279 a ``io.BufferedReader`` object for more speedups. It also solves an
7280 issue where interleaved calls to `read()` and `readline()` give wrong results.
7281 Patch by Nir Aides.
7282
7283- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
7284 allowing for a maximum number of tasks within the pool to be completed by the
7285 worker before that worker is terminated, and a new one created to replace it.
7286
7287- Issue #7792: Registering non-classes to ABCs raised an obscure error.
7288
7289- Issue #7785: Don't accept bytes in FileIO.write().
7290
7291- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
7292
7293- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
7294 the release file is empty.
7295
7296- Issue #7561: Fix crashes when using bytearray objects with the posix
7297 module.
7298
7299- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
7300 multipart/signed MIME parts, which fixes one of the sources of invalid
7301 modifications to such parts by Generator.
7302
7303- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
7304 by Florent Xicluna, along with some additional tests.
7305
7306- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
7307 argument. Patch by Victor Stinner.
7308
7309- Issue #3299: Fix possible crash in the _sre module when given bad argument
7310 values in debug mode. Patch by Victor Stinner.
7311
7312- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
7313 by Brian Curtin.
7314
7315- Issue #7681: Use floor division in appropiate places in the wave module.
7316
7317- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
7318 Extension extra options may change the output without changing the .c
7319 file). Initial patch by Collin Winter.
7320
7321- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
7322 when it has a fully qualified configuration prefix. Initial patch by Arfrever.
7323
7324- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
7325 destruction of weakref'ed objects while iterating.
7326
7327- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
7328 Stinner.
7329
7330- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
7331 properly handles EINTR within the read, readline, write & flush methods. The
7332 socket.sendall() method now properly handles interrupted system calls.
7333
7334- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
7335 make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
7336 wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
7337
7338- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
7339 parameter to allow specifying where your connections come from.
7340
7341- socket.create_connection now accepts an optional source_address parameter.
7342
7343- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
7344 patch by Brian Curtin.
7345
7346- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
7347 Manifest file in text mode so string patterns can be used in regular
7348 expressions.
7349
7350- Issue #7552: Removed line feed in the base64 Authorization header in the
7351 Distutils upload command to avoid an error when PyPI reads it. This occurs on
7352 long passwords. Initial patch by JP St. Pierre.
7353
7354- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
7355 Tatsuhiro Tsujikawa.
7356
7357- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
7358 TypeError when given an `str` object (rather than a `bytes`-like object).
7359 Patch by Victor Stinner and Florent Xicluna.
7360
7361- Issue #7349: Make methods of file objects in the io module accept None as an
7362 argument where file-like objects (ie StringIO and BytesIO) accept them to mean
7363 the same as passing no argument.
7364
7365- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
7366
7367- Issue #5949: added check for correct lineends in input from IMAP server in
7368 imaplib.
7369
7370- Add count() and reverse() methods to collections.deque().
7371
7372- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
7373
7374- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
7375 parameter types. Patch by Victor Stinner.
7376
7377- Issue #7457: added a read_pkg_file method to
7378 distutils.dist.DistributionMetadata.
7379
7380- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
7381 TLS with authentication credentials.
7382
7383- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
7384 in Distutils. Patch by Stephen Emslie.
7385
7386- Issue #4120: Drop reference to CRT from manifest when building extensions with
7387 msvc9compiler.
7388
7389- Issue #7333: The `posix` module gains an `initgroups()` function providing
7390 access to the initgroups(3) C library call on Unix systems which implement it.
7391 Patch by Jean-Paul Calderone.
7392
7393- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
7394 ownership when the group is not forced, because the group may be different
7395 from the user's group and inherit from its container when the test is run.
7396
7397- Issue #4486: When an exception has an explicit cause, do not print its
7398 implicit context too. This affects the `traceback` module as well as built-in
7399 exception printing.
7400
7401- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
7402 Collins.
7403
7404- Issue #7403: logging: Fixed possible race condition in lock creation.
7405
7406- Issue #6845: Add restart support for binary upload in ftplib. The
7407 `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
7408 argument. Patch by Pablo Mouzo.
7409
7410- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
7411 returning the total number of seconds in the duration. Patch by Brian
7412 Quinlan.
7413
7414- Issue #7133: SSL objects now support the new buffer API.
7415
7416- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
7417
7418- Issue #6123: tarfile now opens empty archives correctly and consistently
7419 raises ReadError on empty files.
7420
7421- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
7422
7423- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
7424 of __str__.
7425
7426- Issue #7341: Close the internal file object in the TarFile constructor in case
7427 of an error.
7428
7429- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
7430 Windows box. Help provided by David Bolen.
7431
7432- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
7433 or SSL. Patch by Giampaolo Rodola'.
7434
7435- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
7436
7437- Issue #4969: The mimetypes module now reads the MIME database from the
7438 registry under Windows. Patch by Gabriel Genellina.
7439
7440- Issue #6816: runpy now provides a run_path function that allows Python code to
7441 execute file paths that refer to source or compiled Python files as well as
7442 zipfiles, directories and other valid sys.path entries that contain a
7443 __main__.py file. This allows applications that run other Python scripts to
7444 support the same flexibility as the CPython command line itself.
7445
7446- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
7447 connection with another process, rather than looping endlessly. The default
7448 timeout is 20 seconds, which should be amply sufficient for local connections.
7449
7450- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
7451 unpickled. This fixes crashes under Windows when trying to run
7452 test_multiprocessing in verbose mode.
7453
7454- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
7455 argument added to the TextTestRunner constructor allowing a different result
7456 class to be used without having to subclass.
7457
7458- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
7459 name in failure reports even if the test has a docstring.
7460
7461- Issue #3001: Add a C implementation of recursive locks which is used by
7462 default when instantiating a `threading.RLock` object. This makes recursive
7463 locks as fast as regular non-recursive locks (previously, they were slower by
7464 10x to 15x).
7465
7466- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
7467 those started through `threading.Thread` (for example, using
7468 `_thread.start_new_thread()`).
7469
7470- Issue #7187: Importlib would not silence the IOError raised when trying to
7471 write new bytecode when it was made read-only.
7472
7473- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
7474 which are part of a reference cycle.
7475
7476- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
7477 objects on 64-bit systems. Patch by Michael Broghton.
7478
7479- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
7480 modification is done through it. This fixes inconsistencies and test failures
7481 on systems with slightly bogus mtime behaviour.
7482
7483- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
7484 from stdin so that existing input does not confuse it and lead to incorrect
7485 entry or an IOError. It also properly flushes it afterwards to avoid the
7486 terminal echoing the input afterwards on OSes such as Solaris.
7487
7488- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
7489 they accept an int or long as the second argument. Also fix buggy handling of
7490 large arguments (those with coefficient longer than the current precision) in
7491 shift and rotate.
7492
7493- Issue #4750: Store the basename of the original filename in the gzip FNAME
7494 header as required by RFC 1952.
7495
7496- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
7497 Distutils.
7498
7499- Issue #7218: Fix test_site for win32, the directory comparison was done with
7500 an uppercase.
7501
7502- Issue #7205: Fix a possible deadlock when using a BZ2File object from
7503 several threads at once.
7504
7505- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
7506
7507- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
7508 larger than emax.
7509
7510- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
7511 platforms, and assorted locale fixes by Derk Drukker.
7512
7513- Issue #5833: Fix extra space character in readline completion with the GNU
7514 readline library version 6.0.
7515
7516- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
7517
7518- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
7519 anachronisms in the code which were a relic of 1.5.2 compatibility.
7520
7521- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
7522 to look for it is the Content-Type header.
7523
7524- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
7525 builtin tokenizer.
7526
7527- Issue #7048: Force Decimal.logb to round its result when that result is too
7528 large to fit in the current precision.
7529
7530- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
7531 other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
7532
7533- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
7534 always result in NULL.
7535
7536- Issue #5042: Structure sub-subclass does now initialize correctly with base
7537 class positional arguments.
7538
7539- Issue #6882: Import uuid creates zombies processes.
7540
7541- Issue #6635: Fix profiler printing usage message.
7542
7543- Issue #6856: Add a filter keyword argument to TarFile.add().
7544
7545- Issue #6888: pdb's alias command was broken when no arguments were given.
7546
7547- Issue #6857: Default format() alignment should be '>' for Decimal instances.
7548
7549- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
7550 NaN or raising InvalidContext. Also, fix infinite recursion in
7551 long(Decimal('nan')).
7552
7553- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
7554 type specifier.
7555
7556- Issue #6239: ctypes.c_char_p return value must return bytes.
7557
7558- Issue #6838: Use a list to accumulate the value instead of repeatedly
7559 concatenating strings in http.client's HTTPResponse._read_chunked providing a
7560 significant speed increase when downloading large files servend with a
7561 Transfer-Encoding of 'chunked'.
7562
7563- Trying to import a submodule from a module that is not a package, ImportError
7564 should be raised, not AttributeError.
7565
7566- When the globals past to importlib.__import__() has __package__ set to None,
7567 fall back to computing what __package__ should be instead of giving up.
7568
7569- Raise a TypeError when the name of a module to be imported for
7570 importlib.__import__ is not a string (was raising an AttributeError before).
7571
7572- Allow the fromlist passed into importlib.__import__ to be any iterable.
7573
7574- Have importlib raise ImportError if None is found in sys.modules.
7575
7576- Issue #6054: Do not normalize stored pathnames in tarfile.
7577
7578- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
7579 payloads are now ordered by integer value rather than lexicographically.
7580
7581- Issue #1356969: Add missing info methods in tix.HList.
7582
7583- Issue #1522587: New constants and methods for the tix.Grid widget.
7584
7585- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
7586
7587- Issue #1119673: Do not override tkinter.Text methods when creating a
7588 ScrolledText.
7589
7590- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
7591
7592- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
7593 and yview* methods.
7594
7595- Issue #6629: Fix a data corruption issue in the new I/O library, which could
7596 occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
7597 "wb+" mode) after having buffered a certain amount of data for reading. This
7598 bug was not present in the pure Python implementation.
7599
7600- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
7601 POP3.apop.
7602
7603- Issue #2715: Remove remnants of Carbon.File from binhex module.
7604
7605- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
7606 digits in input, as recommended by the standard. Previously it was restricted
7607 to accepting [0-9].
7608
7609- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
7610 DO/DONT correctly.
7611
7612- Issue #1424152: Fix for http.client, urllib.request to support SSL while
7613 working through proxy. Original patch by Christopher Li, changes made by
7614 Senthil Kumaran.
7615
7616- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
7617 loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
7618 PyPycLoader inherit from this class and provide implementations in relation to
7619 other methods required by the ABCs.
7620
7621- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
7622 the documentation said it did even though the code in PyLoader relied on the
7623 abstract method required by ResourceLoader.
7624
7625- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
7626 to handle a comparison without loss of precision. Also add correct handling
7627 of infinities and nans for comparisons with float.
7628
7629- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
7630
7631- Issue #6358: The exit status of a command started with os.popen() was reported
7632 differently than it did with python 2.x.
7633
7634- Issue #6323: The pdb debugger did not exit when running a script with a syntax
7635 error.
7636
7637- Issue #3392: The subprocess communicate() method no longer fails in select()
7638 when file descriptors are large; communicate() now uses poll() when possible.
7639
7640- Issue #6369: Fix an RLE decompression bug in the binhex module.
7641
7642- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
7643
7644- The deprecated function string.maketrans has been removed.
7645
7646- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
7647 sys.path.
7648
7649- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
7650
7651- The os.get_exec_path() function to return the list of directories that will be
7652 searched for an executable when launching a subprocess was added.
7653
7654- Issue #7481: When a threading.Thread failed to start it would leave the
7655 instance stuck in initial state and present in threading.enumerate().
7656
7657- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
7658 and os.read system calls where appropriate.
7659
7660- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
7661
7662- Issue #6247: The argparse module has been added to the standard library.
7663
7664- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
7665 option available on FreeBSD 7.1 and newer.
7666
7667- Issue #9315: Fix for the trace module to record correct class name
7668 for tracing methods.
7669
7670Extension Modules
7671-----------------
7672
7673- Issue #9959: Tweak formula used for computing math.log of an integer,
7674 making it marginally more accurate for exact powers of 2.
7675
7676- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
7677
7678- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
7679 compared to other unix systems. In particular, os.getgroups() does not reflect
7680 any changes made using os.setgroups() but basicly always returns the same
7681 information as the id command. os.getgroups() can now return more than 16
7682 groups on MacOSX.
7683
7684- Issue #6095: Make directory argument to os.listdir optional.
7685
7686- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
7687 struct.pack('>?')): if conversion to bool raised an exception then that
7688 exception wasn't properly propagated on machines where char is unsigned.
7689
7690- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
7691 they contain instances of old-style classes.
7692
7693- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
7694 existing isinf and isnan functions.
7695
7696- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
7697 R. Coombs.
7698
7699- In struct.pack, correctly propogate exceptions from computing the truth of an
7700 object in the '?' format.
7701
7702- Issue #9000: datetime.timezone objects now have eval-friendly repr.
7703
7704- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
7705 special methods.
7706
7707- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
7708 Prior to this change, timezone adjustment in utctimetuple() could produce
7709 tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
7710 cases.
7711
7712- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
7713 directive. When the ``%z`` directive is present in the format string, an
7714 aware ``datetime`` object is returned with ``tzinfo`` bound to a
7715 ``datetime.timezone`` instance constructed from the parsed offset. If both
7716 ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
7717 name, but ``%Z`` data without ``%z`` is discarded.
7718
7719- Issue #5094: The ``datetime`` module now has a simple concrete class
7720 implementing ``datetime.tzinfo`` interface. Instances of the new class,
7721 ``datetime.timezone``, return fixed name and UTC offset from their
7722 ``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
7723 returns ``None``. A class attribute, ``utc`` contains an instance
7724 representing the UTC timezone. Original patch by Rafe Kaplan.
7725
7726- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
7727 includes documentation for the struct.Struct class.
7728
7729- Issue #3129: Trailing digits in struct format string are no longer ignored.
7730 For example, "1" or "ilib123" are now invalid formats and cause
7731 ``struct.error`` to be raised. Patch by Caleb Deveraux.
7732
7733- Issue #7384: If the system readline library is linked against ncurses, the
7734 curses module must be linked against ncurses as well. Otherwise it is not safe
7735 to load both the readline and curses modules in an application.
7736
7737- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
7738 requiring a re-try in order to get the complete result.
7739
7740- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
7741 with an improved 'binary-split' algorithm that uses fewer multiplications and
7742 allows many of the multiplications to be performed using plain C integer
7743 arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
7744 arguments.
7745
7746- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
7747 overflow checks in the audioop module.
7748
7749- Issue #8644: The accuracy of td.total_seconds() has been improved (by
7750 calculating with integer arithmetic instead of float arithmetic internally):
7751 the result is now always correctly rounded, and is equivalent to ``td /
7752 timedelta(seconds=1)``.
7753
7754- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
7755 timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
7756 timedelta) are all supported.
7757
7758- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
7759
7760- Issue #8300: When passing a non-integer argument to struct.pack with any
7761 integer format code, struct.pack first attempts to convert the non-integer
7762 using its __index__ method. If that method is non-existent or raises
7763 TypeError it goes on to try the __int__ method, as described below.
7764
7765- Issue #8142: Update libffi to the 3.0.9 release.
7766
7767- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
7768
7769- Issue #6544: Fix a reference leak in the kqueue implementation's error
7770 handling.
7771
7772- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
7773 msvcr100.dll is not a platform assembly anymore.
7774
7775- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
7776
7777- Issue #7078: Set struct.__doc__ from _struct.__doc__.
7778
7779- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
7780
7781- Issue #6877: It is now possible to link the readline extension to the libedit
7782 readline emulation on OSX 10.5 or later.
7783
7784- Issue #6848: Fix curses module build failure on OS X 10.6.
7785
7786- Fix a segfault that could be triggered by expat with specially formed input.
7787
7788- Issue #6561: '\d' in a regex now matches only characters with Unicode category
7789 'Nd' (Number, Decimal Digit). Previously it also matched characters with
7790 category 'No'.
7791
7792- Issue #4509: Array objects are no longer modified after an operation failing
7793 due to the resize restriction in-place when the object has exported buffers.
7794
7795- Issue #2389: Array objects are now pickled in a portable manner.
7796
7797- Expat: Fix DoS via XML document with malformed UTF-8 sequences
7798 (CVE_2009_3560).
7799
7800- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
7801 could raise an incorrect RuntimeError about not holding the import lock. The
7802 import lock is now reinitialized after fork.
7803
7804- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
7805 parameter on some platforms such as OS X.
7806
7807- Build the ossaudio extension on GNU/kFreeBSD.
7808
7809- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
7810 the return value of QueryReflectionKey.
7811
7812- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
7813
7814Build
7815-----
7816
7817- Use OpenSSL 1.0.0a on Windows.
7818
7819- Issue #9280: Make sharedinstall depend on sharedmods.
7820
7821- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
7822 override the configure and makefile defaults, without deleting options the
7823 user didn't intend to override. Developers should no longer need to specify
7824 OPT or EXTRA_CFLAGS, although those variables are still present for
7825 backward-compatibility.
7826
7827- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
7828
7829- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
7830 multiprocessing only.
7831
7832- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
7833 (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
7834 result of the issue #1628484 fix, combined with autoconf's strange choice of
7835 default CFLAGS produced by AC_PROG_CC for gcc.)
7836
7837- Issue #3646: It is now easily possible to install a Python framework into your
7838 home directory on MacOSX, see Mac/README for more information.
7839
7840- Issue #3928: os.mknod() now available in Solaris, also.
7841
7842- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
7843 give false warnings.
7844
7845- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
7846 anymore. It also forwards the LDFLAGS settings to the linker when building a
7847 shared library.
7848
7849- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
7850 tests from compileall.
7851
7852- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
7853
7854- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
7855 memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
7856 instead. Also disable caching of powers of 5.
7857
7858- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
7859
7860- Issue #6943: Use pkg-config to find the libffi headers when the
7861 --with-system-ffi flag is used.
7862
7863- Issue #7609: Add a --with-system-expat option that causes the system's expat
7864 library to be used for the pyexpat module instead of the one included with
7865 Python.
7866
7867- Issue #7589: Only build the nis module when the correct header files are
7868 found.
7869
7870- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
7871
7872- Issue #5792: Extend the short float repr support to x86 systems using
7873 icc or suncc.
7874
7875- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
7876 correctly under gcc on x86-64. This fixes a reported problem with the
7877 --with-tsc build on x86-64.
7878
7879- Issue #6802: Fix build issues on MacOSX 10.6.
7880
7881- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
7882
7883- Issue #4601: 'make install' did not set the appropriate permissions on
7884 directories.
7885
7886- Issue #5390: Add uninstall icon independent of whether file extensions are
7887 installed.
7888
7889- Issue #7541: When using ``python-config`` with a framework install the
7890 compiler might use the wrong library.
7891
7892- python-config now supports multiple options on the same command line.
7893
7894- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
7895
7896- Issue #8510: Update to autoconf2.65.
7897
7898Documentation
7899-------------
7900
7901- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
7902 to Doc/license.rst.
7903
7904- Issue #9524: Document that two CTRL* signals are meant for use only
7905 with os.kill.
7906
7907- Issue #9255: Document that the 'test' package is meant for internal Python use
7908 only.
7909
7910- A small WSGI server was added as Tools/scripts/serve.py, and is used to
7911 implement a local documentation server via 'make serve' in the doc directory.
7912
7913- Updating `Using Python` documentation to include description of CPython's -J
7914 and -X options.
7915
7916- Document that importing a module that has None in sys.modules triggers an
7917 ImportError.
7918
7919- Issue #6556: Fixed the Distutils configuration files location explanation for
7920 Windows.
7921
7922- Update python manual page (options -B, -O0, -s, environment variables
7923 PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
7924
7925- Issue #8909: Added the size of the bitmap used in the installer created by
7926 distutils' bdist_wininst. Patch by Anatoly Techtonik.
7927
7928Tests
7929-----
7930
7931- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
7932 import lock was disabled.
7933
7934- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
7935
7936- Issue #7449: Skip test_socketserver if threading support is disabled.
7937
7938- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
7939 by a decompressor object without errors (it returns incomplete uncompressed
7940 data).
7941
7942- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
7943 UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
7944
7945- Issue #8576: Remove use of find_unused_port() in test_smtplib and
7946 test_multiprocessing. Patch by Paul Moore.
7947
7948- Issue #7449: Fix many tests to support Python compiled without thread
7949 support. Patches written by Jerry Seutter.
7950
7951- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
7952 SSL shutdowns.
7953
7954- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
7955 by Dave Malcolm.
7956
7957- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
7958 thread was previously started, most likely due to a platform bug.
7959
7960- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
7961
7962- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
7963
7964- Issue #8263: Now regrtest.py will report a failure if it receives a
7965 KeyboardInterrupt (SIGINT).
7966
7967- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
7968 Unicode normalization cases.
7969
7970- Issue #7783: test.support.open_urlresource invalidates the outdated files from
7971 the local cache.
7972
7973- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
7974 effectively raised.
7975
7976- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
7977 TestCase for some tests: test_genericpath.CommonTest.
7978
7979- Print platform information when running the whole test suite, or using the
7980 --verbose flag.
7981
7982- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
7983 filesystem encoding.
7984
7985- Issue #6292: for the moment at least, the test suite runs cleanly if python is
7986 run with the -OO flag. Tests requiring docstrings are skipped.
7987
7988- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
7989 also used by regrtest to run all the tests in a temporary directory. The
7990 original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
7991 helped with the patch.
7992
7993- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
7994 (only seen so far on platforms where the curses module wasn't built), due to
7995 an uncleared exception.
7996
7997- Issue #7728: test_timeout was changed to use support.bind_port instead of a
7998 hard coded port.
7999
8000- Issue #7376: Instead of running a self-test (which was failing) when called
8001 with no arguments, doctest.py now gives a usage message.
8002
8003- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
8004
8005- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
8006 instead of a hardcoded port number in test_rapid_restart.
8007
8008- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
8009 in the Lib/test directory, which might be read-only for the user running the
8010 tests.
8011
8012- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
8013 of an option with no handler.
8014
8015- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
8016 fails. Can be combined with -j.
8017
8018- Issue #6551: test_zipimport could import and then destroy some modules of the
8019 encodings package, which would make other tests fail further down the road
8020 because the internally cached encoders and decoders would point to empty
8021 global variables.
8022
8023- Issue #7295: Do not use a hardcoded file name in test_tarfile.
8024
8025- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
8026 primitives such as Lock, RLock, Condition, Event and Semaphore.
8027
8028- Issue #7248 (part 2): Use a unique temporary directory for importlib source
8029 tests instead of tempfile.tempdir. This prevents the tests from sharing state
8030 between concurrent executions on the same system.
8031
8032- Issue #7248: In importlib.test.source.util a try/finally block did not make
8033 sure that some referenced objects actually were created in the block before
8034 calling methods on the object.
8035
8036- Issue #7222: Make thread "reaping" more reliable so that reference
8037 leak-chasing test runs give sensible results. The previous method of reaping
8038 threads could return successfully while some Thread objects were still
8039 referenced. This also introduces a new private function:
8040 ``_thread._count()``.
8041
8042- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
8043 runs the risk of causing the worker thread to fail.
8044
8045- Issue #7055: test___all__ now greedily detects all modules which have an
8046 __all__ attribute, rather than using a hardcoded and incomplete list.
8047
8048- Issue #7058: Added save/restore for things like sys.argv and cwd to
8049 runtest_inner in regrtest, with warnings if the called test modifies them, and
8050 a new section in the summary report at the end.
8051
8052- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
8053
8054- Fixed tests in importlib.test.source.test_abc_loader that were masking the
8055 proper exceptions that should be raised for missing or improper code object
8056 bytecode.
8057
8058- Removed importlib's custom test discovery code and switched to
8059 unittest.TestLoader.discover().
8060
8061Tools/Demos
8062-----------
8063
8064- Issue #5464, #8974: Implement plural forms in msgfmt.py.
8065
8066- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
8067 added to the `Tools/` directory. They were previously living in the sandbox.
8068
8069
8070What's New in Python 3.1?
8071=========================
8072
8073*Release date: 27-June-2009*
8074
8075Core and Builtins
8076-----------------
8077
8078- Issue #6334: Fix bug in range length calculation for ranges with
8079 large arguments.
8080
8081- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
8082 because it wasn't recognized as a sequence).
8083
8084Library
8085-------
8086
8087- Issue #6126: Fixed pdb command-line usage.
8088
8089- Issue #6314: logging: performs extra checks on the "level" argument.
8090
8091- Issue #6274: Fixed possible file descriptors leak in subprocess.py
8092
8093- Accessing io.StringIO.buffer now raises an AttributeError instead of
8094 io.UnsupportedOperation.
8095
8096- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
8097 (On Unix)
8098
8099- Issue #1202: zipfile module would cause a struct.error when attempting to
8100 store files with a CRC32 > 2**31-1.
8101
8102Extension Modules
8103-----------------
8104
8105- Issue #5590: Remove unused global variable in pyexpat extension.
8106
8107
8108What's New in Python 3.1 Release Candidate 2?
8109=============================================
8110
8111*Release date: 13-June-2009*
8112
8113Core and Builtins
8114-----------------
8115
8116- Fixed SystemError triggered by "range([], 1, -1)".
8117
8118- Issue #5924: On Windows, a large PYTHONPATH environment variable
8119 (more than 255 characters) would be completely ignored.
8120
8121- Issue #4547: When debugging a very large function, it was not always
8122 possible to update the lineno attribute of the current frame.
8123
8124- Issue #5330: C functions called with keyword arguments were not reported by
8125 the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
8126
8127Library
8128-------
8129
8130- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
8131 expression string pattern was trying to match against a bytes returned by
8132 Popen. Tested under win32 to build the py-postgresql project.
8133
8134- Issue #6258: Support AMD64 in bdist_msi.
8135
8136- Issue #6195: fixed doctest to no longer try to read 'source' data from
8137 binary files.
8138
8139- Issue #5262: Fixed bug in next rollover time computation in
8140 TimedRotatingFileHandler.
8141
8142- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
8143 errors property. Additionally, the errors and encoding properties of StringIO
8144 are always None now.
8145
8146- Issue #6137: The pickle module now translates module names when loading
8147 or dumping pickles with a 2.x-compatible protocol, in order to make data
8148 sharing and migration easier. This behaviour can be disabled using the
8149 new `fix_imports` optional argument.
8150
8151- Removed the ipaddr module.
8152
8153- Issue #3613: base64.{encode,decode}string are now called
8154 base64.{encode,decode}bytes which reflects what type they accept and return.
8155 The old names are still there as deprecated aliases.
8156
8157- Issue #5767: Remove sgmlop support from xmlrpc.client.
8158
8159- Issue #6150: Fix test_unicode on wide-unicode builds.
8160
8161- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
8162 parameters.
8163
8164Windows
8165-------
8166
8167- Issue #6221: Delete test registry key before running the test.
8168
8169- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
8170
8171C-API
8172-----
8173
8174- Issue #5735: Python compiled with --with-pydebug should throw an
8175 ImportError when trying to import modules compiled without
8176 --with-pydebug, and vice-versa.
8177
8178
8179Build
8180-----
8181
8182- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
8183 added LIBS to OS X framework builds.
8184
8185- Issue #5809: Specifying both --enable-framework and --enable-shared is
8186 an error. Configure now explicity tells you about this.
8187
8188
8189
8190What's New in Python 3.1 release candidate 1?
8191=============================================
8192
8193*Release date: 2009-05-30*
8194
8195Core and Builtins
8196-----------------
8197
8198- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
8199 of the command line.
8200
8201- Issue #6012: Add cleanup support to O& argument parsing.
8202
8203- Issue #6089: Fixed str.format with certain invalid field specifiers
8204 that would raise SystemError.
8205
8206- Issue #5982: staticmethod and classmethod now expose the wrapped
8207 function with __func__.
8208
8209- Added support for multiple context managers in the same with-statement.
8210 Deprecated contextlib.nested() which is no longer needed.
8211
8212- Issue #5829: complex("1e500") no longer raises OverflowError. This
8213 makes it consistent with float("1e500") and interpretation of real
8214 and imaginary literals.
8215
8216- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
8217
8218- Issue #5994: the marshal module now has docstrings.
8219
8220- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
8221 (1) inf and nan strings with trailing whitespace were incorrectly
8222 rejected; (2) parsing of strings representing infinities and nans
8223 was locale aware; and (3) the interpretation of fromhex('-nan')
8224 didn't match that of float('-nan').
8225
8226Library
8227-------
8228
8229- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
8230
8231- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
8232
8233- Issue #6121: pydoc now ignores leading and trailing spaces in the
8234 argument to the 'help' function.
8235
8236- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
8237 arguments for strings with a space in them.
8238
8239- collections.namedtuple() was not working with the following field
8240 names: cls, self, tuple, itemgetter, and property.
8241
8242- In unittest, using a skipping decorator on a class is now equivalent to
8243 skipping every test on the class. The ClassTestSuite class has been removed.
8244
8245- Issue #6050: Don't fail extracting a directory from a zipfile if
8246 the directory already exists.
8247
8248- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
8249 than an int, which makes some operations possible under 64-bit Linux (e.g.
8250 DN_MULTISHOT with F_NOTIFY).
8251
8252- Issue #5761: Add the name of the underlying file to the repr() of various
8253 IO objects.
8254
8255- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix
8256 by Musashi Tamura, tests by Marcin Bachry.
8257
8258- Issue #1983: Fix functions taking or returning a process identifier to use
8259 the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
8260 a process identifier type wider than the standard C integer type.
8261
8262- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
8263 Patch by Farhan Ahmad, test by Marcin Bachry.
8264
8265- Issue #2116: Weak references and weak dictionaries now support copy()ing and
8266 deepcopy()ing.
8267
8268- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
8269
8270- Issue #5918: Fix a crash in the parser module.
8271
8272- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
8273
8274- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
8275 library. This means, for example, that opening an UTF-16 text file in
8276 append mode doesn't add a BOM at the end of the file if the file isn't
8277 empty.
8278
8279- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
8280 file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix
8281 corrects a pydoc regression.
8282
8283- Issue #5955: aifc's close method did not close the file it wrapped,
8284 now it does. This also means getfp method now returns the real fp.
8285
8286Installation
8287------------
8288
8289- Issue #6047: fullinstall has been removed because Python 3's executable will
8290 now be known as python3.
8291
8292- Lib/smtpd.py is no longer installed as a script.
8293
8294Extension Modules
8295-----------------
8296
8297- Issue #3061: Use wcsftime for time.strftime where available.
8298
8299- Issue #4873: Fix resource leaks in error cases of pwd and grp.
8300
8301- Issue #6093: Fix off-by-one error in locale.strxfrm.
8302
8303- The _functools and _locale modules are now built into the libpython shared
8304 library instead of as extension modules.
8305
8306Build
8307-----
8308
8309- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
8310 and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
8311 Clinton Roy.
8312
8313Tests
8314-----
8315
8316- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
8317 tests on darwin even when the OS was installed on a case-sensitive
8318 filesystem. Also fixed tests that should not be run when
8319 sys.dont_write_bytecode is true.
8320
8321
8322What's New in Python 3.1 beta 1?
8323================================
8324
8325*Release date: 2009-05-06*
8326
8327Core and Builtins
8328-----------------
8329
8330- Issue #5914: Add new C API function PyOS_string_to_double, and
8331 deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
8332
8333- Issue #3382: float.__format__, complex.__format__, and %-formatting
8334 no longer map 'F' to 'f'. Because of issue #5859 (below), this only
8335 affects nan -> NAN and inf -> INF.
8336
8337- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
8338 in all operations, including splitdrive, split, etc. splitunc() now issues
8339 a PendingDeprecation warning.
8340
8341- Issue #5920: For float.__format__, change the behavior with the
8342 empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
8343 to be like 'g' but with at least one decimal point and with a
8344 default precision of 12. Previously, the behavior the same but with
8345 a default precision of 6. This more closely matches str(), and
8346 reduces surprises when adding alignment flags to the empty
8347 presentation type. This also affects the new complex.__format__ in
8348 the same way.
8349
8350- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
8351
8352- Issue #5890: in subclasses of 'property' the __doc__ attribute was
8353 shadowed by classtype's, even if it was None. property now
8354 inserts the __doc__ into the subclass instance __dict__.
8355
8356- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
8357 sequences. Patch by Nick Barnes and Victor Stinner.
8358
8359- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
8360
8361- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
8362 received a new method, detach(). detach() disconnects the underlying stream
8363 from the buffer or text IO and returns it.
8364
8365- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
8366 floats with absolute value over 1e50. Also remove length
8367 restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
8368 12.34 no longer raise an exception.
8369
8370- Issue #1588: Add complex.__format__. For example,
8371 format(complex(1, 2./3), '.5') now produces a sensible result.
8372
8373- Issue #5864: Fix empty format code formatting for floats so that it
8374 never gives more than the requested number of significant digits.
8375
8376- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
8377 new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
8378
8379- Issue #5835: Deprecate PyOS_ascii_formatd.
8380
8381- Issue #4971: Fix titlecase for characters that are their own
8382 titlecase, but not their own uppercase.
8383
8384- Issue #5283: Setting __class__ in __del__ caused a segfault.
8385
8386- Issue #5816: complex(repr(z)) now recovers z exactly, even when
8387 z involves nans, infs or negative zeros.
8388
8389- Issue #3166: Make int -> float conversions correctly rounded.
8390
8391- Issue #1869 (and many duplicates): make round(x, n) correctly
8392 rounded for a float x, by using the decimal <-> binary conversions
8393 from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
8394 consistently agrees with format(x, '.2f').
8395
8396- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
8397 some builtin types.
8398
8399- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
8400
8401- Issue #5515: str.format() type 'n' combined with commas and leading
8402 zeros no longer gives odd results with ints and floats.
8403
8404- Implement PEP 378, Format Specifier for Thousands Separator, for
8405 floats.
8406
8407- The str function switches to exponential notation at
8408 1e11, not 1e12. This avoids printing 13 significant digits in
8409 situations where only 12 of them are correct. Example problem
8410 value: str(1e11 + 0.5). (This minor issue has existed in 2.x for a
8411 long time.)
8412
8413- Issue #1580: On most platforms, use a 'short' float repr: for a
8414 finite float x, repr(x) now outputs a string based on the shortest
8415 sequence of decimal digits that rounds to x. Previous behaviour was
8416 to output 17 significant digits and then strip trailing zeros.
8417 Another minor difference is that the new repr switches to
8418 exponential notation at 1e16 instead of the previous 1e17; this
8419 avoids misleading output in some cases.
8420
8421 There's a new sys attribute sys.float_repr_style, which takes
8422 the value 'short' to indicate that we're using short float repr,
8423 and 'legacy' if the short float repr isn't available for one
8424 reason or another.
8425
8426 The float repr change involves incorporating David Gay's 'perfect
8427 rounding' code into the Python core (it's in Python/dtoa.c). As a
8428 secondary consequence, all string-to-float and float-to-string
8429 conversions (including all float formatting operations) will be
8430 correctly rounded on these platforms.
8431
8432 See issue #1580 discussions for details of platforms for which
8433 this change does not apply.
8434
8435- Issue #5759: float() didn't call __float__ on str subclasses.
8436
8437- The string.maketrans() function is deprecated; there is a new static method
8438 maketrans() on the bytes and bytearray classes. This removes confusion about
8439 the types string.maketrans() is supposed to work with, and mirrors the
8440 methods available on the str class.
8441
8442- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
8443 its clarity and its speed.
8444
8445- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
8446 to avoid compiler warnings.
8447
8448- Issue #3739: The unicode-internal encoder now reports the number of characters
8449 consumed like any other encoder (instead of the number of bytes).
8450
8451Installation
8452------------
8453
8454- Issue #5756: Install idle and pydoc with a 3 suffix.
8455
8456Library
8457-------
8458
8459- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
8460
8461- Issue #5311: bdist_msi can now build packages that do not depend on a
8462 specific Python version.
8463
8464- Issue #5150: IDLE's format menu now has an option to strip trailing
8465 whitespace.
8466
8467- Issue #5940: distutils.command.build_clib.check_library_list was not doing
8468 the right type checkings anymore.
8469
8470- Issue #4875: On win32, ctypes.util.find_library does no longer
8471 return directories.
8472
8473- Issue #5142: Add the ability to skip modules while stepping to pdb.
8474
8475- Issue #1309567: Fix linecache behavior of stripping subdirectories when
8476 looking for files given by a relative filename.
8477
8478- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
8479 turtle demos in Demo/turtle.
8480
8481- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
8482 extracting a file to the root directory.
8483
8484- Issue #5913: os.listdir() should fail for empty path on windows.
8485
8486- Issue #5084: unpickling now interns the attribute names of pickled objects,
8487 saving memory and avoiding growth in size of subsequent pickles. Proposal
8488 and original patch by Jake McGuire.
8489
8490- The json module now works exclusively with str and not bytes.
8491
8492- Issue #3959: The ipaddr module has been added to the standard library.
8493 Contributed by Google.
8494
8495- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
8496 error when a named pipe is encountered, rather than blocking infinitely.
8497
8498- Issue #5857: tokenize.tokenize() now returns named tuples.
8499
8500- Issue #4305: ctypes should now build again on mipsel-linux-gnu
8501
8502- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
8503 string is already in normalized form, by performing a quick check beforehand.
8504 Original patch by Rauli Ruohonen.
8505
8506- Issue #5853: calling a function of the mimetypes module from several threads
8507 at once could hit the recursion limit if the mimetypes database hadn't been
8508 initialized before.
8509
8510- Issue #5854: Updated __all__ to include some missing names and remove some
8511 names which should not be exported.
8512
8513- Issue #3102: All global symbols that the _ctypes extension defines
8514 are now prefixed with 'Py' or '_ctypes'.
8515
8516- Issue #5041: ctypes does now allow pickling wide character.
8517
8518- Issue #5812: For the two-argument form of the Fraction constructor,
8519 Fraction(m, n), m and n are permitted to be arbitrary Rational
8520 instances.
8521
8522- Issue #5812: Fraction('1e6') is valid: more generally, any string
8523 that's valid for float() is now valid for Fraction(), with the
8524 exception of strings representing NaNs and infinities.
8525
8526- Issue #5734: BufferedRWPair was poorly tested and had several glaring
8527 bugs. Patch by Brian Quinlan.
8528
8529- Issue #1161031: fix readwrite select flag handling: POLLPRI now
8530 results in a handle_expt_event call, not handle_read_event, and POLLERR
8531 and POLLNVAL now call handle_close, not handle_expt_event. Also,
8532 dispatcher now has an 'ignore_log_types' attribute for suppressing
8533 log messages, which is set to 'warning' by default.
8534
8535- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
8536 new arguments introduced in 2.5.
8537
8538- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
8539 makeunicodedata.py and regenerated the Unicode database (This fixes
8540 u'\u1d79'.lower() == '\x00').
8541
8542Extension Modules
8543-----------------
8544
8545- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
8546 pwd.
8547
8548- Issue #5463: In struct module, remove deprecated float coercion
8549 for integer type codes: struct.pack('L', 0.3) should now raise
8550 an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed.
8551 The version number has been bumped to 0.3.
8552
8553- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
8554 using Berkeley DB.
8555
8556Tests
8557-----
8558
8559- Issue #5354: New test support function import_fresh_module() makes
8560 it easy to import both normal and optimised versions of modules.
8561 test_heapq and test_warnings have been adjusted to use it, tests for
8562 other modules with both C and Python implementations in the stdlib
8563 can be adjusted to use it over time.
8564
8565- Issue #5837: Certain sequences of calls to set() and unset() for
8566 support.EnvironmentVarGuard objects restored the environment variables
8567 incorrectly on __exit__.
8568
8569C-API
8570-----
8571
8572- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
8573
8574
8575What's New in Python 3.1 alpha 2?
8576=================================
8577
8578*Release date: 2009-4-4*
8579
8580Core and Builtins
8581-----------------
8582
8583- Implement PEP 378, Format Specifier for Thousands Separator, for
8584 integers.
8585
8586- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
8587
8588- Issue #5499: The 'c' code for argument parsing functions now only accepts a
8589 byte, and the 'C' code only accepts a unicode character.
8590
8591- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
8592 when hitting the recursion limit under certain circumstances.
8593
8594- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
8595
8596- Fix a segfault when running test_exceptions with coverage, caused by
8597 insufficient checks in accessors of Exception.__context__.
8598
8599- Issue #5604: non-ASCII characters in module name passed to
8600 imp.find_module() were converted to UTF-8 while the path is
8601 converted to the default filesystem encoding, causing nonsense.
8602
8603- Issue #5126: str.isprintable() returned False for space characters.
8604
8605- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
8606 the end sys.path, for compatibility with the system install of Python.
8607
8608- Issue #4688: Add a heuristic so that tuples and dicts containing only
8609 untrackable objects are not tracked by the garbage collector. This can
8610 reduce the size of collections and therefore the garbage collection overhead
8611 on long-running programs, depending on their particular use of datatypes.
8612
8613- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
8614 improve its performance. Long divisions and remainder operations
8615 are now between 50% and 150% faster.
8616
8617- Issue #4258: Make it possible to use base 2**30 instead of base
8618 2**15 for the internal representation of integers, for performance
8619 reasons. Base 2**30 is enabled by default on 64-bit machines. Add
8620 --enable-big-digits option to configure, which overrides the
8621 default. Add sys.int_info structseq to provide information about
8622 the internal format.
8623
8624- Issue #4474: PyUnicode_FromWideChar now converts characters outside
8625 the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
8626 and sizeof(Py_UNICODE) == 2.
8627
8628- Issue #5237: Allow auto-numbered fields in str.format(). For
8629 example: '{} {}'.format(1, 2) == '1 2'.
8630
8631- Issue #5392: when a very low recursion limit was set, the interpreter would
8632 abort with a fatal error after the recursion limit was hit twice.
8633
8634- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
8635 short file names.
8636
8637Library
8638-------
8639
8640- Issue #2625: added missing items() call to the for loop in
8641 mailbox.MH.get_message().
8642
8643- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
8644 error substitutions from non-strict codec error callbacks in
8645 incrementalencoder and StreamWriter.
8646
8647- Issue #5656: Fix the coverage reporting when running the test suite with
8648 the -T argument.
8649
8650- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
8651
8652- Issue #5624: Fix the _winreg module name still used in several modules.
8653
8654- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
8655
8656- Issue #5619: Multiprocessing children disobey the debug flag and causes
8657 popups on windows buildbots. Patch applied to work around this issue.
8658
8659- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
8660
8661- Issue #5387: Fixed mmap.move crash by integer overflow.
8662
8663- Issue #5261: Patch multiprocessing's semaphore.c to support context
8664 manager use: "with multiprocessing.Lock()" works now.
8665
8666- Issue #5236: Change time.strptime() to only take strings. Didn't work with
8667 bytes already but the failure was non-obvious.
8668
8669- Issue #5177: Multiprocessing's SocketListener class now uses
8670 socket.SO_REUSEADDR on all connections so that the user no longer needs
8671 to wait 120 seconds for the socket to expire.
8672
8673- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
8674
8675- Issue #1174606: Calling read() without arguments of an unbounded file
8676 (typically /dev/zero under Unix) could crash the interpreter.
8677
8678- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
8679 io.BufferedRandom have been deprecated for removal in Python 3.2.
8680
8681- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
8682 forever on incomplete input. That caused tarfile.open() to hang when used
8683 with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
8684 partial bzip2 compressed data.
8685
8686- Issue #2110: Add support for thousands separator and 'n' type
8687 specifier to Decimal.__format__
8688
8689- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
8690 '>' alignment characters.
8691
8692- The error detection code in FileIO.close() could fail to reflect the `errno`
8693 value, and report it as -1 instead.
8694
8695- Issue #5016: FileIO.seekable() could return False if the file position
8696 was negative when truncated to a C int. Patch by Victor Stinner.
8697
8698Extension Modules
8699-----------------
8700
8701- Issue #5391: mmap now deals exclusively with bytes.
8702
8703- Issue #5463: In struct module, remove deprecated overflow wrapping
8704 when packing an integer: struct.pack('=L', -1) now raises
8705 struct.error instead of returning b'\xff\xff\xff\xff'. The
8706 _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
8707 have been removed from the struct module.
8708
8709
8710What's New in Python 3.1 alpha 1
8711================================
8712
8713*Release date: 2009-03-07*
8714
8715Core and Builtins
8716-----------------
8717
8718- The io module has been reimplemented in C for speed.
8719
8720- Give dict views an informative __repr__.
8721
8722- Issue #5247: Improve error message when unknown format codes are
8723 used when using str.format() with str, int, and float arguments.
8724
8725- Issue #5249: time.strftime returned malformed string when format string
8726 contained non ascii character on windows.
8727
8728- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
8729 source has already been decoded into str.
8730
8731- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
8732 rotating the object pointer by 4 bits to the right.
8733
8734- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
8735 it now forces its argument to double before testing for infinity.
8736
8737- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
8738 returns a non-number type.
8739
8740- Issue #5182: Removed memoryview.__str__.
8741
8742- Issue #1717: Removed builtin cmp() function, dropped tp_compare
8743 slot, the C API functions PyObject_Compare and PyUnicode_Compare and
8744 the type definition cmpfunc. The tp_compare slot has been renamed
8745 to tp_reserved, and is reserved for future usage.
8746
8747- Issue #1242657: the __len__() and __length_hint__() calls in several tools
8748 were suppressing all exceptions. These include list() and bytearray().
8749
8750- Issue #4707: round(x, n) now returns an integer if x is an integer.
8751 Previously it returned a float.
8752
8753- Issue #4753: By enabling a configure option named '--with-computed-gotos'
8754 on compilers that support it (notably: gcc, SunPro, icc), the bytecode
8755 evaluation loop is compiled with a new dispatch mechanism which gives
8756 speedups of up to 20%, depending on the system, on various benchmarks.
8757
8758- Issue #4874: Most builtin decoders now reject unicode input.
8759
8760- Issue #4842: Don't allow trailing 'L' when constructing an integer
8761 from a string.
8762
8763- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
8764
8765- Issue #4838: When a module is deallocated, free the memory backing the
8766 optional module state data.
8767
8768- Issue #4910: Rename nb_long slot to nb_reserved, and change its
8769 type to ``(void *)``.
8770
8771- Issue #4935: The overflow checking code in the expandtabs() method common
8772 to str, bytes and bytearray could be optimized away by the compiler, letting
8773 the interpreter segfault instead of raising an error.
8774
8775- Issue #3720: Fix a crash when an iterator modifies its class and removes its
8776 __next__ method.
8777
8778- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
8779 function no longer attempt to call the __long__ slot to convert an object
8780 to an integer. Only the __int__ and __trunc__ slots are examined.
8781
8782- Issue #4893: Use NT threading on CE.
8783
8784- Issue #4915: Port sysmodule to Windows CE.
8785
8786- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
8787 common cases are optimized thanks to a dedicated fast path and a moderate
8788 amount of loop unrolling.
8789
8790- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
8791 collecting the oldest generation) so that allocating lots of objects without
8792 destroying them does not show quadratic performance. Based on a proposal by
8793 Martin von Löwis at
8794 http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
8795
8796- Issue #4604: Some objects of the I/O library could still be used after
8797 having been closed (for instance, a read() call could return some
8798 previously buffered data). Patch by Dmitry Vasiliev.
8799
8800- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
8801 flag to work properly. Furthermore, when specifying -u, the text stdout
8802 and stderr streams have line-by-line buffering enabled (the default being
8803 to buffer arbitrary chunks of data).
8804
8805- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
8806 instead of ints (reducing its size from 4 to 8 times thereby reducing
8807 Python's overall memory).
8808
8809- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
8810 an existing .py counterpart, override the co_filename attributes of all
8811 code objects if the original filename is obsolete (which can happen if the
8812 file has been renamed, moved, or if it is accessed through different paths).
8813 Patch by Ziga Seilnacht and Jean-Paul Calderone.
8814
8815- Issue #4580: Fix slicing of memoryviews when the item size is greater than
8816 one byte. Also fixes the meaning of len() so that it returns the number of
8817 items, rather than the size in bytes.
8818
8819- Issue #4075: Use OutputDebugStringW in Py_FatalError.
8820
8821- Issue #4747: When the terminal does not use utf-8, executing a script with
8822 non-ascii characters in its name could fail with a "SyntaxError: None" error.
8823
8824- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
8825 to open file with a bytes filename on Windows.
8826
8827- Issue #3680: Reference cycles created through a dict, set or deque iterator
8828 did not get collected.
8829
8830- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
8831 where the tp_hash and tp_dict slots are both NULL.
8832
8833- Issue #4759: None is now allowed as the first argument of
8834 bytearray.translate(). It was always allowed for bytes.translate().
8835
8836- Added test case to ensure attempts to read from a file opened for writing
8837 fail.
8838
8839- Issue #3106: Speedup some comparisons (str/str and int/int).
8840
8841- Issue #2183: Simplify and optimize bytecode for list, dict and set
8842 comprehensions. Original patch for list comprehensions by Neal Norwitz.
8843
8844- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
8845 print elapsed times, not only when some objects are uncollectable /
8846 unreachable. Original patch by Neil Schemenauer.
8847
8848- Issue #3439: Add a bit_length method to int.
8849
8850- Issue #2173: When getting device encoding, check that return value of
8851 nl_langinfo is not the empty string. This was causing silent build
8852 failures on OS X.
8853
8854- Issue #4597: Fixed several opcodes that weren't always propagating
8855 exceptions.
8856
8857- Issue #4589: Fixed exception handling when the __exit__ function of a
8858 context manager returns a value that cannot be converted to a bool.
8859
8860- Issue #4445: Replace "sizeof(PyBytesObject)" with
8861 "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
8862 bytes instances. On a typical machine this saves 3 bytes of memory
8863 (on average) per allocation of a bytes instance.
8864
8865- Issue #4533: File read operation was dreadfully slow due to a slowly
8866 growing read buffer. Fixed by using the same growth rate algorithm as
8867 Python 2.x.
8868
8869- Issue #4509: Various issues surrounding resize of bytearray objects to
8870 which there are buffer exports (e.g. memoryview instances).
8871
8872- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
8873 method on file objects with closefd=False. The file descriptor is still
8874 kept open but the file object behaves like a closed file. The ``FileIO``
8875 object also got a new readonly attribute ``closefd``.
8876
8877- Issue #4569: Interpreter crash when mutating a memoryview with an item size
8878 larger than 1.
8879
8880- Issue #4748: Lambda generators no longer return a value.
8881
8882- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
8883
8884- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
8885 PyUnicode_DecodeUTF8() once, remember the result and output it in a second
8886 step. This avoids problems with counting UTF-8 bytes that ignores the effect
8887 of using the replace error handler in PyUnicode_DecodeUTF8().
8888
8889Library
8890-------
8891
8892- Issue #7071: byte-compilation in Distutils is now done with respect to
8893 sys.dont_write_bytecode.
8894
8895- Issue #7066: archive_util.make_archive now restores the cwd if an error is
8896 raised. Initial patch by Ezio Melotti.
8897
8898- Issue #6516: Added owner/group support when creating tar archives in
8899 Distutils.
8900
8901- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
8902
8903- Issue #6163: Fixed HP-UX runtime library dir options in
8904 distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
8905 Michael Haubenwallner.
8906
8907- Issue #6693: New functions in site.py to get user/global site packages paths.
8908
8909- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
8910 opening an empty or very small file.
8911
8912- Issue #6545: Removed assert statements in distutils.Extension, so the
8913 behavior is similar when used with -O.
8914
8915- unittest has been split up into a package. All old names should still work.
8916
8917- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
8918 uses the same refactored function to get gcc/ld/dllwrap versions numbers.
8919 It's `distutils.util.get_compiler_versions`. Added deprecation warnings
8920 for the obsolete get_versions() functions.
8921
8922- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
8923
8924- Issue #6314: logging: Extra checks on the "level" argument in more places.
8925
8926- Issue #2622: Fixed an ImportError when importing email.message from a
8927 standalone application built with py2exe or py2app.
8928
8929- Issue #6455: Fixed test_build_ext under win32.
8930
8931- Issue #6377: Enabled the compiler option, and deprecate its usage as an
8932 attribute.
8933
8934- Issue #6413: Fixed the log level in distutils.dist for announce.
8935
8936- Issue #6403: Fixed package path usage in build_ext.
8937
8938- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
8939 unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
8940 descriptor errors
8941
8942- Issue #6365: Distutils build_ext inplace mode was copying the compiled
8943 extension in a subdirectory if the extension name had dots.
8944
8945- Issue #6164: Added an AIX specific linker argument in Distutils
8946 unixcompiler. Original patch by Sridhar Ratnakumar.
8947
8948- Issue #6286: Now Distutils upload command is based on urllib2 instead of
8949 httplib, allowing the usage of http_proxy.
8950
8951- Issue #6287: Added the license field in Distutils documentation.
8952
8953- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
8954
8955- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
8956 in Makefiles. This prevents compile errors when using syntax like:
8957 `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
8958
8959- Issue #6131: test_modulefinder leaked when run after test_distutils.
8960 Patch by Hirokazu Yamamoto.
8961
8962- Issue #6048: Now Distutils uses the tarfile module in archive_util.
8963
8964- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
8965 and tests on pywin32 by Tim Golden.
8966
8967- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
8968
8969- Issue #6046: Fixed the library extension when distutils build_ext is used
8970 inplace. Initial patch by Roumen Petrov.
8971
8972- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
8973 subcommand.
8974
8975- Issue #6022: a test file was created in the current working directory by
8976 test_get_outputs in Distutils.
8977
8978- Issue #5977: distutils build_ext.get_outputs was not taking into account the
8979 inplace option. Initial patch by kxroberto.
8980
8981- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
8982 for old-style extensions.
8983
8984- Issue #5976: Fixed Distutils test_check_environ.
8985
8986- Issue #5941: Distutils build_clib command was not working anymore because
8987 of an incomplete costumization of the archiver command. Added ARFLAGS in the
8988 Makefile besides AR and make Distutils use it. Original patch by David
8989 Cournapeau.
8990
8991- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
8992
8993- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
8994 anymore.
8995
8996- Issue #5810: Fixed Distutils test_build_scripts so it uses
8997 sysconfig.get_config_vars.
8998
8999- Issue #4951: Fixed failure in test_httpservers.
9000
9001- Issue #5795: Fixed test_distutils failure on Debian ppc.
9002
9003- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
9004
9005- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
9006 a value in SafeConfigParser.
9007
9008- Issue #5732: added a new command in Distutils: check.
9009
9010- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
9011 platforms. Initial patch by Paul Moore.
9012
9013- Issue #5095: Added bdist_msi to the list of bdist supported formats.
9014 Initial fix by Steven Bethard.
9015
9016- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
9017 Initial fix by Wayne Davison.
9018
9019- Issue #5694: removed spurious test output in Distutils (test_clean).
9020
9021- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
9022
9023- Issue #1665206 (partially): Move imports in cgitb to the top of the module
9024 instead of performing them in functions. Helps prevent import deadlocking in
9025 threads.
9026
9027- Issue #2522: locale.format now checks its first argument to ensure it has
9028 been passed only one pattern, avoiding mysterious errors where it appeared
9029 that it was failing to do localization.
9030
9031- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
9032 Brandl.
9033
9034- Issue #1222: locale.format() bug when the thousands separator is a space
9035 character.
9036
9037- Issue #5472: Fixed distutils.test_util tear down. Original patch by
9038 Tim Golden.
9039
9040- collections.deque() objects now have a read-only attribute called maxlen.
9041
9042- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
9043 it is has been populated and properly configured in order to prevent
9044 window flashing.
9045
9046- Issue #4792: Prevent a segfault in _tkinter by using the
9047 guaranteed to be safe interp argument given to the PythonCmd in place of
9048 the Tcl interpreter taken from a PythonCmd_ClientData.
9049
9050- Issue #5193: Guarantee that tkinter.Text.search returns a string.
9051
9052- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
9053 Original patch by Akira Kitada.
9054
9055- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
9056
9057- Issue #5385: Fixed mmap crash after resize failure on windows.
9058
9059- Issue #5179: Fixed subprocess handle leak on failure on windows.
9060
9061- PEP 372: Added collections.OrderedDict().
9062
9063- The _asdict() for method for namedtuples now returns an OrderedDict().
9064
9065- configparser now defaults to using an ordered dictionary.
9066
9067- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
9068 import guess_extension`` was used.
9069
9070- Issue #1733986: Fixed mmap crash in accessing elements of second map object
9071 with same tagname but larger size than first map. (Windows)
9072
9073- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
9074 overrun.
9075
9076- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
9077 bdist_rpm command.
9078
9079- Issue #5378: added --quiet option to Distutils bdist_rpm command.
9080
9081- Issue #5052: make Distutils compatible with 2.3 again.
9082
9083- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
9084 in Distutils tests.
9085
9086- Issue #5287: Add exception handling around findCaller() call to help out
9087 IronPython.
9088
9089- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
9090 The file was resized to wrong size.
9091
9092- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
9093
9094- Issue #2279: distutils.sdist.add_defaults now add files
9095 from the package_data and the data_files metadata.
9096
9097- Issue #5257: refactored all tests in distutils, so they use
9098 support.TempdirManager, to avoid writing in the tests directory.
9099
9100- Issue #4524: distutils build_script command failed with --with-suffix=3.
9101 Initial patch by Amaury Forgeot d'Arc.
9102
9103- Issue #2461: added tests for distutils.util
9104
9105- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
9106 which inherited from numbers.py which did not have __slots__ defined. The
9107 numbers hierarchy now has its own __slots__ declarations.
9108
9109- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
9110 encoding.
9111
9112- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
9113 function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
9114
9115- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
9116 under NT and OS2. Patch by Philip Jenvey.
9117
9118- Issue #5128: Make compileall properly inspect bytecode to determine if needs
9119 to be recreated. This avoids a timing hole thanks to the old reliance on the
9120 ctime of the files involved.
9121
9122- Issue #5122: Synchronize tk load failure check to prevent a potential
9123 deadlock.
9124
9125- Issue #1818: collections.namedtuple() now supports a keyword argument
9126 'rename' which lets invalid fieldnames be automatically converted to
9127 positional names in the form, _1, _2, ...
9128
9129- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
9130
9131- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
9132 public documented method ``ZipImporter.get_filename()``.
9133
9134- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
9135 the execution of packages by looking for and executing a ``__main__``
9136 submodule when a package name is supplied. Initial patch by Andi
9137 Vajda.
9138
9139- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
9140 not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
9141 Tkapp_Call when calling from a thread different than the one that created
9142 the Tcl interpreter. Patch by Robert Hancock.
9143
9144- Issue #4285: Change sys.version_info to be a named tuple. Patch by
9145 Ross Light.
9146
9147- Issue #1520877: Now distutils.sysconfig reads $AR from the
9148 environment/Makefile. Patch by Douglas Greiman.
9149
9150- Issue #1276768: The verbose option was not used in the code of
9151 distutils.file_util and distutils.dir_util.
9152
9153- Issue #5132: Fixed trouble building extensions under Solaris with
9154 --enabled-shared activated. Initial patch by Dave Peterson.
9155
9156- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
9157
9158- The shelve module now defaults to pickle protocol 3.
9159
9160- Fix a bug in the trace module where a bytes object from co_lnotab had its
9161 items being passed through ord().
9162
9163- Issue #2047: shutil.move() could believe that its destination path was
9164 inside its source path if it began with the same letters (e.g. "src" vs.
9165 "src.new").
9166
9167- Added the ttk module. See issue #2983: Ttk support for Tkinter.
9168
9169- Removed isSequenceType(), isMappingType, and isNumberType() from the
9170 operator module; use the abstract base classes instead. Also removed
9171 the repeat() function; use mul() instead.
9172
9173- Issue #5021: doctest.testfile() did not create __name__ and
9174 collections.namedtuple() relied on __name__ being defined.
9175
9176- Backport importlib from Python 3.1. Only the import_module() function has
9177 been backported to help facilitate transitions from 2.7 to 3.1.
9178
9179- Issue #1885: distutils. When running sdist with --formats=tar,gztar
9180 the tar file was overriden by the gztar one.
9181
9182- Issue #4863: distutils.mwerkscompiler has been removed.
9183
9184- Added a new itertools functions: combinations_with_replacement()
9185 and compress().
9186
9187- Issue #5032: added a step argument to itertools.count() and
9188 allowed non-integer arguments.
9189
9190- Fix and properly document the multiprocessing module's logging
9191 support, expose the internal levels and provide proper usage
9192 examples.
9193
9194- Issue #1672332: fix unpickling of subnormal floats, which was
9195 producing a ValueError on some platforms.
9196
9197- Issue #3881: Help Tcl to load even when started through the
9198 unreadable local symlink to "Program Files" on Vista.
9199
9200- Issue #4710: Extract directories properly in the zipfile module;
9201 allow adding directories to a zipfile.
9202
9203- Issue #3807: _multiprocessing build fails when configure is passed
9204 --without-threads argument. When this occurs, _multiprocessing will
9205 be disabled, and not compiled.
9206
9207- Issue #5008: When a file is opened in append mode with the new IO library,
9208 do an explicit seek to the end of file (so that e.g. tell() returns the
9209 file size rather than 0). This is consistent with the behaviour of the
9210 traditional 2.x file object.
9211
9212- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
9213 parameter was set.
9214
9215- Issue #4842: Always append a trailing 'L' when pickling longs using
9216 pickle protocol 0. When reading, the 'L' is optional.
9217
9218- Add the importlib package.
9219
9220- Issue #4301: Patch the logging module to add processName support, remove
9221 _check_logger_class from multiprocessing.
9222
9223- Issue #3325: Remove python2.x try: except: imports for old cPickle from
9224 multiprocessing.
9225
9226- Issue #4959: inspect.formatargspec now works for keyword only arguments
9227 without defaults.
9228
9229- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
9230 for Unix machines for negative handles and large int handles. Without this check
9231 it is possible to segfault the interpreter.
9232
9233- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
9234 in sharedctypes.py.
9235
9236- Issue #1225107: inspect.isclass() returned True for instances with a custom
9237 __getattr__.
9238
9239- Issue #3826 and #4791: The socket module now closes the underlying socket
9240 appropriately when it is being used via socket.makefile() objects
9241 rather than delaying the close by waiting for garbage collection to do it.
9242
9243- Issue #1696199: Add collections.Counter() for rapid and convenient
9244 counting.
9245
9246- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
9247
9248- Issue #4867: Fixed a crash in ctypes when passing a string to a
9249 function without defining argtypes.
9250
9251- Issue #4272: Add an optional argument to the GzipFile constructor to override
9252 the timestamp in the gzip stream. The default value remains the current time.
9253 The information can be used by e.g. gunzip when decompressing. Patch by
9254 Jacques Frechet.
9255
9256- Restore Python 2.3 compatibility for decimal.py.
9257
9258- Issue #3638: Remove functions from _tkinter module level that depend on
9259 TkappObject to work with multiple threads.
9260
9261- Issue #4718: Adapt the wsgiref package so that it actually works with
9262 Python 3.x, in accordance with the `official amendments of the spec
9263 <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
9264
9265- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
9266 to the decimal module.
9267
9268- Fractions.from_float() no longer loses precision for integers too big to
9269 cast as floats.
9270
9271- Issue #4812: add missing underscore prefix to some internal-use-only
9272 constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
9273
9274- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
9275 did unnecessary work in the common case where no key function was specified.
9276
9277- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
9278 the function is not a generator.
9279
9280- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
9281 no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
9282
9283- Issue #4646: distutils was choking on empty options arg in the setup
9284 function. Original patch by Thomas Heller.
9285
9286- Issue #3767: Convert Tk object to string in tkColorChooser.
9287
9288- Issue #3248: Allow placing ScrolledText in a PanedWindow.
9289
9290- Issue #4444: Allow assertRaises() to be used as a context handler, so that
9291 the code under test can be written inline if more practical.
9292
9293- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
9294 works as expected in the interactive environment.
9295
9296- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
9297 Gabriel Genellina.
9298
9299- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
9300 boundary.
9301
9302- Issue #4223: inspect.getsource() will now correctly display source code
9303 for packages loaded via zipimport (or any other conformant PEP 302
9304 loader). Original patch by Alexander Belopolsky.
9305
9306- Issue #4201: pdb can now access and display source code loaded via
9307 zipimport (or any other conformant PEP 302 loader). Original patch by
9308 Alexander Belopolsky.
9309
9310- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
9311 302 conformant loader) will now work correctly in most cases (they
9312 are still subject to the constraints that exist for all code running
9313 from inside a module loaded via a PEP 302 loader and attempting to
9314 perform IO operations based on __file__). Original patch by
9315 Alexander Belopolsky.
9316
9317- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
9318 allows backporting to maintenance branches. Original patch by
9319 Alexander Belopolsky.
9320
9321- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
9322 a non-ASCII letter.
9323
9324- Issue #4616: TarFile.utime(): Restore directory times on Windows.
9325
9326- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
9327 codec cannot be found. This is for compatibility with the builtin behavior.
9328
9329- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
9330 give correct results in the case where one argument is a quiet NaN
9331 and the other is a finite number that requires rounding.
9332
9333- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
9334 libs.
9335
9336- Added the subprocess.check_call_output() convenience function to get output
9337 from a subprocess on success or raise an exception on error.
9338
9339- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9340 support unusual filenames (such as those containing semi-colons) in
9341 Content-Disposition headers.
9342
9343- Issue #4384: Added logging integration with warnings module using
9344 captureWarnings(). This change includes a NullHandler which does nothing;
9345 it will be of use to library developers who want to avoid the "No handlers
9346 could be found for logger XXX" message which can appear if the library user
9347 doesn't configure logging.
9348
9349- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9350 exception.
9351
9352- Issue #4529: fix the parser module's validation of try-except-finally
9353 statements.
9354
9355- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
9356 not a malformed option.
9357
9358- Added the subprocess.check_output() convenience function to get output
9359 from a subprocess on success or raise an exception on error.
9360
9361- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
9362 the corresponding tests now pass.
9363
9364- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
9365 it was calling the wrong open() function.
9366
9367- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9368 support unusual filenames (such as those containing semi-colons) in
9369 Content-Disposition headers.
9370
9371- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
9372 biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
9373
9374- Issue #5104: The socket module now raises OverflowError when 16-bit port and
9375 protocol numbers are supplied outside the allowed 0-65536 range on bind()
9376 and getservbyport().
9377
9378- Windows locale mapping updated to Vista.
9379
9380Tools/Demos
9381-----------
9382
9383- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
9384 and make it 2.6-compatible.
9385
9386- Ttk demos added in Demo/tkinter/ttk/
9387
9388- Issue #4677: add two list comprehension tests to pybench.
9389
9390
9391Build
9392-----
9393
9394- Issue #6094: Build correctly with Subversion 1.7.
9395
9396- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
9397
9398- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
9399 linker, rather than always exit successfully. Patch by Floris Bruynooghe.
9400
9401- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
9402 the order that backends for the dbm extension are checked.
9403
9404- Link the shared python library with $(MODLIBS).
9405
9406- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
9407
9408- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
9409
9410- Issue #4895: Use _strdup on Windows CE.
9411
9412- Issue #4472: "configure --enable-shared" now works on OSX
9413
9414- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
9415
9416- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9417
9418- Issue #4289: Remove Cancel button from AdvancedDlg.
9419
9420- Issue #1656675: Register a drop handler for .py* files on Windows.
9421
9422- Issue #4120: Exclude manifest from extension modules in VS2008.
9423
9424- Issue #4091: Install pythonxy.dll in system32 again.
9425
9426- Issue #4018: Disable "for me" installations on Vista.
9427
9428- Issue #3758: Add ``patchcheck`` build target to .PHONY.
9429
9430- Issue #4204: Fixed module build errors on FreeBSD 4.
9431
9432
9433C-API
9434-----
9435
9436- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
9437 NUL: Bogus TypeError detail string.
9438
9439- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
9440 for negative arguments. Previously, it raised TypeError.
9441
9442- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
9443
9444- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
9445 the GIL is released, or owned by another thread.
9446
9447- Issue #4122: On Windows, fix a compilation error when using the
9448 Py_UNICODE_ISSPACE macro in an extension module.
9449
9450
9451Extension Modules
9452-----------------
9453
9454- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
9455 supporting objects as input no matter how it was compiled (built in
9456 implementations or external openssl library).
9457
9458- Issue #4397: Fix occasional test_socket failure on OS X.
9459
9460- Issue #4279: Fix build of parsermodule under Cygwin.
9461
9462- Issue #4751: hashlib now releases the GIL when hashing large buffers
9463 (with a hardwired threshold of 2048 bytes), allowing better parallelization
9464 on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
9465
9466- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
9467
9468- Issue #4738: Each zlib object now has a separate lock, allowing to compress
9469 or decompress several streams at once on multi-CPU systems. Also, the GIL
9470 is now released when computing the CRC of a large buffer. Patch by ebfe.
9471
9472- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
9473
9474- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
9475
9476- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
9477 OpenBSD.
9478
9479- Issue #4583: array.array would not always prohibit resizing when a buffer
9480 has been exported, resulting in an interpreter crash when accessing the
9481 buffer.
9482
9483
9484- Issue #5228: Make functools.partial objects can now be pickled.
9485
9486Tests
9487-----
9488
9489- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
9490 regression tests in parallel, shortening the total runtime.
9491
9492- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
9493 Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
9494 the same behaviour as test_ttkguionly (and now also test_tk) which is to
9495 skip the tests if DISPLAY is defined but can't be used.
9496
9497- regrtest no longer treats ImportError as equivalent to SkipTest. Imports
9498 that should cause a test to be skipped are now done using import_module
9499 from test support, which does the conversion.
9500
9501- Issue #5083: New 'gui' resource for regrtest.
9502
9503
9504Docs
9505----
9506
9507
Barry Warsaw97f005d2008-12-03 16:46:14 +00009508What's New in Python 3.0 final
9509==============================
9510
9511*Release date: 03-Dec-2008*
9512
9513Core and Builtins
9514-----------------
9515
9516- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
9517 interpreter to abort ("Fatal Python error: Could not reset the stack!")
9518 instead of throwing a MemoryError.
9519
9520- Issue #3689: The list reversed iterator now supports __length_hint__
9521 instead of __len__. Behavior now matches other reversed iterators.
9522
9523- Issue #4367: Python would segfault during compiling when the unicodedata
9524 module couldn't be imported and \N escapes were present.
9525
9526- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
9527
9528Library
9529-------
9530
9531- Issue #4387: binascii now refuses to accept str as binary input.
9532
9533- Issue #4073: Add 2to3 support to build_scripts, refactor that support
9534 in build_py.
9535
9536- IDLE would print a "Unhandled server exception!" message when internal
9537 debugging is enabled.
9538
9539- Issue #4455: IDLE failed to display the windows list when two windows have
9540 the same title.
9541
9542- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9543 exception.
9544
9545- Issue #4433: Fixed an access violation when garbage collecting
9546 _ctypes.COMError instances.
9547
9548- Issue #4429: Fixed UnicodeDecodeError in ctypes.
9549
9550- Issue #4373: Corrected a potential reference leak in the pickle module and
9551 silenced a false positive ref leak in distutils.tests.test_build_ext.
9552
9553- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
9554 files.
9555
9556- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
9557 fail to properly display the error message.
9558
9559Build
9560-----
9561
9562- Issue #4407: Fix source file that caused the compileall step in Windows installer
9563 to fail.
9564
9565Docs
9566----
9567
9568- Issue #4449: Fixed multiprocessing examples
9569
9570- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
9571 for keys and values which will be converted to bytes before committal.
9572
9573
9574What's New in Python 3.0 release candidate 3?
9575=============================================
9576
9577*Release date: 20-Nov-2008*
9578
9579
9580Core and Builtins
9581-----------------
9582
9583- Issue #4349: sys.path included a non-existent platform directory because of a
9584 faulty Makefile.
9585
9586- Issue #3327: Don't overallocate in the modules_by_index list.
9587
9588- Issue #1721812: Binary set operations and copy() returned the input type
9589 instead of the appropriate base type. This was incorrect because set
9590 subclasses would be created without their __init__() method being called.
9591 The corrected behavior brings sets into line with lists and dicts.
9592
9593- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
9594 True, even when x doesn't compare equal to itself. This was a regression
9595 from 2.6.
9596
9597- Issue #3705: Command-line arguments were not correctly decoded when the
9598 terminal does not use UTF8.
9599
9600Library
9601-------
9602
9603- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
9604 the ctypes module is not present.
9605
9606- FileIO's mode attribute now always includes ``"b"``.
9607
9608- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
9609 keys are now written out in UTF-8.
9610
9611- Issue #4338: Fix distutils upload command.
9612
9613- Issue #4354: Fix distutils register command.
9614
9615- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
9616
9617- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
9618 uses ``kwonlydefaults`` instead of ``kwdefaults``.
9619
9620- Issue #4298: Fix a segfault when pickle.loads is passed a ill-formed input.
9621
9622- Issue #4283: Fix a left-over "iteritems" call in distutils.
9623
9624Build
9625-----
9626
9627- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9628
9629- Issue #4289: Remove Cancel button from AdvancedDlg.
9630
9631- Issue #1656675: Register a drop handler for .py* files on Windows.
9632
9633Tools/Demos
9634-----------
9635
9636- Demos of the socketserver module now work with Python 3.
9637
9638
9639What's New in Python 3.0 release candidate 2
9640============================================
9641
9642*Release date: 05-Nov-2008*
9643
9644Core and Builtins
9645-----------------
9646
9647- Issue #4211: The __path__ attribute of frozen packages is now a list instead
9648 of a string as required by PEP 302.
9649
9650- Issue #3727: Fixed poplib.
9651
9652- Issue #3714: Fixed nntplib by using bytes where appropriate.
9653
9654- Issue #1210: Fixed imaplib and its documentation.
9655
9656- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
9657 method on file objects with closefd=False. The file descriptor is still
9658 kept open but the file object behaves like a closed file. The ``FileIO``
9659 object also got a new readonly attribute ``closefd``.
9660
9661- Issue #3626: On cygwin, starting python with a non-existent script name
9662 would not display anything if the file name is only 1 character long.
9663
9664- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
9665 method does not return iterators for the 4th and 5th items.
9666
9667- Issue #3723: Fixed initialization of subinterpreters.
9668
9669- Issue #4213: The file system encoding is now normalized by the
9670 codec subsystem, for example UTF-8 is turned into utf-8.
9671
9672- Issue #4200: Changed the atexit module to store its state in its
9673 PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
9674
9675- Issue #4237: io.FileIO() was raising invalid warnings caused by
9676 insufficient initialization of PyFileIOObject struct members.
9677
9678- Issue #4170: Pickling a collections.defaultdict object would crash the
9679 interpreter.
9680
9681- Issue #4146: Compilation on OpenBSD has been restored.
9682
9683- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
9684
9685- Issues #2384 and #3975: Tracebacks were not correctly printed when the
9686 source file contains a ``coding:`` header: the wrong line was displayed, and
9687 the encoding was not respected.
9688
9689- Issue #3740: Null-initialize module state.
9690
9691- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
9692
9693- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
9694 contains non-ascii characters.
9695
9696- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
9697
9698Library
9699-------
9700
9701- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
9702 to call the base __init__ method.
9703
9704- Issue #3725: telnetlib now works completely in bytes.
9705
9706- Issue #4072: Restore build_py_2to3.
9707
9708- Issue #4014: Don't claim that Python has an Alpha release status, in addition
9709 to claiming it is Mature.
9710
9711- Issue #3187: Add sys.setfilesystemencoding.
9712
9713- Issue #3187: Better support for "undecodable" filenames. Code by Victor
9714 Stinner, with small tweaks by GvR.
9715
9716- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
9717 true singleton object.
9718
9719- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
9720
9721- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
9722 raise a TypeError: "'tuple' object is not callable" instead of the expected
9723 dbm.error.
9724
9725- Bug #3884: Make the turtle module toplevel again.
9726
9727- Issue #3547: Fixed ctypes structures bitfields of varying integer
9728 sizes.
9729
9730Extension Modules
9731-----------------
9732
9733- Issue #3659: Subclasses of str didn't work as SQL parameters.
9734
9735Build
9736-----
9737
9738- Issue #4120: Exclude manifest from extension modules in VS2008.
9739
9740- Issue #4091: Install pythonxy.dll in system32 again.
9741
9742- Issue #4018: Disable "for me" installations on Vista.
9743
9744- Issue #4204: Fixed module build errors on FreeBSD 4.
9745
9746Tools/Demos
9747-----------
9748
9749- Issue #3717: Fix Demo/embed/demo.c.
9750
9751- Issue #4072: Add a distutils demo for build_py_2to3.
9752
9753
9754What's New in Python 3.0 release candidate 1
9755============================================
9756
9757*Release date: 17-Sep-2008*
9758
9759Core and Builtins
9760-----------------
9761
9762- Issue #3827: memoryview lost its size attribute in favor of using len(view).
9763
9764- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
9765
9766- Issue #3705: fix crash when given a non-ascii value on the command line for
9767 the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
9768 although under Windows it fails at a later point.
9769
9770- Issue #3279: Importing site at interpreter was failing silently because the
9771 site module uses the open builtin which was not initialized at the time.
9772
9773- Issue #3660: Corrected a reference leak in str.encode() when the encoder
9774 does not return a bytes object.
9775
9776- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
9777 error conditions.
9778
9779- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
9780 tokenized by either a file path or file pointer for the benefit of
9781 PyTokenizer_FindEncoding().
9782
9783- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
9784 these systems, the mbstowcs() function is slightly buggy and must be
9785 replaced with strlen() for the purpose of counting of number of wide
9786 characters needed to represent the multi-byte character string.
9787
9788- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
9789 could be easily encountered under Windows in debug mode when exercising
9790 the recursion limit checking code, due to bogus handling of recursion
9791 limit when USE_STACKCHEK was enabled.
9792
9793- Issue 3639: The _warnings module could segfault the interpreter when
9794 unexpected types were passed in as arguments.
9795
9796- Issue #3712: The memoryview object had a reference leak and didn't support
9797 cyclic garbage collection.
9798
9799- Issue #3668: Fix a memory leak with the "s*" argument parser in
9800 PyArg_ParseTuple and friends, which occurred when the argument for "s*"
9801 was correctly parsed but parsing of subsequent arguments failed.
9802
9803- Issue #3611: An exception __context__ could be cleared in a complex pattern
9804 involving a __del__ method re-raising an exception.
9805
9806- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
9807 match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
9808 mechanism. In the process, fix a bug where isinstance() and issubclass(),
9809 when given a tuple of classes as second argument, were looking up
9810 __instancecheck__ / __subclasscheck__ on the tuple rather than on each
9811 type object.
9812
9813- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
9814
9815- Issue #3651: Fix various memory leaks when using the buffer
9816 interface, or when the "s#" code of PyArg_ParseTuple is given a
9817 bytes object.
9818
9819- Issue #3657: Fix uninitialized memory read when pickling longs.
9820 Found by valgrind.
9821
9822- Apply security patches from Apple.
9823
9824- Fix crashes on memory allocation failure found with failmalloc.
9825
9826- Fix memory leaks found with valgrind and update suppressions file.
9827
9828- Fix compiler warnings in opt mode which would lead to invalid memory reads.
9829
9830- Fix problem using wrong name in decimal module reported by pychecker.
9831
9832- Issue #3650: Fixed a reference leak in bytes.split('x').
9833
9834- bytes(o) now tries to use o.__bytes__() before using fallbacks.
9835
9836- Issue #1204: The configure script now tests for additional libraries
9837 that may be required when linking against readline. This fixes issues
9838 with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
9839
9840C API
9841-----
9842
9843- PyObject_Bytes and PyBytes_FromObject were added.
9844
9845Library
9846-------
9847
9848- Issue #3756: make re.escape() handle bytes as well as str.
9849
9850- Issue #3800: fix filter() related bug in formatter.py.
9851
9852- Issue #874900: fix behaviour of threading module after a fork.
9853
9854- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
9855
9856- Issue #3776: Deprecate the bsddb package for removal in 3.0.
9857
9858- Issue #3762: platform.architecture() fails if python is lanched via
9859 its symbolic link.
9860
9861- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
9862
9863- Issue #3160: the "bdist_wininst" distutils command didn't work.
9864
9865- Issue #1658: tkinter changes dict size during iteration in both
9866 tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
9867
9868- The bsddb module (and therefore the dbm.bsd module) has been removed.
9869 It is now maintained outside of the standard library at
9870 http://www.jcea.es/programacion/pybsddb.htm.
9871
9872- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
9873 to the urlparse one. Added a DeprecationWarning in the old module, it
9874 will be deprecated in the future.
9875
9876- Issue #3719: platform.architecture() fails if there are spaces in the
9877 path to the Python binary.
9878
9879- Issue 3602: As part of the merge of r66135, make the parameters on
9880 warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
9881
9882- The deprecation warnings for the camelCase threading API names were removed.
9883
9884- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
9885 SEM_VALUE_MAX.
9886
9887Extension Modules
9888-----------------
9889
9890- Issue #3782: os.write() must not accept unicode strings.
9891
9892- Issue #2975: When compiling several extension modules with Visual Studio 2008
9893 from the same python interpreter, some environment variables would grow
9894 without limit.
9895
9896- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
9897 exploitation of poor argument checking.
9898
9899- bsddb code updated to version 4.7.3pre2. This code is the same than
9900 Python 2.6 one, since the intention is to keep an unified 2.x/3.x codebase.
9901 The Python code is automatically translated using "2to3". Please, do not
9902 update this code in Python 3.0 by hand. Update the 2.6 one and then
9903 do "2to3".
9904
9905- The _bytesio and _stringio modules are now compiled into the python binary.
9906
9907- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
9908 mutable bytearray objects where they should have been using immutable bytes.
9909
9910- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
9911 return bytes objects instead of bytearray objects.
9912
9913
9914Tools/Demos
9915-----------
9916
9917- Fix Misc/gdbinit so it works.
9918
9919
9920Build
9921-----
9922
9923- Issue #3812: Failed to build python if configure --without-threads.
9924
9925- Issue #3791: Remove the bsddb module from the Windows installer, and the
9926 core bsddb library from the Windows build files.
9927
9928
9929What's new in Python 3.0b3?
9930===========================
9931
9932*Release date: 20-Aug-2008*
9933
9934Core and Builtins
9935-----------------
9936
9937- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
9938 arguments.
9939
9940- Issue #2394: implement more of the memoryview API, with the caveat that
9941 only one-dimensional contiguous buffers are supported and exercised right
9942 now. Slicing, slice assignment and comparison (equality and inequality)
9943 have been added. Also, the tolist() method has been implemented, but only
Georg Brandl98b52ef2009-05-25 22:20:44 +00009944 for byte buffers. Finally, the API has been updated to return bytes objects
Barry Warsaw97f005d2008-12-03 16:46:14 +00009945 wherever it used to return bytearrays.
9946
9947- Issue #3560: clean up the new C PyMemoryView API so that naming is
9948 internally consistent; add macros PyMemoryView_GET_BASE() and
9949 PyMemoryView_GET_BUFFER() to access useful properties of a memory views
9950 without relying on a particular implementation; remove the ill-named
9951 PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
9952
9953- ctypes function pointers that are COM methods have a boolean True
9954 value again.
9955
9956- Issue #1819: function calls with several named parameters are now on
9957 average 35% faster (as measured by pybench).
9958
9959- The undocumented C APIs PyUnicode_AsString() and
9960 PyUnicode_AsStringAndSize() were made private to the interpreter, in
9961 order to be able to refine their interfaces for Python 3.1.
9962
9963 If you need to access the UTF-8 representation of a Unicode object
9964 as bytes string, please use PyUnicode_AsUTF8String() instead.
9965
9966- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
9967 to Python 3.0's stricter semantics which allow to avoid successive
9968 reallocations of the result string (this also affects str.join()).
9969
9970
9971Library
9972-------
9973
9974- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
9975 a build problem on MacOS with CJK locales. It adds four temporary
9976 mappings to existing legacy codecs that are virtually compatible
9977 with Mac encodings. They will be replaced by codecs correctly
9978 implemented in 3.1.
9979
9980- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
9981 "global name 'header' is not defined".
9982
9983- Issue #2834: update the regular expression library to match the unicode
9984 standards of py3k. In other words, mixing bytes and unicode strings
9985 (be it as pattern, search string or replacement string) raises a TypeError.
9986 Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
9987 and can be disabled by specifying a new re.ASCII flag; as for bytes
9988 patterns, ASCII matching is the only option and trying to specify re.UNICODE
9989 for such patterns raises a ValueError.
9990
9991- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
9992 Code contributed by Matt Giuca. quote() now encodes the input
9993 before quoting, unquote() decodes after unquoting. There are
9994 new arguments to change the encoding and errors settings.
9995 There are also new APIs to skip the encode/decode steps.
9996 [un]quote_plus() are also affected.
9997
9998- Issue #2235: numbers.Number now blocks inheritance of the default id()
9999 based hash because that hash mechanism is not correct for numeric types.
10000 All concrete numeric types that inherit from Number (rather than just
10001 registering with it) must explicitly provide a hash implementation in
10002 order for their instances to be hashable.
10003
10004- Issue #2676: in the email package, content-type parsing was hanging on
10005 pathological input because of quadratic or exponential behaviour of a
10006 regular expression.
10007
10008- Issue #3476: binary buffered reading through the new "io" library is now
10009 thread-safe.
10010
10011- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
10012 menu entries were not deleted.
10013
10014- Remove the TarFileCompat class from tarfile.py.
10015
10016- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
10017 accepts the same parameters. It just checks that its first argument is an
10018 integer.
10019
10020- Issue #3394: zipfile.writestr sets external attributes when passed a
10021 file name rather than a ZipInfo instance, so files are extracted with
10022 mode 0600 rather than 000 under Unix.
10023
10024- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
10025 asking for a specific length.
10026
10027Extension Modules
10028-----------------
10029
10030- Bug #3542: Support Unicode strings in _msi module.
10031
10032What's new in Python 3.0b2?
10033===========================
10034
10035*Release date: 17-Jul-2008*
10036
10037Core and Builtins
10038-----------------
10039
10040- Issue #3008: the float type has a new instance method 'float.hex'
10041 and a new class method 'float.fromhex' to convert floating-point
10042 numbers to and from hexadecimal strings, respectively.
10043
10044- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
10045 for str.format(). This adds the prefix 0b, 0o, or 0x, respectively.
10046
10047- Issue #3280: like chr(), the "%c" format now accepts unicode code points
10048 beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
10049 "narrow Unicode" builds, the result is a string of 2 code units, forming a
10050 UTF-16 surrogate pair.
10051
10052- Issue #3282: str.isprintable() should return False for undefined
10053 Unicode characters.
10054
10055- Issue #3236: Return small longs from PyLong_FromString.
10056
10057- Exception tracebacks now support exception chaining.
10058
10059Library
10060-------
10061
10062- Removed the sunaudio module. Use sunau instead.
10063
10064- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
10065 api functions without holding the GIL, which could lead to a fatal
10066 error when they failed.
10067
10068- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
10069
10070- Removed "ast" function aliases from the parser module.
10071
10072- Issue #3313: Fixed a crash when a failed dlopen() call does not set
10073 a valid dlerror() message.
10074
10075- Issue #3258: Fixed a crash when a ctypes POINTER type to an
10076 incomplete structure was created.
10077
10078- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
10079 argument now must be a bytes object in any case.
10080
10081- Issue #3145: help("modules whatever") failed when trying to load the source
10082 code of every single module of the standard library, including invalid files
10083 used in the test suite.
10084
10085- The gettext library now consistently uses Unicode strings for message ids
10086 and message strings, and ``ugettext()`` and the like don't exist anymore.
10087
10088- The traceback module has been expanded to handle chained exceptions.
10089
10090C API
10091-----
10092
10093- Issue #3247: the function Py_FindMethod was removed. Modern types should
10094 use the tp_methods slot instead.
10095
10096Tools/Demos
10097-----------
10098
10099- The Mac/Demos directory has been removed.
10100
10101- All of the Mac scripts have been removed (including BuildApplet.py).
10102
10103
10104What's new in Python 3.0b1?
10105===========================
10106
10107*Release date: 18-Jun-2008*
10108
10109Core and Builtins
10110-----------------
10111
10112- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
10113 argument being anything other than a dict or None. Also fixed a bug in error
10114 handling when 'message' and 'category' were both set to None, triggering a
10115 bus error.
10116
10117- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
10118 holds the last (strong) reference to its referent.
10119
10120- Issue #2630: implement PEP 3138. repr() now returns printable
10121 Unicode characters unescaped, to get an ASCII-only representation
10122 of an object use ascii().
10123
10124- Issue #1342: On windows, Python could not start when installed in a
10125 directory with non-ascii characters.
10126
10127- Implement PEP 3121: new module initialization and finalization API.
10128
10129- Removed the already-defunct ``-t`` option.
10130
10131- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
10132 unmarshalling many code objects, which happens when importing a
10133 large .pyc file (~1000 functions).
10134
10135- Issue #2963: fix merging oversight that disabled method cache for
10136 all types.
10137
10138- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
10139
10140- Issue #2895: Don't crash when given bytes objects as keyword names.
10141
10142- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
10143 code now allows any unicode string and returns a utf-8 encoded
10144 buffer, just like the "s#" code already does. The "z" code was
10145 corrected as well.
10146
10147- Issue #2863: generators now have a ``gen.__name__`` attribute that
10148 equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
10149 ``func.func_code.co_name``. The repr() of a generator now also
10150 contains this name.
10151
10152- Issue #2831: enumerate() now has a ``start`` argument.
10153
10154- Issue #2801: fix bug in the float.is_integer method where a
10155 ValueError was sometimes incorrectly raised.
10156
10157- The ``--with-toolbox-glue`` option (and the associated
10158 pymactoolbox.h) have been removed.
10159
10160- Issue #2196: hasattr() now lets exceptions which do not inherit
10161 Exception (KeyboardInterrupt, and SystemExit) propagate instead of
10162 ignoring them.
10163
10164- #3021 Exception reraising sematics have been significantly improved. However,
10165 f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
10166 code anymore.
10167
10168- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
10169 removed.
10170
10171Extension Modules
10172-----------------
10173
10174- Renamed ``_winreg`` module to ``winreg``.
10175
10176- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
10177 platform.
10178
10179- Support for Windows 9x has been removed from the winsound module.
10180
10181- Issue #2870: cmathmodule.c compile error.
10182
10183Library
10184-------
10185
10186- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
10187 symtable.Symbol have been removed.
10188
10189- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
10190
10191- a new ``urllib`` package was created. It consists of code from
10192 ``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``. The old
10193 modules have all been removed. The new package has five submodules:
10194 ``urllib.parse``, ``urllib.request``, ``urllib.response``,
10195 ``urllib.error``, and ``urllib.robotparser``. The
10196 ``urllib.request.urlopen()`` function uses the url opener from
10197 ``urllib2``. (Note that the unittests have not been renamed for the
10198 beta, but they will be renamed in the future.)
10199
10200- rfc822 has been removed in favor of the email package.
10201
10202- mimetools has been removed in favor of the email package.
10203
10204- Patch #2849: Remove use of rfc822 module from standard library.
10205
10206- Added C optimized implementation of io.StringIO.
10207
10208- The ``pickle`` module is now automatically use an optimized C
10209 implementation of Pickler and Unpickler when available. The
10210 ``cPickle`` module is no longer needed.
10211
10212- Removed the ``htmllib`` and ``sgmllib`` modules.
10213
10214- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
10215 been removed from ``http.cookies``.
10216
10217- The ``commands`` module has been removed. Its getoutput() and
10218 getstatusoutput() functions have been moved to the ``subprocess`` module.
10219
10220- The ``http`` package was created; it contains the old ``httplib``
10221 as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
10222 as ``http.cookiejar``, and the content of the three ``HTTPServer``
10223 modules as ``http.server``.
10224
10225- The ``xmlrpc`` package was created; it contains the old
10226 ``xmlrpclib`` module as ``xmlrpc.client`` and the content of
10227 the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
10228 as ``xmlrpc.server``.
10229
10230- The ``dbm`` package was created, containing the old modules
10231 ``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
10232 ``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
10233 ``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
10234 as submodules.
10235
10236- The ``repr`` module has been renamed to ``reprlib``.
10237
10238- The ``statvfs`` module has been removed.
10239
10240- Issue #1713041: fix pprint's handling of maximum depth.
10241
10242- Issue #2250: Exceptions raised during evaluation of names in
10243 rlcompleter's ``Completer.complete()`` method are now caught and
10244 ignored.
10245
10246- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
10247 ``TextWrapper`` class.
10248
10249- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
10250 large to fit in a C long. ldexp(x, n) now returns a zero (with
10251 suitable sign) if n is large and negative; previously, it raised
10252 OverflowError.
10253
10254- The ``ConfigParser`` module has been renamed to ``configparser``.
10255
10256- Issue #2865: webbrowser.open() works again in a KDE environment.
10257
10258- The ``multifile`` module has been removed.
10259
10260- The ``SocketServer`` module has been renamed to ``socketserver``.
10261
10262- Fixed the ``__all__`` setting on ``collections`` to include
10263 ``UserList`` and ``UserString``.
10264
10265- The sre module has been removed.
10266
10267- The Queue module has been renamed to queue.
10268
10269- The copy_reg module has been renamed to copyreg.
10270
10271- The mhlib module has been removed.
10272
10273- The ihooks module has been removed.
10274
10275- The fpformat module has been removed.
10276
10277- The dircache module has been removed.
10278
10279- The Canvas module has been removed.
10280
10281- The Decimal module gained the magic methods __round__, __ceil__,
10282 __floor__ and __trunc__, to give support for round, math.ceil,
10283 math.floor and math.trunc.
10284
10285- The user module has been removed.
10286
10287- The mutex module has been removed.
10288
10289- The imputil module has been removed.
10290
10291- os.path.walk has been removed in favor of os.walk.
10292
10293- pdb gained the "until" command.
10294
10295- The test.test_support module has been renamed to test.support.
10296
10297- The threading module API was renamed to be PEP 8 compliant. The
10298 old names are still present, but will be removed in the near future.
10299
10300Tools/Demos
10301-----------
10302
10303- The bgen tool has been removed.
10304
10305Build
10306-----
10307
10308
10309What's New in Python 3.0a5?
10310===========================
10311
10312*Release date: 08-May-2008*
10313
10314Core and Builtins
10315-----------------
10316
10317- Fixed misbehaviour of PyLong_FromSsize_t on systems where
10318 sizeof(size_t) > sizeof(long).
10319
10320- Issue #2221: Corrected a SystemError "error return without exception
10321 set", when the code executed by exec() raises an exception, and
10322 sys.stdout.flush() also raises an error.
10323
10324- Bug #2565: The repr() of type objects now calls them 'class', not
10325 'type' - whether they are builtin types or not.
10326
10327- The command line processing was converted to pass Unicode strings
10328 through as unmodified as possible; as a consequence, the C API
10329 related to command line arguments was changed to use wchar_t.
10330
10331- All backslashes in raw strings are interpreted literally. This
10332 means that '\u' and '\U' escapes are not treated specially.
10333
10334Extension Modules
10335-----------------
10336
10337Library
10338-------
10339
10340- ctypes objects now support the PEP3118 buffer interface.
10341
10342- Issue #2682: ctypes callback functions now longer contain a cyclic
10343 reference to themselves.
10344
10345- Issue #2058: Remove the buf attribute and add __slots__ to the
10346 TarInfo class in order to reduce tarfile's memory usage.
10347
10348- Bug #2606: Avoid calling .sort() on a dict_keys object.
10349
10350- The bundled libffi copy is now in sync with the recently released
10351 libffi3.0.5 version, apart from some small changes to
10352 Modules/_ctypes/libffi/configure.ac.
10353
10354Build
10355-----
10356
10357- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
10358
10359- "make install" is now an alias for "make altinstall", to prevent
10360 accidentally overwriting a Python 2.x installation. Use "make
10361 fullinstall" to force Python 3.0 to be installed as "python".
10362
10363- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
10364 gcc is used as compiler.
10365
10366
10367What's New in Python 3.0a4?
10368===========================
10369
10370*Release date: 02-Apr-2008*
10371
10372Core and Builtins
10373-----------------
10374
10375- Bug #2301: Don't try decoding the source code into the original
10376 encoding for syntax errors.
10377
10378Extension Modules
10379-----------------
10380
10381- The dl module was removed, use the ctypes module instead.
10382
10383- Use wchar_t functions in _locale module.
10384
10385Library
10386-------
10387
10388- The class distutils.commands.build_py.build_py_2to3 can be used as a
10389 build_py replacement to automatically run 2to3 on modules that are
10390 going to be installed.
10391
10392- A new pickle protocol (protocol 3) is added with explicit support
10393 for bytes. This is the default protocol. It intentionally cannot
10394 be unpickled by Python 2.x.
10395
10396- When a pickle written by Python 2.x contains an (8-bit) str
10397 instance, this is now decoded to a (Unicode) str instance. The
10398 encoding used to do this defaults to ASCII, but can be overridden
10399 via two new keyword arguments to the Unpickler class. Previously
10400 this would create bytes instances, which is usually wrong: str
10401 instances are often used to pickle attribute names etc., and text is
10402 more common than binary data anyway.
10403
10404- Default to ASCII as the locale.getpreferredencoding, if the POSIX
10405 system doesn't support CODESET and LANG isn't set or doesn't allow
10406 deduction of an encoding.
10407
10408- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
10409 value.
10410
10411- Issue #719888: Updated tokenize to use a bytes API. generate_tokens
10412 has been renamed tokenize and now works with bytes rather than
10413 strings. A new detect_encoding function has been added for
10414 determining source file encoding according to PEP-0263. Token
10415 sequences returned by tokenize always start with an ENCODING token
10416 which specifies the encoding used to decode the file. This token is
10417 used to encode the output of untokenize back to bytes.
10418
10419
10420What's New in Python 3.0a3?
10421===========================
10422
10423*Release date: 29-Feb-2008*
10424
10425Core and Builtins
10426-----------------
10427
10428- Issue #2282: io.TextIOWrapper was not overriding seekable() from
10429 io.IOBase.
10430
10431- Issue #2115: Important speedup in setting __slot__ attributes. Also
10432 prevent a possible crash: an Abstract Base Class would try to access
10433 a slot on a registered virtual subclass.
10434
10435- Fixed repr() and str() of complex numbers with infinity or nan as
10436 real or imaginary part.
10437
10438- Clear all free list during a gc.collect() of the highest generation
10439 in order to allow pymalloc to free more arenas. Python may give back
10440 memory to the OS earlier.
10441
10442- Issue #2045: Fix an infinite recursion triggered when printing a
10443 subclass of collections.defaultdict, if its default_factory is set
10444 to a bound method.
10445
10446- Fixed a minor memory leak in dictobject.c. The content of the free
10447 list was not freed on interpreter shutdown.
10448
10449- Limit free list of method and builtin function objects to 256
10450 entries each.
10451
10452- Patch #1953: Added ``sys._compact_freelists()`` and the C API
10453 functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
10454 to compact the internal free lists of pre-allocted ints and floats.
10455
10456- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
10457 Python expected the return type int but the fork familie returns
10458 pi_t.
10459
10460- Issue #1678380: Fix a bug that identifies 0j and -0j when they
10461 appear in the same code unit.
10462
10463- Issue #2025: Added tuple.count() and tuple.index() methods to comply
10464 with the collections.Sequence API.
10465
10466- Fixed multiple reinitialization of the Python interpreter. The small
10467 int list in longobject.c has caused a seg fault during the third
10468 finalization.
10469
10470- Issue #1973: bytes.fromhex('') raised SystemError.
10471
10472- Issue #1771: remove cmp parameter from sorted() and list.sort().
10473
10474- Issue #1969: split and rsplit in bytearray are inconsistent.
10475
10476- map() no longer accepts None for the first argument. Use zip()
10477 instead.
10478
10479- Issue #1769: Now int("- 1") is not allowed any more.
10480
10481- Object/longobject.c: long(float('nan')) raises an OverflowError
10482 instead of returning 0.
10483
10484- Issue #1762972: __file__ points to the source file instead of the
10485 pyc/pyo file if the py file exists.
10486
10487- Issue #1393: object_richcompare() returns NotImplemented instead of
10488 False if the objects aren't equal, to give the other side a chance.
10489
10490- Issue #1692: Interpreter was not displaying location of SyntaxError.
10491
10492- Improve some exception messages when Windows fails to load an
10493 extension module. Now we get for example '%1 is not a valid Win32
10494 application' instead of 'error code 193'. Also use Unicode strings
10495 to deal with non-English locales.
10496
10497- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
10498 Python C API has gained a new type *PyInstanceMethod_Type* and the
10499 functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
10500 and *PyInstanceMethod_Function(im)*.
10501
10502- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
10503 from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
10504 are now enough to print the corresponding list of objects considered
10505 by the garbage collector.
10506
10507- Issue #1573: Improper use of the keyword-only syntax makes the
10508 parser crash.
10509
10510- Issue #1564: The set implementation should special-case PyUnicode
10511 instead of PyString.
10512
10513- Patch #1031213: Decode source line in SyntaxErrors back to its
10514 original source encoding.
10515
10516- inspect.getsource() includes the decorators again.
10517
10518- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
10519 mountpoint.
10520
10521- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
10522 the first chunk fed to the decoder started with a BOM, but was
10523 longer than 3 bytes.
10524
10525Extension Modules
10526-----------------
10527
10528- Code for itertools ifilter(), imap(), and izip() moved to bultins
10529 and renamed to filter(), map(), and zip(). Also, renamed
10530 izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
10531
10532- Issue #1762972: Readded the reload() function as imp.reload().
10533
10534- Bug #2111: mmap segfaults when trying to write a block opened with
10535 PROT_READ.
10536
10537- Issue #2063: correct order of utime and stime in os.times() result
10538 on Windows.
10539
10540Library
10541-------
10542
10543- Weakref dictionaries now inherit from MutableMapping.
10544
10545- Created new UserDict class in collections module. This one inherits
10546 from and complies with the MutableMapping ABC. Also, moved
10547 UserString and UserList to the collections module. The
10548 MutableUserString class was removed.
10549
10550- Removed UserDict.DictMixin. Replaced all its uses with
10551 collections.MutableMapping.
10552
10553- Issue #1703: getpass() should flush after writing prompt.
10554
10555- Issue #1585: IDLE uses non-existent xrange() function.
10556
10557- Issue #1578: Problems in win_getpass.
10558
10559Build
10560-----
10561
10562- Renamed --enable-unicode configure flag to --with-wide-unicode,
10563 since Unicode strings can't be disabled anymore.
10564
10565C API
10566-----
10567
10568- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
10569 Py_TYPE and Py_REFCNT.
10570
10571- New API PyImport_ImportModuleNoBlock(), works like
10572 PyImport_ImportModule() but won't block on the import lock
10573 (returning an error instead).
10574
10575
10576What's New in Python 3.0a2?
10577===========================
10578
10579*Release date: 07-Dec-2007*
10580
10581(Note: this list is incomplete.)
10582
10583Core and Builtins
10584-----------------
10585
10586- str8 now has the same construction signature as bytes.
10587
10588- Comparisons between str and str8 now return False/True for ==/!=.
10589 sqlite3 returns str8 when recreating on object from it's __conform__
10590 value. The struct module returns str8 for all string-related
10591 formats. This was true before this change, but becomes more
10592 apparent thanks to string comparisons always being False.
10593
10594- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
10595 buffer, encoding, newline)`.
10596
10597- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
10598
10599- Changed `__file__` and `co_filename` to unicode. The path names are decoded
10600 with `Py_FileSystemDefaultEncoding` and a new API method
10601 `PyUnicode_DecodeFSDefault(char*)` was added.
10602
10603- io.open() and _fileio.FileIO have grown a new argument closefd. A
10604 false value disables the closing of the file descriptor.
10605
10606- Added a new option -b to issues warnings (-bb for errors) about
10607 certain operations between bytes/buffer and str like str(b'') and
10608 comparison.
10609
10610- The standards streams sys.stdin, stdout and stderr may be None when
10611 the when the C runtime library returns an invalid file descriptor
10612 for the streams (fileno(stdin) < 0). For now this happens only for
10613 Windows GUI apps and scripts started with `pythonw.exe`.
10614
10615- Added PCbuild9 directory for VS 2008.
10616
10617- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
10618 work around a name clash with VS 2008 on Windows.
10619
10620- Unbound methods are gone for good. ClassObject.method returns an
10621 ordinary function object, instance.method still returns a bound
10622 method object. The API of bound methods is cleaned up, too. The
10623 im_class attribute is removed and im_func + im_self are renamed to
10624 __func__ and __self__. The factory PyMethod_New takes only func and
10625 instance as argument.
10626
10627- intobject.h is no longer included by Python.h. The remains were
10628 moved to longobject.h. It still exists to define several aliases
10629 from PyInt to PyLong functions.
10630
10631- Removed sys.maxint, use sys.maxsize instead.
10632
10633Extension Modules
10634-----------------
10635
10636- The `hotshot` profiler has been removed; use `cProfile` instead.
10637
10638Library
10639-------
10640
10641- When loading an external file using testfile(), the passed-in
10642 encoding argument was being ignored if __loader__ is defined and
10643 forcing the source to be UTF-8.
10644
10645- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
10646 been removed in favor of the tempfile module.
10647
10648- Removed the 'new' module.
10649
10650- Removed all types from the 'types' module that are easily accessable
10651 through builtins.
10652
10653
10654What's New in Python 3.0a1?
10655===========================
10656
10657*Release date: 31-Aug-2007*
10658
10659Core and Builtins
10660-----------------
10661
10662- PEP 3131: Support non-ASCII identifiers.
10663
10664- PEP 3120: Change default encoding to UTF-8.
10665
10666- PEP 3123: Use proper C inheritance for PyObject.
10667
10668- Removed the __oct__ and __hex__ special methods and added a bin()
10669 builtin function.
10670
10671- PEP 3127: octal literals now start with "0o". Old-style octal
10672 literals are invalid. There are binary literals with a prefix of
10673 "0b". This also affects int(x, 0).
10674
10675- None, True, False are now keywords.
10676
10677- PEP 3119: isinstance() and issubclass() can be overridden.
10678
10679- Remove BaseException.message.
10680
10681- Remove tuple parameter unpacking (PEP 3113).
10682
10683- Remove the f_restricted attribute from frames. This naturally leads
10684 to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
10685
10686- PEP 3132 was accepted. That means that you can do ``a, *b =
10687 range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
10688
10689- range() now returns an iterator rather than a list. Floats are not
10690 allowed. xrange() is no longer defined.
10691
10692- Patch #1660500: hide iteration variable in list comps, add set comps
10693 and use common code to handle compilation of iterative expressions.
10694
10695- By default, != returns the opposite of ==, unless the latter returns
10696 NotImplemented.
10697
10698- Patch #1680961: sys.exitfunc has been removed and replaced with a
10699 private C-level API.
10700
10701- PEP 3115: new metaclasses: the metaclass is now specified as a
10702 keyword arg in the class statement, which can now use the full
10703 syntax of a parameter list. Also, the metaclass can implement a
10704 __prepare__ function which will be called to create the dictionary
10705 for the new class namespace.
10706
10707- The long-deprecated argument "pend" of PyFloat_FromString() has been
10708 removed.
10709
10710- The dir() function has been extended to call the __dir__() method on
10711 its argument, if it exists. If not, it will work like before. This
10712 allows customizing the output of dir() in the presence of a
10713 __getattr__().
10714
10715- Removed support for __members__ and __methods__.
10716
10717- Removed indexing/slicing on BaseException.
10718
10719- input() became raw_input(): the name input() now implements the
10720 functionality formerly known as raw_input(); the name raw_input() is
10721 no longer defined.
10722
10723- Classes listed in an 'except' clause must inherit from
10724 BaseException.
10725
10726- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
10727 and .keys(), .items(), .values() return dict views, which behave
10728 like sets.
10729
10730- PEP 3105: print is now a function. Also (not in the PEP) the
10731 'softspace' attribute of files is now gone (since print() doesn't
10732 use it). A side effect of this change is that you can get
10733 incomplete output lines in interactive sessions:
10734
10735 >>> print(42, end="")
10736 42>>>
10737
10738 We may be able to fix this after the I/O library rewrite.
10739
10740- PEP 3102: keyword-only arguments.
10741
10742- Int/Long unification is complete. The 'long' built-in type and
10743 literals with trailing 'L' or 'l' have been removed. Performance
10744 may be sub-optimal (haven't really benchmarked).
10745
10746- 'except E, V' must now be spelled as 'except E as V' and deletes V
10747 at the end of the except clause; V must be a simple name.
10748
10749- Added function annotations per PEP 3107.
10750
10751- Added nonlocal declaration from PEP 3104:
10752
10753 >>> def f(x):
10754 ... def inc():
10755 ... nonlocal x
10756 ... x += 1
10757 ... return x
10758 ... return inc
10759 ...
10760 >>> inc = f(0)
10761 >>> inc()
10762 1
10763 >>> inc()
10764 2
10765
10766- Moved intern() to sys.intern().
10767
10768- exec is now a function.
10769
10770- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
10771
10772- Classic classes are a thing of the past. All classes are new style.
10773
10774- Exceptions *must* derive from BaseException.
10775
10776- Integer division always returns a float. The -Q option is no more.
10777 All the following are gone:
10778
10779 * PyNumber_Divide and PyNumber_InPlaceDivide
10780 * __div__, __rdiv__, and __idiv__
10781 * nb_divide, nb_inplace_divide
10782 * operator.div, operator.idiv, operator.__div__, operator.__idiv__
10783 (Only __truediv__ and __floordiv__ remain, not sure how to handle
10784 them if we want to re-use __div__ and friends. If we do, it will
10785 make it harder to write code for both 2.x and 3.x.)
10786
10787- 'as' and 'with' are keywords.
10788
10789- Absolute import is the default behavior for 'import foo' etc.
10790
10791- Removed support for syntax: backticks (ie, `x`), <>.
10792
10793- Removed these Python builtins: apply(), callable(), coerce(),
10794 execfile(), file(), reduce(), reload().
10795
10796- Removed these Python methods: {}.has_key.
10797
10798- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
10799
10800- Remove C API support for restricted execution.
10801
10802- zip(), map() and filter() now return iterators, behaving like their
10803 itertools counterparts. This also affect map()'s behavior on
10804 sequences of unequal length -- it now stops after the shortest one
10805 is exhausted.
10806
10807- Additions: set literals, set comprehensions, ellipsis literal.
10808
10809- Added class decorators per PEP 3129.
10810
10811
10812Extension Modules
10813-----------------
10814
10815- Removed the imageop module. Obsolete long with its unit tests
10816 becoming useless from the removal of rgbimg and imgfile.
10817
10818- Removed these attributes from the operator module: div, idiv,
10819 __div__, __idiv__, isCallable, sequenceIncludes.
10820
10821- Removed these attributes from the sys module: exc_clear(), exc_type,
10822 exc_value, exc_traceback.
10823
10824
10825Library
10826-------
10827
10828- Removed the compiler package. Use of the _ast module and (an
10829 eventual) AST -> bytecode mechanism.
10830
10831- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
10832 linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
10833 stringold, strop, sunaudiodev, timing, xmllib.
10834
10835- Moved the toaiff module to Tools/Demos.
10836
10837- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
10838 DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
10839 IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
10840
10841- Removed obsolete functions: commands.getstatus(), os.popen*().
10842
10843- Removed functions in the string module that are also string methods;
10844 Remove string.{letters, lowercase, uppercase}.
10845
10846- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
10847
10848- Removed xmlrpclib.SlowParser. It was based on xmllib.
10849
10850- Patch #1680961: atexit has been reimplemented in C.
10851
10852- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
10853
10854Build
10855-----
10856
10857C API
10858-----
10859
10860- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
10861
10862- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
10863 PyMember_Get, PyMember_Set.
10864
10865- Removed these C slots/fields: nb_divide, nb_inplace_divide.
10866
10867- Removed these macros: staticforward, statichere, PyArg_GetInt,
10868 PyArg_NoArgs, _PyObject_Del.
10869
10870- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
10871 intintobjargproc, getreadbufferproc, getwritebufferproc,
10872 getsegcountproc, getcharbufferproc, memberlist.
10873
10874Tests
10875-----
10876
10877- Removed test.testall as test.regrtest replaces it.
10878
10879Documentation
10880-------------
10881
10882Mac
10883---
10884
10885- The cfmfile module was removed.
10886
10887Platforms
10888---------
10889
10890- Support for BeOS and AtheOS was removed (according to PEP 11).
10891
10892- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
10893
10894Tools/Demos
10895-----------
10896
10897
Christian Heimesc3f30c42008-02-22 16:37:40 +000010898What's New in Python 2.5 release candidate 1?
10899=============================================
10900
10901*Release date: 17-AUG-2006*
10902
10903Core and builtins
10904-----------------
10905
10906- Unicode objects will no longer raise an exception when being
10907 compared equal or unequal to a string and a UnicodeDecodeError
10908 exception occurs, e.g. as result of a decoding failure.
10909
10910 Instead, the equal (==) and unequal (!=) comparison operators will
10911 now issue a UnicodeWarning and interpret the two objects as
10912 unequal. The UnicodeWarning can be filtered as desired using
10913 the warning framework, e.g. silenced completely, turned into an
10914 exception, logged, etc.
10915
10916 Note that compare operators other than equal and unequal will still
10917 raise UnicodeDecodeError exceptions as they've always done.
10918
10919- Fix segfault when doing string formatting on subclasses of long.
10920
10921- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
10922 with new-style classes.
10923
10924- Fix bug related to __len__ functions returning negative values with
10925 classic classes.
10926
10927- Patch #1538606, Fix __index__() clipping. There were some problems
10928 discovered with the API and how integers that didn't fit into Py_ssize_t
10929 were handled. This patch attempts to provide enough alternatives
10930 to effectively use __index__.
10931
10932- Bug #1536021: __hash__ may now return long int; the final hash
10933 value is obtained by invoking hash on the long int.
10934
10935- Bug #1536786: buffer comparison could emit a RuntimeWarning.
10936
10937- Bug #1535165: fixed a segfault in input() and raw_input() when
10938 sys.stdin is closed.
10939
10940- On Windows, the PyErr_Warn function is now exported from
10941 the Python dll again.
10942
10943- Bug #1191458: tracing over for loops now produces a line event
10944 on each iteration. Fixing this problem required changing the .pyc
10945 magic number. This means that .pyc files generated before 2.5c1
10946 will be regenerated.
10947
10948- Bug #1333982: string/number constants were inappropriately stored
10949 in the byte code and co_consts even if they were not used, ie
10950 immediately popped off the stack.
10951
10952- Fixed a reference-counting problem in property().
10953
10954
10955Library
10956-------
10957
10958- Fix a bug in the ``compiler`` package that caused invalid code to be
10959 generated for generator expressions.
10960
10961- The distutils version has been changed to 2.5.0. The change to
10962 keep it programmatically in sync with the Python version running
10963 the code (introduced in 2.5b3) has been reverted. It will continue
10964 to be maintained manually as static string literal.
10965
10966- If the Python part of a ctypes callback function returns None,
10967 and this cannot be converted to the required C type, an exception is
10968 printed with PyErr_WriteUnraisable. Before this change, the C
10969 callback returned arbitrary values to the calling code.
10970
10971- The __repr__ method of a NULL ctypes.py_object() no longer raises
10972 an exception.
10973
10974- uuid.UUID now has a bytes_le attribute. This returns the UUID in
10975 little-endian byte order for Windows. In addition, uuid.py gained some
10976 workarounds for clocks with low resolution, to stop the code yielding
10977 duplicate UUIDs.
10978
10979- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
10980 before raising SystemExit, allowing IDLE to honor quit() and exit().
10981
10982- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
10983
10984- Patch #1536071: trace.py should now find the full module name of a
10985 file correctly even on Windows.
10986
10987- logging's atexit hook now runs even if the rest of the module has
10988 already been cleaned up.
10989
10990- Bug #1112549, fix DoS attack on cgi.FieldStorage.
10991
10992- Bug #1531405, format_exception no longer raises an exception if
10993 str(exception) raised an exception.
10994
10995- Fix a bug in the ``compiler`` package that caused invalid code to be
10996 generated for nested functions.
10997
10998
10999Extension Modules
11000-----------------
11001
11002- Patch #1511317: don't crash on invalid hostname (alias) info.
11003
11004- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
11005 raises the correct exceptions.
11006
11007- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
11008 '-no-stack-protector' compiler flag for OpenBSD has been removed.
11009
11010- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
11011 uses the _as_parameter_ attribute when objects are passed to foreign
11012 function calls. The ctypes version number was changed to 1.0.1.
11013
11014- Bug #1530559, struct.pack raises TypeError where it used to convert.
11015 Passing float arguments to struct.pack when integers are expected
11016 now triggers a DeprecationWarning.
11017
11018
11019Tests
11020-----
11021
11022- test_socketserver should now work on cygwin and not fail sporadically
11023 on other platforms.
11024
11025- test_mailbox should now work on cygwin versions 2006-08-10 and later.
11026
11027- Bug #1535182: really test the xreadlines() method of bz2 objects.
11028
11029- test_threading now skips testing alternate thread stack sizes on
11030 platforms that don't support changing thread stack size.
11031
11032
11033Documentation
11034-------------
11035
11036- Patch #1534922: unittest docs were corrected and enhanced.
11037
11038
11039Build
11040-----
11041
11042- Bug #1535502, build _hashlib on Windows, and use masm assembler
11043 code in OpenSSL.
11044
11045- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
11046
11047- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
11048
11049
11050C API
11051-----
11052
11053- New API for Unicode rich comparisons: PyUnicode_RichCompare()
11054
11055- Bug #1069160. Internal correctness changes were made to
11056 ``PyThreadState_SetAsyncExc()``. A test case was added, and
11057 the documentation was changed to state that the return value
11058 is always 1 (normal) or 0 (if the specified thread wasn't found).
11059
11060
11061What's New in Python 2.5 beta 3?
11062================================
11063
11064*Release date: 03-AUG-2006*
11065
11066Core and builtins
11067-----------------
11068
11069- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
11070 returned a long (see PEP 353).
11071
11072- Bug #1515471: string.replace() accepts character buffers again.
11073
11074- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
11075 This provides the proper warning for struct.pack().
11076 PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
11077
11078- Patch #1531113: Fix augmented assignment with yield expressions.
11079 Also fix a SystemError when trying to assign to yield expressions.
11080
11081- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
11082 with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
11083 used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
11084 excessive filesystem operations during imports.
11085
11086- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
11087 operations on signed longs that are formally undefined by C.
11088 Unfortunately, at least one compiler now cares about that, so complicated
11089 the code to make that compiler happy again.
11090
11091- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
11092
11093- Patch #1232023: Stop including current directory in search
11094 path on Windows.
11095
11096- Fix some potential crashes found with failmalloc.
11097
11098- Fix warnings reported by Klocwork's static analysis tool.
11099
11100- Bug #1512814, Fix incorrect lineno's when code within a function
11101 had more than 255 blank lines.
11102
11103- Patch #1521179: Python now accepts the standard options ``--help`` and
11104 ``--version`` as well as ``/?`` on Windows.
11105
11106- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
11107 again. Fixing this problem required changing the .pyc magic number.
11108 This means that .pyc files generated before 2.5b3 will be regenerated.
11109
11110- Bug #1524317: Compiling Python ``--without-threads`` failed.
11111 The Python core compiles again, and, in a build without threads, the
11112 new ``sys._current_frames()`` returns a dictionary with one entry,
11113 mapping the faux "thread id" 0 to the current frame.
11114
11115- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
11116
11117
11118Library
11119-------
11120
11121- Fix #1693149. Now you can pass several modules separated by
11122 comma to trace.py in the same --ignore-module option.
11123
11124- Correction of patch #1455898: In the mbcs decoder, set final=False
11125 for stream decoder, but final=True for the decode function.
11126
11127- os.urandom no longer masks unrelated exceptions like SystemExit or
11128 KeyboardInterrupt.
11129
11130- Bug #1525866: Don't copy directory stat times in
11131 shutil.copytree on Windows
11132
11133- Bug #1002398: The documentation for os.path.sameopenfile now correctly
11134 refers to file descriptors, not file objects.
11135
11136- The renaming of the xml package to xmlcore, and the import hackery done
11137 to make it appear at both names, has been removed. Bug #1511497,
11138 #1513611, and probably others.
11139
11140- Bug #1441397: The compiler module now recognizes module and function
11141 docstrings correctly as it did in Python 2.4.
11142
11143- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
11144 lost that tests are sorted by name before being run. This rarely
11145 matters for well-written tests, but can create baffling symptoms if
11146 side effects from one test to the next affect outcomes. ``DocTestFinder``
11147 has been changed to sort the list of tests it returns.
11148
11149- The distutils version has been changed to 2.5.0, and is now kept
11150 in sync with sys.version_info[:3].
11151
11152- Bug #978833: Really close underlying socket in _socketobject.close.
11153
11154- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
11155 title().
11156
11157- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
11158 to recursive calls and call it with the failing package name.
11159
11160- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
11161
11162- Patch #1515343: Fix printing of deprecated string exceptions with a
11163 value in the traceback module.
11164
11165- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
11166
11167- Patch #1524429: Use repr() instead of backticks in Tkinter again.
11168
11169- Bug #1520914: Change time.strftime() to accept a zero for any position in its
11170 argument tuple. For arguments where zero is illegal, the value is forced to
11171 the minimum value that is correct. This is to support an undocumented but
11172 common way people used to fill in inconsequential information in the time
11173 tuple pre-2.4.
11174
11175- Patch #1220874: Update the binhex module for Mach-O.
11176
11177- The email package has improved RFC 2231 support, specifically for
11178 recognizing the difference between encoded (name*0*=<blah>) and non-encoded
11179 (name*0=<blah>) parameter continuations. This may change the types of
11180 values returned from email.message.Message.get_param() and friends.
11181 Specifically in some cases where non-encoded continuations were used,
11182 get_param() used to return a 3-tuple of (None, None, string) whereas now it
11183 will just return the string (since non-encoded continuations don't have
11184 charset and language parts).
11185
11186 Also, whereas % values were decoded in all parameter continuations, they are
11187 now only decoded in encoded parameter parts.
11188
11189- Bug #1517990: IDLE keybindings on MacOS X now work correctly
11190
11191- Bug #1517996: IDLE now longer shows the default Tk menu when a
11192 path browser, class browser or debugger is the frontmost window on MacOS X
11193
11194- Patch #1520294: Support for getset and member descriptors in types.py,
11195 inspect.py, and pydoc.py. Specifically, this allows for querying the type
11196 of an object against these built-in types and more importantly, for getting
11197 their docstrings printed in the interactive interpreter's help() function.
11198
11199
11200Extension Modules
11201-----------------
11202
11203- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
11204 a socket operation on a socket with a timeout, the exception will be
11205 caught correctly. Previously, the exception was not caught.
11206
11207- Patch #1529514: The _ctypes extension is now compiled on more
11208 openbsd target platforms.
11209
11210- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
11211 a memory leak, affecting pickles and deep copies.
11212
11213- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
11214 Paul Eggert.
11215
11216- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
11217
11218- Patch #1521817: Index range checking on ctypes arrays containing
11219 exactly one element enabled again. This allows iterating over these
11220 arrays, without the need to check the array size before.
11221
11222- Bug #1521375: When the code in ctypes.util.find_library was
11223 run with root privileges, it could overwrite or delete
11224 /dev/null in certain cases; this is now fixed.
11225
11226- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
11227 default mode for loading shared libraries in ctypes.
11228
11229- Because of a misspelled preprocessor symbol, ctypes was always
11230 compiled without thread support; this is now fixed.
11231
11232- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
11233 methods now allow their database parameter to be None as the
11234 sleepycat API allows.
11235
11236- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
11237 bluetooth API compared with Linux and FreeBSD.
11238
11239Tests
11240-----
11241
11242- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
11243 how long the test file should take to play. Now accepts taking 2.93 secs
11244 (exact time) +/- 10% instead of the hard-coded 3.1 sec.
11245
11246- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
11247 ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
11248 run via ``regrtest.py``. Now they do.
11249
11250Build
11251-----
11252
11253- Bug #1439538: Drop usage of test -e in configure as it is not portable.
11254
11255Mac
11256---
11257
11258- PythonLauncher now works correctly when the path to the script contains
11259 characters that are treated specially by the shell (such as quotes).
11260
11261- Bug #1527397: PythonLauncher now launches scripts with the working directory
11262 set to the directory that contains the script instead of the user home
11263 directory. That latter was an implementation accident and not what users
11264 expect.
11265
11266
11267What's New in Python 2.5 beta 2?
11268================================
11269
11270*Release date: 11-JUL-2006*
11271
11272Core and builtins
11273-----------------
11274
11275- Bug #1441486: The literal representation of -(sys.maxint - 1)
11276 again evaluates to a int object, not a long.
11277
11278- Bug #1501934: The scope of global variables that are locally assigned
11279 using augmented assignment is now correctly determined.
11280
11281- Bug #927248: Recursive method-wrapper objects can now safely
11282 be released.
11283
11284- Bug #1417699: Reject locale-specific decimal point in float()
11285 and atof().
11286
11287- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
11288 omit a default "error" argument for NULL pointer. This allows
11289 the parser to take a codec from cjkcodecs again.
11290
11291- Bug #1519018: 'as' is now validated properly in import statements.
11292
11293- On 64 bit systems, int literals that use less than 64 bits are
11294 now ints rather than longs.
11295
11296- Bug #1512814, Fix incorrect lineno's when code at module scope
11297 started after line 256.
11298
11299- New function ``sys._current_frames()`` returns a dict mapping thread
11300 id to topmost thread stack frame. This is for expert use, and is
11301 especially useful for debugging application deadlocks. The functionality
11302 was previously available in Fazal Majid's ``threadframe`` extension
11303 module, but it wasn't possible to do this in a wholly threadsafe way from
11304 an extension.
11305
11306Library
11307-------
11308
11309- Bug #1257728: Mention Cygwin in distutils error message about a missing
11310 VS 2003.
11311
11312- Patch #1519566: Update turtle demo, make begin_fill idempotent.
11313
11314- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
11315 environment variable to be set in order to the SDK environment
11316 for finding the compiler, include files, etc.
11317
11318- Bug #1515998: Properly generate logical ids for files in bdist_msi.
11319
11320- warnings.py now ignores ImportWarning by default
11321
11322- string.Template() now correctly handles tuple-values. Previously,
11323 multi-value tuples would raise an exception and single-value tuples would
11324 be treated as the value they contain, instead.
11325
11326- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
11327 even if some data are received.
11328
11329- Bug #1267547: Put proper recursive setup.py call into the
11330 spec file generated by bdist_rpm.
11331
11332- Bug #1514693: Update turtle's heading when switching between
11333 degrees and radians.
11334
11335- Reimplement turtle.circle using a polyline, to allow correct
11336 filling of arcs.
11337
11338- Bug #1514703: Only setup canvas window in turtle when the canvas
11339 is created.
11340
11341- Bug #1513223: .close() of a _socketobj now releases the underlying
11342 socket again, which then gets closed as it becomes unreferenced.
11343
11344- Bug #1504333: Make sgmllib support angle brackets in quoted
11345 attribute values.
11346
11347- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
11348 sgmllib ('[' and ']' were not accepted).
11349
11350- Fix a bug in the turtle module's end_fill function.
11351
11352- Bug #1510580: The 'warnings' module improperly required that a Warning
11353 category be either a types.ClassType and a subclass of Warning. The proper
11354 check is just that it is a subclass with Warning as the documentation states.
11355
11356- The compiler module now correctly compiles the new try-except-finally
11357 statement (bug #1509132).
11358
11359- The wsgiref package is now installed properly on Unix.
11360
11361- A bug was fixed in logging.config.fileConfig() which caused a crash on
11362 shutdown when fileConfig() was called multiple times.
11363
11364- The sqlite3 module did cut off data from the SQLite database at the first
11365 null character before sending it to a custom converter. This has been fixed
11366 now.
11367
11368Extension Modules
11369-----------------
11370
11371- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
11372 means that select() on sockets > FD_SETSIZE (typically 1024) work again.
11373 The patch makes sockets use poll() internally where available.
11374
11375- Assigning None to pointer type fields in ctypes structures possible
11376 overwrote the wrong fields, this is fixed now.
11377
11378- Fixed a segfault in _ctypes when ctypes.wintypes were imported
11379 on non-Windows platforms.
11380
11381- Bug #1518190: The ctypes.c_void_p constructor now accepts any
11382 integer or long, without range checking.
11383
11384- Patch #1517790: It is now possible to use custom objects in the ctypes
11385 foreign function argtypes sequence as long as they provide a from_param
11386 method, no longer is it required that the object is a ctypes type.
11387
11388- The '_ctypes' extension module now works when Python is configured
11389 with the --without-threads option.
11390
11391- Bug #1513646: os.access on Windows now correctly determines write
11392 access, again.
11393
11394- Bug #1512695: cPickle.loads could crash if it was interrupted with
11395 a KeyboardInterrupt.
11396
11397- Bug #1296433: parsing XML with a non-default encoding and
11398 a CharacterDataHandler could crash the interpreter in pyexpat.
11399
11400- Patch #1516912: improve Modules support for OpenVMS.
11401
11402Build
11403-----
11404
11405- Automate Windows build process for the Win64 SSL module.
11406
11407- 'configure' now detects the zlib library the same way as distutils.
11408 Previously, the slight difference could cause compilation errors of the
11409 'zlib' module on systems with more than one version of zlib.
11410
11411- The MSI compileall step was fixed to also support a TARGETDIR
11412 with spaces in it.
11413
11414- Bug #1517388: sqlite3.dll is now installed on Windows independent
11415 of Tcl/Tk.
11416
11417- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
11418 trying to be installed even though it's empty.
11419
11420Tests
11421-----
11422
11423- Call os.waitpid() at the end of tests that spawn child processes in order
11424 to minimize resources (zombies).
11425
11426Documentation
11427-------------
11428
11429- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
11430 documentation for the warnings module.
11431
11432- Patch #1509163: MS Toolkit Compiler no longer available.
11433
11434- Patch #1504046: Add documentation for xml.etree.
11435
11436
11437What's New in Python 2.5 beta 1?
11438================================
11439
11440*Release date: 20-JUN-2006*
11441
11442Core and builtins
11443-----------------
11444
11445- Patch #1507676: Error messages returned by invalid abstract object operations
11446 (such as iterating over an integer) have been improved and now include the
11447 type of the offending object to help with debugging.
11448
11449- Bug #992017: A classic class that defined a __coerce__() method that returned
11450 its arguments swapped would infinitely recurse and segfault the interpreter.
11451
11452- Fix the socket tests so they can be run concurrently.
11453
11454- Removed 5 integers from C frame objects (PyFrameObject).
11455 f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
11456
11457- Bug #532646: object.__call__() will continue looking for the __call__
11458 attribute on objects until one without one is found. This leads to recursion
11459 when you take a class and set its __call__ attribute to an instance of the
11460 class. Originally fixed for classic classes, but this fix is for new-style.
11461 Removes the infinite_rec_3 crasher.
11462
11463- The string and unicode methods startswith() and endswith() now accept
11464 a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
11465
11466- Buffer objects, at the C level, never used the char buffer
11467 implementation even when the char buffer for the wrapped object was
11468 explicitly requested (originally returned the read or write buffer).
11469 Now a TypeError is raised if the char buffer is not present but is
11470 requested.
11471
11472- Patch #1346214: Statements like "if 0: suite" are now again optimized
11473 away like they were in Python 2.4.
11474
11475- Builtin exceptions are now full-blown new-style classes instead of
11476 instances pretending to be classes, which speeds up exception handling
11477 by about 80% in comparison to 2.5a2.
11478
11479- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
11480 Unicode 4.1.
11481
11482- Patch #921466: sys.path_importer_cache is now used to cache valid and
11483 invalid file paths for the built-in import machinery which leads to
11484 fewer open calls on startup.
11485
11486- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
11487 of-2 bases. The largest speedup is for inputs with about 1000 decimal
11488 digits. Conversion from non-power-of-2 bases remains quadratic-time in
11489 the number of input digits (it was and remains linear-time for bases
11490 2, 4, 8, 16 and 32).
11491
11492- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
11493 when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
11494 an integer close to ``sys.maxint``. This was repaired by patch
11495 #1335972, which also gives a nice speedup.
11496
11497- Patch #1337051: reduced size of frame objects.
11498
11499- PyErr_NewException now accepts a tuple of base classes as its
11500 "base" parameter.
11501
11502- Patch #876206: function call speedup by retaining allocated frame
11503 objects.
11504
11505- Bug #1462152: file() now checks more thoroughly for invalid mode
11506 strings and removes a possible "U" before passing the mode to the
11507 C library function.
11508
11509- Patch #1488312, Fix memory alignment problem on SPARC in unicode
11510
11511- Bug #1487966: Fix SystemError with conditional expression in assignment
11512
11513- WindowsError now has two error code attributes: errno, which carries
11514 the error values from errno.h, and winerror, which carries the error
11515 values from winerror.h. Previous versions put the winerror.h values
11516 (from GetLastError()) into the errno attribute.
11517
11518- Patch #1475845: Raise IndentationError for unexpected indent.
11519
11520- Patch #1479181: split open() and file() from being aliases for each other.
11521
11522- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
11523 methods were always silently ignored by dictionaries when comparing keys.
11524 They are now passed through (except when using the C API function
11525 ``PyDict_GetItem()``, whose semantics did not change).
11526
11527- Bug #1456209: In some obscure cases it was possible for a class with a
11528 custom ``__eq__()`` method to confuse dict internals when class instances
11529 were used as a dict's keys and the ``__eq__()`` method mutated the dict.
11530 No, you don't have any code that did this ;-)
11531
11532Extension Modules
11533-----------------
11534
11535- Bug #1295808: expat symbols should be namespaced in pyexpat
11536
11537- Patch #1462338: Upgrade pyexpat to expat 2.0.0
11538
11539- Change binascii.hexlify to accept a read-only buffer instead of only a char
11540 buffer and actually follow its documentation.
11541
11542- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
11543
11544- Patch #1478788 (modified version): The functional extension module has
11545 been renamed to _functools and a functools Python wrapper module added.
11546 This provides a home for additional function related utilities that are
11547 not specifically about functional programming. See PEP 309.
11548
11549- Patch #1493701: performance enhancements for struct module.
11550
11551- Patch #1490224: time.altzone is now set correctly on Cygwin.
11552
11553- Patch #1435422: zlib's compress and decompress objects now have a
11554 copy() method.
11555
11556- Patch #1454481: thread stack size is now tunable at runtime for thread
11557 enabled builds on Windows and systems with Posix threads support.
11558
11559- On Win32, os.listdir now supports arbitrarily-long Unicode path names
11560 (up to the system limit of 32K characters).
11561
11562- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
11563 As a result, these functions now raise WindowsError instead of OSError.
11564
11565- ``time.clock()`` on Win64 should use the high-performance Windows
11566 ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
11567 Windows platforms).
11568
11569- Calling Tk_Init twice is refused if the first call failed as that
11570 may deadlock.
11571
11572- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
11573 accept it without potentially using an uninitialized pointer.
11574
11575- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
11576 assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
11577 patch numbers 1494885 and 1494902]
11578
11579- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
11580 [pybsddb project SF patch number 1466734]
11581
11582- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
11583 parameter is supplied. [SF pybsddb bug #1477863]
11584
11585- bsddb: the __len__ method of a DB object has been fixed to return correct
11586 results. It could previously incorrectly return 0 in some cases.
11587 Fixes SF bug 1493322 (pybsddb bug 1184012).
11588
11589- bsddb: the bsddb.dbtables Modify method now raises the proper error and
11590 aborts the db transaction safely when a modifier callback fails.
11591 Fixes SF python patch/bug #1408584.
11592
11593- bsddb: multithreaded DB access using the simple bsddb module interface
11594 now works reliably. It has been updated to use automatic BerkeleyDB
11595 deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
11596 database calls that would previously deadlock. [SF python bug #775414]
11597
11598- Patch #1446489: add support for the ZIP64 extensions to zipfile.
11599
11600- Patch #1506645: add Python wrappers for the curses functions
11601 is_term_resized, resize_term and resizeterm.
11602
11603Library
11604-------
11605
11606- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
11607 functions.
11608
11609- Patch #812986: Update turtle output even if not tracing.
11610
11611- Patch #1494750: Destroy master after deleting children in
11612 Tkinter.BaseWidget.
11613
11614- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
11615
11616- Patch #763580: Add name and value arguments to Tkinter variable
11617 classes.
11618
11619- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
11620 mime.types file for determining MIME types.
11621
11622- Bug #1339007: Shelf objects now don't raise an exception in their
11623 __del__ method when initialization failed.
11624
11625- Patch #1455898: The MBCS codec now supports the incremental mode for
11626 double-byte encodings.
11627
11628- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
11629 guarantee that adjacent triples in the return list always describe
11630 non-adjacent blocks. Previously, a pair of matching blocks could end
11631 up being described by multiple adjacent triples that formed a partition
11632 of the matching pair.
11633
11634- Bug #1498146: fix optparse to handle Unicode strings in option help,
11635 description, and epilog.
11636
11637- Bug #1366250: minor optparse documentation error.
11638
11639- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
11640 clarify docs.
11641
11642- The wsgiref package has been added to the standard library.
11643
11644- The functions update_wrapper() and wraps() have been added to the functools
11645 module. These make it easier to copy relevant metadata from the original
11646 function when writing wrapper functions.
11647
11648- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
11649 ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
11650
11651- Patch #1359618: Speed up charmap encoder by using a trie structure
11652 for lookup.
11653
11654- The functions in the ``pprint`` module now sort dictionaries by key
11655 before computing the display. Before 2.5, ``pprint`` sorted a dictionary
11656 if and only if its display required more than one line, although that
11657 wasn't documented. The new behavior increases predictability; e.g.,
11658 using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
11659
11660- Patch #1497027: try HTTP digest auth before basic auth in urllib2
11661 (thanks for J. J. Lee).
11662
11663- Patch #1496206: improve urllib2 handling of passwords with respect to
11664 default HTTP and HTTPS ports.
11665
11666- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
11667
11668- Patch #1281707: speed up gzip.readline.
11669
11670- Patch #1180296: Two new functions were added to the locale module:
11671 format_string() to get the effect of "format % items" but locale-aware,
11672 and currency() to format a monetary number with currency sign.
11673
11674- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
11675 and several features added, such as speed and geometry control.
11676
11677- Patch #1488881: add support for external file objects in bz2 compressed
11678 tarfiles.
11679
11680- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
11681 stdout arguments, making it possible to redirect input and output
11682 for remote debugging.
11683
11684- Patch #1484695: Update the tarfile module to version 0.8. This fixes
11685 a couple of issues, notably handling of long file names using the
11686 GNU LONGNAME extension.
11687
11688- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
11689 new flag when ``name`` is already the name of an option flag.
11690
11691- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
11692 package.
11693
11694- Patch #1472854: make the rlcompleter.Completer class usable on non-
11695 UNIX platforms.
11696
11697- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
11698
11699- Bug #1472827: correctly escape newlines and tabs in attribute values in
11700 the saxutils.XMLGenerator class.
11701
11702
11703Build
11704-----
11705
11706- Bug #1502728: Correctly link against librt library on HP-UX.
11707
11708- OpenBSD 3.9 is supported now.
11709
11710- Patch #1492356: Port to Windows CE.
11711
11712- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
11713
11714- Patch #1471883: Add --enable-universalsdk.
11715
11716C API
11717-----
11718
11719Tests
11720-----
11721
11722Tools
11723-----
11724
11725Documentation
11726-------------
11727
11728
11729
11730What's New in Python 2.5 alpha 2?
11731=================================
11732
11733*Release date: 27-APR-2006*
11734
11735Core and builtins
11736-----------------
11737
11738- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
11739 by converting these apis from macros into exported functions again:
11740
11741 PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
11742 PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
11743 PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
11744 PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
11745 PyRun_String Py_CompileString
11746
11747- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
11748
11749- All uses of PyStructSequence_InitType have been changed to initialize
11750 the type objects only once, even if the interpreter is initialized
11751 multiple times.
11752
11753- Bug #1454485, array.array('u') could crash the interpreter. This was
11754 due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
11755 to unicode when it didn't make sense. 'u#' now requires a unicode string.
11756
11757- Py_UNICODE is unsigned. It was always documented as unsigned, but
11758 due to a bug had a signed value in previous versions.
11759
11760- Patch #837242: ``id()`` of any Python object always gives a positive
11761 number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
11762 ``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
11763 never been correct to implement a ``__hash()__`` method that returns the
11764 ``id()`` of an object:
11765
11766 def __hash__(self):
11767 return id(self) # WRONG
11768
11769 because a hash result must be a (short) Python int but it was always
11770 possible for ``id()`` to return a Python long. However, because ``id()``
11771 could return negative values before, on a 32-bit box an ``id()`` result
11772 was always usable as a hash value before this patch. That's no longer
11773 necessarily so.
11774
11775- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
11776 to load extension modules and now provides the dl module. As a result,
11777 sys.setdlopenflags() now works correctly on these systems. (SF patch
11778 #1454844)
11779
11780- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
11781 involving generators that have paused outside of any ``try`` or ``with``
11782 blocks. (In 2.5a1, a paused generator that was part of a reference
11783 cycle could not be garbage collected, regardless of whether it was
11784 paused in a ``try`` or ``with`` block.)
11785
11786Extension Modules
11787-----------------
11788
11789- Patch #1191065: Fix preprocessor problems on systems where recvfrom
11790 is a macro.
11791
11792- Bug #1467952: os.listdir() now correctly raises an error if readdir()
11793 fails with an error condition.
11794
11795- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
11796
11797- Bug #1117761: bsddb.*open() no longer raises an exception when using
11798 the cachesize parameter.
11799
11800- Bug #1149413: bsddb.*open() no longer raises an exception when using
11801 a temporary db (file=None) with the 'n' flag to truncate on open.
11802
11803- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
11804 as older versions cause excessive test failures.
11805
11806- Patch #1062014: AF_UNIX sockets under Linux have a special
11807 abstract namespace that is now fully supported.
11808
11809Library
11810-------
11811
11812- Bug #1223937: subprocess.CalledProcessError reports the exit status
11813 of the process using the returncode attribute, instead of
11814 abusing errno.
11815
11816- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
11817 a doctest to be skipped (the code is not run, and the expected output
11818 or exception is ignored).
11819
11820- Fixed contextlib.nested to cope with exceptions being raised and
11821 caught inside exit handlers.
11822
11823- Updated optparse module to Optik 1.5.1 (allow numeric constants in
11824 hex, octal, or binary; add ``append_const`` action; keep going if
11825 gettext cannot be imported; added ``OptionParser.destroy()`` method;
11826 added ``epilog`` for better help generation).
11827
11828- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
11829 called from a thread spawned as a side effect of importing a module.
11830
11831- The pydoc module now supports documenting packages contained in
11832 .zip or .egg files.
11833
11834- The pkgutil module now has several new utility functions, such
11835 as ``walk_packages()`` to support working with packages that are either
11836 in the filesystem or zip files.
11837
11838- The mailbox module can now modify and delete messages from
11839 mailboxes, in addition to simply reading them. Thanks to Gregory
11840 K. Johnson for writing the code, and to the 2005 Google Summer of
11841 Code for funding his work.
11842
11843- The ``__del__`` method of class ``local`` in module ``_threading_local``
11844 returned before accomplishing any of its intended cleanup.
11845
11846- Patch #790710: Add breakpoint command lists in pdb.
11847
11848- Patch #1063914: Add Tkinter.Misc.clipboard_get().
11849
11850- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
11851
11852- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
11853 Windows. Bug #1469163.
11854
11855- The warnings, linecache, inspect, traceback, site, and doctest modules
11856 were updated to work correctly with modules imported from zipfiles or
11857 via other PEP 302 __loader__ objects.
11858
11859- Patch #1467770: Reduce usage of subprocess._active to processes which
11860 the application hasn't waited on.
11861
11862- Patch #1462222: Fix Tix.Grid.
11863
11864- Fix exception when doing glob.glob('anything*/')
11865
11866- The pstats.Stats class accepts an optional stream keyword argument to
11867 direct output to an alternate file-like object.
11868
11869Build
11870-----
11871
11872- The Makefile now has a reindent target, which runs reindent.py on
11873 the library.
11874
11875- Patch #1470875: Building Python with MS Free Compiler
11876
11877- Patch #1161914: Add a python-config script.
11878
11879- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
11880 --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
11881 specified. (Can be overridden by explicitly setting LINKCC.) Decouple
11882 CXX from --with-cxx-main, see description in README.
11883
11884- Patch #1429775: Link extension modules with the shared libpython.
11885
11886- Fixed a libffi build problem on MIPS systems.
11887
11888- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
11889 now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
11890 and "%zu" for unsigned integers of type ``size_t``.
11891
11892Tests
11893-----
11894
11895- test_contextlib now checks contextlib.nested can cope with exceptions
11896 being raised and caught inside exit handlers.
11897
11898- test_cmd_line now checks operation of the -m and -c command switches
11899
11900- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
11901 it separately and by hand. It also wasn't cleaning up its changes to
11902 the current Decimal context.
11903
11904- regrtest.py now has a -M option to run tests that test the new limits of
11905 containers, on 64-bit architectures. Running these tests is only sensible
11906 on 64-bit machines with more than two gigabytes of memory. The argument
11907 passed is the maximum amount of memory for the tests to use.
11908
11909Tools
11910-----
11911
11912- Added the Python benchmark suite pybench to the Tools/ directory;
11913 contributed by Marc-Andre Lemburg.
11914
11915Documentation
11916-------------
11917
11918- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
11919
11920- PEP 343: Added Context Types section to the library reference
11921 and attempted to bring other PEP 343 related documentation into
11922 line with the implementation and/or python-dev discussions.
11923
11924- Bug #1337990: clarified that ``doctest`` does not support examples
11925 requiring both expected output and an exception.
11926
11927
11928What's New in Python 2.5 alpha 1?
11929=================================
11930
11931*Release date: 05-APR-2006*
11932
11933Core and builtins
11934-----------------
11935
11936- PEP 338: -m command line switch now delegates to runpy.run_module
11937 allowing it to support modules in packages and zipfiles
11938
11939- On Windows, .DLL is not an accepted file name extension for
11940 extension modules anymore; extensions are only found if they
11941 end in .PYD.
11942
11943- Bug #1421664: sys.stderr.encoding is now set to the same value as
11944 sys.stdout.encoding.
11945
11946- __import__ accepts keyword arguments.
11947
11948- Patch #1460496: round() now accepts keyword arguments.
11949
11950- Fixed bug #1459029 - unicode reprs were double-escaped.
11951
11952- Patch #1396919: The system scope threads are reenabled on FreeBSD
11953 5.4 and later versions.
11954
11955- Bug #1115379: Compiling a Unicode string with an encoding declaration
11956 now gives a SyntaxError.
11957
11958- Previously, Python code had no easy way to access the contents of a
11959 cell object. Now, a ``cell_contents`` attribute has been added
11960 (closes patch #1170323).
11961
11962- Patch #1123430: Python's small-object allocator now returns an arena to
11963 the system ``free()`` when all memory within an arena becomes unused
11964 again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
11965 freed. Some applications will see a drop in virtual memory size now,
11966 especially long-running applications that, from time to time, temporarily
11967 use a large number of small objects. Note that when Python returns an
11968 arena to the platform C's ``free()``, there's no guarantee that the
11969 platform C library will in turn return that memory to the operating system.
11970 The effect of the patch is to stop making that impossible, and in tests it
11971 appears to be effective at least on Microsoft C and gcc-based systems.
11972 Thanks to Evan Jones for hard work and patience.
11973
11974- Patch #1434038: property() now uses the getter's docstring if there is
11975 no "doc" argument given. This makes it possible to legitimately use
11976 property() as a decorator to produce a read-only property.
11977
11978- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
11979 nb_index slot to the PyNumberMethods struct. The slot is consulted instead
11980 of requiring an int or long in slicing and a few other contexts, enabling
11981 other objects (e.g. Numeric Python's integers) to be used as slice indices.
11982
11983- Fixed various bugs reported by Coverity's Prevent tool.
11984
11985- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
11986 new exception base class, BaseException, which has a new message attribute.
11987 KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
11988 Raising a string exception now raises a DeprecationWarning.
11989
11990- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
11991 explicitly relative, using 'from .module import name' to mean 'from the same
11992 package as this module is in. Imports without dots still default to the
11993 old relative-then-absolute, unless 'from __future__ import
11994 absolute_import' is used.
11995
11996- Properly check if 'warnings' raises an exception (usually when a filter set
11997 to "error" is triggered) when raising a warning for raising string
11998 exceptions.
11999
12000- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
12001 The name was removed from Include/code.h.
12002
12003- PEP 308: conditional expressions were added: (x if cond else y).
12004
12005- Patch 1433928:
12006 - The copy module now "copies" function objects (as atomic objects).
12007 - dict.__getitem__ now looks for a __missing__ hook before raising
12008 KeyError.
12009
12010- PEP 343: with statement implemented. Needs ``from __future__ import
12011 with_statement``. Use of 'with' as a variable will generate a warning.
12012 Use of 'as' as a variable will also generate a warning (unless it's
12013 part of an import statement).
12014 The following objects have __context__ methods:
12015 - The built-in file type.
12016 - The thread.LockType type.
12017 - The following types defined by the threading module:
12018 Lock, RLock, Condition, Semaphore, BoundedSemaphore.
12019 - The decimal.Context class.
12020
12021- Fix the encodings package codec search function to only search
12022 inside its own package. Fixes problem reported in patch #1433198.
12023
12024 Note: Codec packages should implement and register their own
12025 codec search function. PEP 100 has the details.
12026
12027- PEP 353: Using ``Py_ssize_t`` as the index type.
12028
12029- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
12030 info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
12031 now allow Python to make use of memory blocks exceeding 2**32 bytes for
12032 some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
12033 to 4-byte allocations before.
12034
12035- Patch #1400181, fix unicode string formatting to not use the locale.
12036 This is how string objects work. u'%f' could use , instead of .
12037 for the decimal point. Now both strings and unicode always use periods.
12038
12039- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
12040 configure would break checking curses.h.
12041
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012042- Bug #959576: The pwd module is now built in. This allows Python to be
Christian Heimesc3f30c42008-02-22 16:37:40 +000012043 built on UNIX platforms without $HOME set.
12044
12045- Bug #1072182, fix some potential problems if characters are signed.
12046
12047- Bug #889500, fix line number on SyntaxWarning for global declarations.
12048
12049- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
12050
12051- Support for converting hex strings to floats no longer works.
12052 This was not portable. float('0x3') now raises a ValueError.
12053
12054- Patch #1382163: Expose Subversion revision number to Python. New C API
12055 function Py_GetBuildNumber(). New attribute sys.subversion. Build number
12056 is now displayed in interactive prompt banner.
12057
12058- Implementation of PEP 341 - Unification of try/except and try/finally.
12059 "except" clauses can now be written together with a "finally" clause in
12060 one try statement instead of two nested ones. Patch #1355913.
12061
12062- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
12063 now encodes backslash correctly.
12064
12065- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
12066
12067- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
12068 and long longs.
12069
12070- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
12071 It was possible for dlerror() to return a NULL pointer, so
12072 it will now use a default error message in this case.
12073
12074- Replaced most Unicode charmap codecs with new ones using the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012075 new Unicode translate string feature in the built-in charmap
Christian Heimesc3f30c42008-02-22 16:37:40 +000012076 codec; the codecs were created from the mapping tables available
12077 at ftp.unicode.org and contain a few updates (e.g. the Mac OS
12078 encodings now include a mapping for the Apple logo)
12079
12080- Added a few more codecs for Mac OS encodings
12081
12082- Sped up some Unicode operations.
12083
12084- A new AST parser implementation was completed. The abstract
12085 syntax tree is available for read-only (non-compile) access
12086 to Python code; an _ast module was added.
12087
12088- SF bug #1167751: fix incorrect code being produced for generator expressions.
12089 The following code now raises a SyntaxError: foo(a = i for i in range(10))
12090
12091- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
12092
12093- SF Bug #887946: fix segfault when redirecting stdin from a directory.
12094 Provide a warning when a directory is passed on the command line.
12095
12096- Fix segfault with invalid coding.
12097
12098- SF bug #772896: unknown encoding results in MemoryError.
12099
12100- All iterators now have a Boolean value of True. Formerly, some iterators
12101 supported a __len__() method which evaluated to False when the iterator
12102 was empty.
12103
12104- On 64-bit platforms, when __len__() returns a value that cannot be
12105 represented as a C int, raise OverflowError.
12106
12107- test__locale is skipped on OS X < 10.4 (only partial locale support is
12108 present).
12109
12110- SF bug #893549: parsing keyword arguments was broken with a few format
12111 codes.
12112
12113- Changes donated by Elemental Security to make it work on AIX 5.3
12114 with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
12115 bug #105470: test_pwd fails on 64bit system (Opteron).
12116
12117- Changes donated by Elemental Security to make it work on HP-UX 11 on
12118 Itanium2 with HP's 64-bit compiler (SF patch #1225212).
12119
12120- Disallow keyword arguments for type constructors that don't use them
12121 (fixes bug #1119418).
12122
12123- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
12124
12125- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
12126 exceptions that cause a function to exit.
12127
12128- The implementation of set() and frozenset() was revised to use its
12129 own internal data structure. Memory consumption is reduced by 1/3
12130 and there are modest speed-ups as well. The API is unchanged.
12131
12132- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
12133
12134- SF bug #1229429: PyObject_CallMethod failed to decrement some
12135 reference counts in some error exit cases.
12136
12137- SF bug #1185883: Python's small-object memory allocator took over
12138 a block managed by the platform C library whenever a realloc specified
12139 a small new size. However, there's no portable way to know then how
12140 much of the address space following the pointer is valid, so there's no
12141 portable way to copy data from the C-managed block into Python's
12142 small-object space without risking a memory fault. Python's small-object
12143 realloc now leaves such blocks under the control of the platform C
12144 realloc.
12145
12146- SF bug #1232517: An overflow error was not detected properly when
12147 attempting to convert a large float to an int in os.utime().
12148
12149- SF bug #1224347: hex longs now print with lowercase letters just
12150 like their int counterparts.
12151
12152- SF bug #1163563: the original fix for bug #1010677 ("thread Module
12153 Breaks PyGILState_Ensure()") broke badly in the case of multiple
12154 interpreter states; back out that fix and do a better job (see
12155 http://mail.python.org/pipermail/python-dev/2005-June/054258.html
12156 for a longer write-up of the problem).
12157
12158- SF patch #1180995: marshal now uses a binary format by default when
12159 serializing floats.
12160
12161- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
12162 the routines that promise to produce IEEE 754 binary representations
12163 of floats now simply copy bytes around.
12164
12165- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
12166 278.
12167
12168- patch #1109424: int, long, float, complex, and unicode now check for the
12169 proper magic slot for type conversions when subclassed. Previously the
12170 magic slot was ignored during conversion. Semantics now match the way
12171 subclasses of str always behaved. int/long/float, conversion of an instance
12172 to the base class has been moved to the proper nb_* magic slot and out of
12173 PyNumber_*().
Antoine Pitroufbd4f802012-08-11 16:51:50 +020012174 Thanks Walter Dörwald.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012175
12176- Descriptors defined in C with a PyGetSetDef structure, where the setter is
12177 NULL, now raise an AttributeError when attempting to set or delete the
12178 attribute. Previously a TypeError was raised, but this was inconsistent
12179 with the equivalent pure-Python implementation.
12180
12181- It is now safe to call PyGILState_Release() before
12182 PyEval_InitThreads() (note that if there is reason to believe there
12183 are multiple threads around you still must call PyEval_InitThreads()
12184 before using the Python API; this fix is for extension modules that
12185 have no way of knowing if Python is multi-threaded yet).
12186
12187- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
12188 disabled caused a crash.
12189
12190- Bug #1165306: instancemethod_new allowed the creation of a method
12191 with im_class == im_self == NULL, which caused a crash when called.
12192
12193- Move exception finalisation later in the shutdown process - this
12194 fixes the crash seen in bug #1165761
12195
12196- Added two new builtins, any() and all().
12197
12198- Defining a class with empty parentheses is now allowed
12199 (e.g., ``class C(): pass`` is no longer a syntax error).
12200 Patch #1176012 added support to the 'parser' module and 'compiler' package
12201 (thanks to logistix for that added support).
12202
12203- Patch #1115086: Support PY_LONGLONG in structmember.
12204
12205- Bug #1155938: new style classes did not check that __init__() was
12206 returning None.
12207
12208- Patch #802188: Report characters after line continuation character
12209 ('\') with a specific error message.
12210
12211- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
12212
12213- Bug #1124295: the __name__ attribute of file objects was
12214 inadvertently made inaccessible in restricted mode.
12215
12216- Bug #1074011: closing sys.std{out,err} now causes a flush() and
12217 an ferror() call.
12218
12219- min() and max() now support key= arguments with the same meaning as in
12220 list.sort().
12221
12222- The peephole optimizer now performs simple constant folding in expressions:
12223 (2+3) --> (5).
12224
12225- set and frozenset objects can now be marshalled. SF #1098985.
12226
12227- Bug #1077106: Poor argument checking could cause memory corruption
12228 in calls to os.read().
12229
12230- The parser did not complain about future statements in illegal
12231 positions. It once again reports a syntax error if a future
12232 statement occurs after anything other than a doc string.
12233
12234- Change the %s format specifier for str objects so that it returns a
12235 unicode instance if the argument is not an instance of basestring and
12236 calling __str__ on the argument returns a unicode instance.
12237
12238- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
12239 current thread state when the auto-GIL-state machinery knows about
12240 it (since the thread state is being deleted, continuing to remember it
12241 can't help, but can hurt if another thread happens to get created with
12242 the same thread id).
12243
12244Extension Modules
12245-----------------
12246
12247- Patch #1380952: fix SSL objects timing out on consecutive read()s
12248
12249- Patch #1309579: wait3 and wait4 were added to the posix module.
12250
12251- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
12252 In addition, the existing ulaw code was updated.
12253
12254- RFE #567972: Socket objects' family, type and proto properties are
12255 now exposed via new attributes.
12256
12257- Everything under lib-old was removed. This includes the following modules:
12258 Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
12259 lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
12260 util, whatsound, whrandom, zmod
12261
12262- The following modules were removed: regsub, reconvert, regex, regex_syntax.
12263
12264- re and sre were swapped, so help(re) provides full help. importing sre
12265 is deprecated. The undocumented re.engine variable no longer exists.
12266
12267- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
12268 SS2 (single-shift 2) escape sequences correctly.
12269
12270- The unicodedata module was updated to the 4.1 version of the Unicode
12271 database. The 3.2 version is still available as unicodedata.db_3_2_0
12272 for applications that require this specific version (such as IDNA).
12273
12274- The timing module is no longer built by default. It was deprecated
12275 in PEP 4 in Python 2.0 or earlier.
12276
12277- Patch 1433928: Added a new type, defaultdict, to the collections module.
12278 This uses the new __missing__ hook behavior added to dict (see above).
12279
12280- Bug #854823: socketmodule now builds on Sun platforms even when
12281 INET_ADDRSTRLEN is not defined.
12282
12283- Patch #1393157: os.startfile() now has an optional argument to specify
12284 a "command verb" to invoke on the file.
12285
12286- Bug #876637, prevent stack corruption when socket descriptor
12287 is larger than FD_SETSIZE.
12288
12289- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
12290 mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
12291 mmap.mmap(0, size) should not be used on Windows for anonymous memory.
12292
12293- Patch #1422385: The nis module now supports access to domains other
12294 than the system default domain.
12295
12296- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
12297 are reported, the limit on path name lengths is removed, and stat reports
12298 WindowsError now (instead of OSError).
12299
12300- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
12301
12302- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
12303 before the env.
12304
12305- Patch #1103116: Basic AF_NETLINK support.
12306
12307- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
12308
12309- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
12310 Also fix ungetmouse() which did not accept arguments properly.
12311 The code now conforms to the documented signature.
12312
12313- Bug #1400115, Fix segfault when calling curses.panel.userptr()
12314 without prior setting of the userptr.
12315
12316- Fix 64-bit problems in bsddb.
12317
12318- Patch #1365916: fix some unsafe 64-bit mmap methods.
12319
12320- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
12321 problem on AIX.
12322
12323- Bug #869197: os.setgroups rejects long integer arguments
12324
12325- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
12326
12327- Bug #1344508, Fix UNIX mmap leaking file descriptors
12328
12329- Patch #1338314, Bug #1336623: fix tarfile so it can extract
12330 REGTYPE directories from tarfiles written by old programs.
12331
12332- Patch #1407992, fixes broken bsddb module db associate when using
12333 BerkeleyDB 3.3, 4.0 or 4.1.
12334
12335- Get bsddb module to build with BerkeleyDB version 4.4
12336
12337- Get bsddb module to build with BerkeleyDB version 3.2
12338
12339- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
12340 but Python incorrectly assumes it is in UTF-8 format
12341
12342- Fix parse errors in the readline module when compiling without threads.
12343
12344- Patch #1288833: Removed thread lock from socket.getaddrinfo on
12345 FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
12346
12347- Patches #1298449 and #1298499: Add some missing checks for error
12348 returns in cStringIO.c.
12349
12350- Patch #1297028: fix segfault if call type on MultibyteCodec,
12351 MultibyteStreamReader, or MultibyteStreamWriter
12352
12353- Fix memory leak in posix.access().
12354
12355- Patch #1213831: Fix typo in unicodedata._getcode.
12356
12357- Bug #1007046: os.startfile() did not accept unicode strings encoded in
12358 the file system encoding.
12359
12360- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
12361 platforms that don't have inet_aton().
12362
12363- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
12364
12365- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
12366 line without newlines.
12367
12368- Bug #728515: mmap.resize() now resizes the file on Unix as it did
12369 on Windows.
12370
12371- Patch #1180695: Add nanosecond stat resolution, and st_gen,
12372 st_birthtime for FreeBSD.
12373
12374- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
12375 the request code argument, which results in more C-like behaviour
12376 for large or negative values.
12377
12378- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
12379 implementation treated all integer values except 1 as false.
12380
12381- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
12382
12383- Patch #1212117: os.stat().st_flags is now accessible as a attribute
12384 if available on the platform.
12385
12386- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
12387 available on the platform.
12388
12389- Bug #1166660: The readline module could segfault if hook functions
12390 were set in a different thread than that which called readline.
12391
12392- collections.deque objects now support a remove() method.
12393
12394- operator.itemgetter() and operator.attrgetter() now support retrieving
12395 multiple fields. This provides direct support for sorting on multiple
12396 keys (primary, secondary, etc).
12397
12398- os.access now supports Unicode path names on non-Win32 systems.
12399
12400- Patches #925152, #1118602: Avoid reading after the end of the buffer
12401 in pyexpat.GetInputContext.
12402
12403- Patches #749830, #1144555: allow UNIX mmap size to default to current
12404 file size.
12405
12406- Added functional.partial(). See PEP309.
12407
12408- Patch #1093585: raise a ValueError for negative history items in readline.
12409 {remove_history,replace_history}
12410
12411- The spwd module has been added, allowing access to the shadow password
12412 database.
12413
12414- stat_float_times is now True.
12415
12416- array.array objects are now picklable.
12417
12418- the cPickle module no longer accepts the deprecated None option in the
12419 args tuple returned by __reduce__().
12420
12421- itertools.islice() now accepts None for the start and step arguments.
12422 This allows islice() to work more readily with slices:
12423 islice(s.start, s.stop, s.step)
12424
12425- datetime.datetime() now has a strptime class method which can be used to
12426 create datetime object using a string and format.
12427
12428- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
12429 with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
12430
12431Library
12432-------
12433
12434- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
12435 been renamed to have only a single underscore prefix. This was done to
12436 make subclassing easier.
12437
12438- PEP 338: new module runpy defines a run_module function to support
12439 executing modules which provide access to source code or a code object
12440 via the PEP 302 import mechanisms.
12441
12442- The email module's parsedate_tz function now sets the daylight savings
12443 flag to -1 (unknown) since it can't tell from the date whether it should
12444 be set.
12445
12446- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
12447 now sport attributes that provide access to the parts of the result.
12448
12449- Patch #1462498: sgmllib now handles entity and character references
12450 in attribute values.
12451
12452- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
12453 a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
12454 later to build this - if you have an earlier version, the C extension
12455 module will not be built.
12456
12457- Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
12458 aren't officially supported here, and trying to use them will probably
12459 raise an exception some day. But dicts have been allowed, and "mostly
12460 worked", so support for them won't go away without warning.
12461
12462- Bug #1445068: getpass.getpass() can now be given an explicit stream
12463 argument to specify where to write the prompt.
12464
12465- Patch #1462313, bug #1443328: the pickle modules now can handle classes
12466 that have __private names in their __slots__.
12467
12468- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
12469
12470- patch #1457316: "setup.py upload" now supports --identity to select the
12471 key to be used for signing the uploaded code.
12472
12473- Queue.Queue objects now support .task_done() and .join() methods
12474 to make it easier to monitor when daemon threads have completed
12475 processing all enqueued tasks. Patch #1455676.
12476
12477- popen2.Popen objects now preserve the command in a .cmd attribute.
12478
12479- Added the ctypes ffi package.
12480
12481- email 4.0 package now integrated. This is largely the same as the email 3.0
12482 package that was included in Python 2.3, except that PEP 8 module names are
12483 now used (e.g. mail.message instead of email.Message). The MIME classes
12484 have been moved to a subpackage (e.g. email.mime.text instead of
12485 email.MIMEText). The old names are still supported for now. Several
12486 deprecated Message methods have been removed and lots of bugs have been
12487 fixed. More details can be found in the email package documentation.
12488
12489- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
12490 (a subclass of tuple) that provides incremental decoders and encoders
12491 (a way to use stateful codecs without the stream API). Python functions
12492 codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
12493 as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
12494 have been added.
12495
12496- Patch #1359365: Calling next() on a closed StringIO.String object raises
12497 a ValueError instead of a StopIteration now (like file and cString.String do).
12498 cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
12499 called before (like file and StringIO.StringIO do).
12500
12501- A regrtest option -w was added to re-run failed tests in verbose mode.
12502
12503- Patch #1446372: quit and exit can now be called from the interactive
12504 interpreter to exit.
12505
12506- The function get_count() has been added to the gc module, and gc.collect()
12507 grew an optional 'generation' argument.
12508
12509- A library msilib to generate Windows Installer files, and a distutils
12510 command bdist_msi have been added.
12511
12512- PEP 343: new module contextlib.py defines decorator @contextmanager
12513 and helpful context managers nested() and closing().
12514
12515- The compiler package now supports future imports after the module docstring.
12516
12517- Bug #1413790: zipfile now sanitizes absolute archive names that are
12518 not allowed by the specs.
12519
12520- Patch #1215184: FileInput now can be given an opening hook which can
12521 be used to control how files are opened.
12522
12523- Patch #1212287: fileinput.input() now has a mode parameter for
12524 specifying the file mode input files should be opened with.
12525
12526- Patch #1215184: fileinput now has a fileno() function for getting the
12527 current file number.
12528
12529- Patch #1349274: gettext.install() now optionally installs additional
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012530 translation functions other than _() in the builtins namespace.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012531
12532- Patch #1337756: fileinput now accepts Unicode filenames.
12533
12534- Patch #1373643: The chunk module can now read chunks larger than
12535 two gigabytes.
12536
12537- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
12538
12539- Bug #1430298: It is now possible to send a mail with an empty
12540 return address using smtplib.
12541
12542- Bug #1432260: The names of lambda functions are now properly displayed
12543 in pydoc.
12544
12545- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
12546 unless the system is Win32.
12547
12548- Patch #1349118: urllib now supports user:pass@ style proxy
12549 specifications, raises IOErrors when proxies for unsupported protocols
12550 are defined, and uses the https proxy on https redirections.
12551
12552- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
12553
12554- Bug #1407902: Add support for sftp:// URIs to urlparse.
12555
12556- Bug #1371247: Update Windows locale identifiers in locale.py.
12557
12558- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
12559 any more.
12560
12561- Bug #1403410: The warnings module now doesn't get confused
12562 when it can't find out the module name it generates a warning for.
12563
12564- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
12565
12566- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
12567
12568- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
12569 LoadError as documented, instead of IOError. For compatibility,
12570 LoadError subclasses IOError.
12571
12572- Added the hashlib module. It provides secure hash functions for MD5 and
12573 SHA1, 224, 256, 384, and 512. Note that recent developments make the
12574 historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
12575 In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
12576 Ronald L. Rivest offered this advice for Python:
12577
12578 "The consensus of researchers in this area (at least as
12579 expressed at the NIST Hash Function Workshop 10/31/05),
12580 is that SHA-256 is a good choice for the time being, but
12581 that research should continue, and other alternatives may
12582 arise from this research. The larger SHA's also seem OK."
12583
12584- Added a subset of Fredrik Lundh's ElementTree package. Available
12585 modules are xml.etree.ElementTree, xml.etree.ElementPath, and
12586 xml.etree.ElementInclude, from ElementTree 1.2.6.
12587
12588- Patch #1162825: Support non-ASCII characters in IDLE window titles.
12589
12590- Bug #1365984: urllib now opens "data:" URLs again.
12591
12592- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
12593 is raised within the method itself on a previous call (e.g., passing in an
12594 illegal argument)
12595
12596- Bug #1340337: change time.strptime() to always return ValueError when there
12597 is an error in the format string.
12598
12599- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
12600
12601- Bug #729103: pydoc.py: Fix docother() method to accept additional
12602 "parent" argument.
12603
12604- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
12605 for padding.
12606
12607- Bug #1296004: httplib.py: Limit maximal amount of data read from the
12608 socket to avoid a MemoryError on Windows.
12609
12610- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
12611 to get the correct encoding.
12612
12613- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
12614 languages.
12615
12616- Patch #1268314: Cache lines in StreamReader.readlines for performance.
12617
12618- Bug #1290505: Fix clearing the regex cache for time.strptime().
12619
12620- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
12621
12622- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
12623 functionality.
12624
12625- Bug #1163178: Make IDNA return an empty string when the input is empty.
12626
12627- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
12628 separator and do not output trailing semicolon.
12629
12630- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
12631 ContentTooShortException, when the actually downloaded size does not
12632 match the Content-Length header.
12633
12634- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
12635
12636- Bug #1178484: Return complete lines from codec stream readers
12637 even if there is an exception in later lines, resulting in
12638 correct line numbers for decoding errors in source code.
12639
12640- Bug #1192315: Disallow negative arguments to clear() in pdb.
12641
12642- Patch #827386: Support absolute source paths in msvccompiler.py.
12643
12644- Patch #1105730: Apply the new implementation of commonprefix in posixpath
12645 to ntpath, macpath, os2emxpath and riscospath.
12646
12647- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
12648 __hasattr__ and __delattr__ methods on class Tk that were breaking
12649 Tkdnd.
12650
12651- Bug #1015140: disambiguated the term "article id" in nntplib docs and
12652 docstrings to either "article number" or "message id".
12653
12654- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
12655 parameter, but uses the usual "kwargs=None".
12656
12657- textwrap now processes text chunks at O(n) speed instead of O(n**2).
12658 Patch #1209527 (Contributed by Connelly).
12659
12660- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
12661 to W3C name (404 -> 'Not Found'). RFE #1216944.
12662
12663- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
12664 as this can cause problems with apps closing all file descriptors.
12665
12666- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
12667 it can be missing in embedded interpreters
12668
12669- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
12670
12671- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
12672 error messages.
12673
12674- Bug #1108948: Cookie.py produced invalid JavaScript code.
12675
12676- The tokenize module now detects and reports indentation errors.
12677 Bug #1224621.
12678
12679- The tokenize module has a new untokenize() function to support a full
12680 roundtrip from lexed tokens back to Python source code. In addition,
12681 the generate_tokens() function now accepts a callable argument that
12682 terminates by raising StopIteration.
12683
12684- Bug #1196315: fix weakref.WeakValueDictionary constructor.
12685
12686- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
12687 component of the path.
12688
12689- Patch #1120353: The xmlrpclib module provides better, more transparent,
12690 support for datetime.{datetime,date,time} objects. With use_datetime set
12691 to True, applications shouldn't have to fiddle with the DateTime wrapper
12692 class at all.
12693
12694- distutils.commands.upload was added to support uploading distribution
12695 files to PyPI.
12696
12697- distutils.commands.register now encodes the data as UTF-8 before posting
12698 them to PyPI.
12699
12700- decimal operator and comparison methods now return NotImplemented
12701 instead of raising a TypeError when interacting with other types. This
12702 allows other classes to implement __radd__ style methods and have them
12703 work as expected.
12704
12705- Bug #1163325: Decimal infinities failed to hash. Attempting to
12706 hash a NaN raised an InvalidOperation instead of a TypeError.
12707
12708- Patch #918101: Add tarfile open mode r|* for auto-detection of the
12709 stream compression; add, for symmetry reasons, r:* as a synonym of r.
12710
12711- Patch #1043890: Add extractall method to tarfile.
12712
12713- Patch #1075887: Don't require MSVC in distutils if there is nothing
12714 to build.
12715
12716- Patch #1103407: Properly deal with tarfile iterators when untarring
12717 symbolic links on Windows.
12718
12719- Patch #645894: Use getrusage for computing the time consumption in
12720 profile.py if available.
12721
12722- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
12723
12724- Patch #1117454: Remove code to special-case cookies without values
12725 in LWPCookieJar.
12726
12727- Patch #1117339: Add cookielib special name tests.
12728
12729- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
12730
12731- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
12732
12733- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
12734
12735- Patch #1104111: Alter setup.py --help and --help-commands.
12736
12737- Patch #1121234: Properly cleanup _exit and tkerror commands.
12738
12739- Patch #1049151: xdrlib now unpacks booleans as True or False.
12740
12741- Fixed bug in a NameError bug in cookielib. Patch #1116583.
12742
12743- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
12744 disables recursive traversal through instance attributes, which can
12745 be exploited in various ways.
12746
12747- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
12748 flags on the HTTP listening socket.
12749
12750- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
12751 Fixed by reading the HTTP body in chunks instead of one big socket.read().
12752
12753- Patches #893642, #1039083: add allow_none, encoding arguments to
12754 constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
12755
12756- Bug #1110478: Revert os.environ.update to do putenv again.
12757
12758- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
12759
12760- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
12761
12762- Enhancements to the csv module:
12763
12764 + Dialects are now validated by the underlying C code, better
12765 reflecting its capabilities, and improving its compliance with
12766 PEP 305.
12767 + Dialect parameter parsing has been re-implemented to improve error
12768 reporting.
12769 + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
12770 dictates.
12771 + the parser now removes the escapechar prefix from escaped characters.
12772 + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
12773 types, rather than any object that can be represented as a numeric.
12774 + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
12775 to floats.
12776 + reader now allows \r characters to be quoted (previously it only allowed
12777 \n to be quoted).
12778 + writer doublequote handling improved.
12779 + Dialect classes passed to the module are no longer instantiated by
12780 the module before being parsed (the former validation scheme required
12781 this, but the mechanism was unreliable).
12782 + The dialect registry now contains instances of the internal
12783 C-coded dialect type, rather than references to python objects.
12784 + the internal c-coded dialect type is now immutable.
12785 + register_dialect now accepts the same keyword dialect specifications
12786 as the reader and writer, allowing the user to register dialects
12787 without first creating a dialect class.
12788 + a configurable limit to the size of parsed fields has been added -
12789 previously, an unmatched quote character could result in the entire
12790 file being read into the field buffer before an error was reported.
12791 + A new module method csv.field_size_limit() has been added that sets
12792 the parser field size limit (returning the former limit). The initial
12793 limit is 128kB.
12794 + A line_num attribute has been added to the reader object, which tracks
12795 the number of lines read from the source iterator. This is not
12796 the same as the number of records returned, as records can span
12797 multiple lines.
12798 + reader and writer objects were not being registered with the cyclic-GC.
12799 This has been fixed.
12800
12801- _DummyThread objects in the threading module now delete self.__block that is
12802 inherited from _Thread since it uses up a lock allocated by 'thread'. The
12803 lock primitives tend to be limited in number and thus should not be wasted on
12804 a _DummyThread object. Fixes bug #1089632.
12805
12806- The imghdr module now detects Exif files.
12807
12808- StringIO.truncate() now correctly adjusts the size attribute.
12809 (Bug #951915).
12810
12811- locale.py now uses an updated locale alias table (built using
12812 Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
12813 alias file); the encoding lookup was enhanced to use Python's
12814 encoding alias table.
12815
12816- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
12817
12818- the pickle module no longer accepts the deprecated None option in the
12819 args tuple returned by __reduce__().
12820
12821- optparse now optionally imports gettext. This allows its use in setup.py.
12822
12823- the pickle module no longer uses the deprecated bin parameter.
12824
12825- the shelve module no longer uses the deprecated binary parameter.
12826
12827- the pstats module no longer uses the deprecated ignore() method.
12828
12829- the filecmp module no longer uses the deprecated use_statcache argument.
12830
12831- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
12832 extended or overridden by subclasses. Formerly, the subclassed method would
12833 be ignored by the rest of the module. (Bug #1078905).
12834
12835- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
12836 the same meaning as in list.sort().
12837
12838- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
12839 once when a size argument is given. This prevents a buffer overflow in the
12840 tokenizer with very long source lines.
12841
12842- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
12843 immediately after creating the object, without any intervening
12844 ``.decompress()`` calls.
12845
12846- The reconvert.quote function can now emit triple-quoted strings. The
12847 reconvert module now has some simple documentation.
12848
12849- ``UserString.MutableString`` now supports negative indices in
12850 ``__setitem__`` and ``__delitem__``
12851
12852- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
12853 correctly.
12854
12855- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
12856 ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
12857 character even if the user has passed a size parameter to get a proper
12858 line ending. Remove the special handling of a "\r\n" that has been split
12859 between two lines.
12860
12861- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
12862 about illegal code points. The codec now supports PEP 293 style error
12863 handlers.
12864
12865- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
12866 from the input stream, so that the output is a byte string in the correct
12867 encoding instead of a unicode string.
12868
12869- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
12870 considering it exactly like a '*'.
12871
12872- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
12873 ``encodings.aliases``.
12874
12875- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
12876
12877- Patch #1413711: Certain patterns of differences were making difflib
12878 touch the recursion limit.
12879
12880- Bug #947906: An object oriented interface has been added to the calendar
12881 module. It's possible to generate HTML calendar now and the module can be
12882 called as a script (e.g. via ``python -mcalendar``). Localized month and
12883 weekday names can be ouput (even if an exotic encoding is used) using
12884 special classes that use unicode.
12885
12886Build
12887-----
12888
12889- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
12890 by using -mieee gcc option.
12891
12892- Patch #1432345: Make python compile on DragonFly.
12893
12894- Build support for Win64-AMD64 was added.
12895
12896- Patch #1428494: Prefer linking against ncursesw over ncurses library.
12897
12898- Patch #881820: look for openpty and forkpty also in libbsd.
12899
12900- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012901 The zlib module is now built in on Windows.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012902
12903- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
12904
12905- Bug #1189330: configure did not correctly determine the necessary
12906 value of LINKCC if python was built with GCC 4.0.
12907
12908- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
12909 vulnerability in zlib 1.2.1 and 1.2.2.
12910
12911- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
12912 flags that change binary compatibility. Changes were also made to
12913 distutils.sysconfig to also use the environment variable when used during
12914 compilation of the interpreter and of C extensions through distutils.
12915
12916- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
12917 and linking has changed (prebinding is now deprecated, and libcc_dynamic
12918 no longer exists). This configure patch makes things right.
12919
12920- Bug #1158607: Build with --disable-unicode again.
12921
12922- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
12923 defined. Discovered as a result of not being able to build on OS X.
12924
12925- setup.py now uses the directories specified in LDFLAGS using the -L option
12926 and in CPPFLAGS using the -I option for adding library and include
12927 directories, respectively, for compiling extension modules against. This has
12928 led to the core being compiled using the values in CPPFLAGS. It also removes
12929 the need for the special-casing of both DarwinPorts and Fink for darwin since
12930 the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
12931 ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
12932 Fink, ``-I/opt/local/include`` for DarwinPorts).
12933
12934- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
12935 to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
12936 Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
12937 Closes bug #1096244. Thanks Gregory Bond.
12938
12939C API
12940-----
12941
12942- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
12943 ``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
12944 is obtained via the ``PyObject_`` family, it must be released via the
12945 ``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
12946 always been officially true, but when Python's small-object allocator was
12947 introduced, an attempt was made to cater to a few extension modules
12948 discovered at the time that obtained memory via ``PyObject_New`` but
12949 released it via ``PyMem_DEL``. It's years later, and if such code still
12950 exists it will fail now (probably with segfaults, but calling wrong
12951 low-level memory management functions can yield many symptoms).
12952
12953- Added a C API for set and frozenset objects.
12954
12955- Removed PyRange_New().
12956
12957- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
12958 mapping argument now. This string is used as a mapping table. Byte values
12959 greater than the length of the string and 0xFFFE are treated as undefined
12960 mappings.
12961
12962
12963Tests
12964-----
12965
12966- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
12967
12968- Patch #1276356: New resource "urlfetch" is implemented. This enables
12969 even impatient people to run tests that require remote files.
12970
12971
12972Documentation
12973-------------
12974
12975- Bug #1402224: Add warning to dl docs about crashes.
12976
12977- Bug #1396471: Document that Windows' ftell() can return invalid
12978 values for text files with UNIX-style line endings.
12979
12980- Bug #1274828: Document os.path.splitunc().
12981
12982- Bug #1190204: Clarify which directories are searched by site.py.
12983
12984- Bug #1193849: Clarify os.path.expanduser() documentation.
12985
12986- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
12987
12988- Bug #755617: Document the effects of os.chown() on Windows.
12989
12990- Patch #1180012: The documentation for modulefinder is now in the library reference.
12991
12992- Patch #1213031: Document that os.chown() accepts argument values of -1.
12993
12994- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
12995
12996- Bug #1175022: Correct the example code for property().
12997
12998- Document the IterableUserDict class in the UserDict module.
12999 Closes bug #1166582.
13000
13001- Remove all latent references for "Macintosh" that referred to semantics for
13002 Mac OS 9 and change to reflect the state for OS X.
13003 Closes patch #1095802. Thanks Jack Jansen.
13004
13005Mac
13006---
13007
13008
13009New platforms
13010-------------
13011
13012- FreeBSD 7 support is added.
13013
13014
13015Tools/Demos
13016-----------
13017
13018- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
13019 directory for syntax highlighting in Vim. Vim directory was added and placed
13020 vimrc to it (was previous up a level).
13021
13022- Added two new files to Tools/scripts: pysource.py, which recursively
13023 finds Python source files, and findnocoding.py, which finds Python
13024 source files that need an encoding declaration.
13025 Patch #784089, credits to Oleg Broytmann.
13026
13027- Bug #1072853: pindent.py used an uninitialized variable.
13028
13029- Patch #1177597: Correct Complex.__init__.
13030
13031- Fixed a display glitch in Pynche, which could cause the right arrow to
13032 wiggle over by a pixel.
13033
13034
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013035What's New in Python 2.4 final?
13036===============================
13037
13038*Release date: 30-NOV-2004*
13039
13040Core and builtins
13041-----------------
13042
13043- Bug 875692: Improve signal handling, especially when using threads, by
13044 forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
13045 things_to_do is not cleared by Py_MakePendingCalls().
13046
13047
13048What's New in Python 2.4 (release candidate 1)
13049==============================================
13050
13051*Release date: 18-NOV-2004*
13052
13053Core and builtins
13054-----------------
13055
13056- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
13057 the years-old thread shutdown race bug 225673. Numeric history lesson
13058 aside, all bugs in all three reports are fixed now.
13059
13060
13061Library
13062-------
13063
13064- Bug 1052242: If exceptions are raised by an atexit handler function an
13065 attempt is made to execute the remaining handlers. The last exception
13066 raised is re-raised.
13067
13068- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
13069 doctests was broken in a dramatic but shallow way. Fixed.
13070
13071- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
13072 and ``month_abbr`` attributes emulate sequences of locale-correct
13073 spellings of month and day names. Because the locale can change at
13074 any time, the correct spelling is recomputed whenever one of these is
13075 indexed. In the worst case, the index may be a slice object, so these
13076 recomputed every day or month name each time they were indexed. This is
13077 much slower than necessary in the usual case, when the index is just an
13078 integer. In that case, only the single spelling needed is recomputed
13079 now; and, when the index is a slice object, only the spellings needed
13080 by the slice are recomputed now.
13081
13082- Patch 1061679: Added ``__all__`` to pickletools.py.
13083
13084Build
13085-----
13086
13087- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
13088 and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
13089 which has no known users. Thanks Bob Ippolito.
13090
13091C API
13092-----
13093
13094- The PyRange_New() function is deprecated.
13095
13096
13097What's New in Python 2.4 beta 2?
13098================================
13099
13100*Release date: 03-NOV-2004*
13101
13102License
13103-------
13104
13105The Python Software Foundation changed the license under which Python
13106is released, to remove Python version numbers. There were no other
13107changes to the license. So, for example, wherever the license for
13108Python 2.3 said "Python 2.3", the new license says "Python". The
13109intent is to make it possible to refer to the PSF license in a more
13110durable way. For example, some people say they're confused by that
13111the Open Source Initiative's entry for the Python Software Foundation
13112License::
13113
13114 http://www.opensource.org/licenses/PythonSoftFoundation.php
13115
13116says "Python 2.1.1" all over it, wondering whether it applies only
13117to Python 2.1.1.
13118
13119The official name of the new license is the Python Software Foundation
13120License Version 2.
13121
13122Core and builtins
13123-----------------
13124
13125- Bug #1055820 Cyclic garbage collection was not protecting against that
13126 calling a live weakref to a piece of cyclic trash could resurrect an
13127 insane mutation of the trash if any Python code ran during gc (via
13128 running a dead object's __del__ method, running another callback on a
13129 weakref to a dead object, or via any Python code run in any other thread
13130 that managed to obtain the GIL while a __del__ or callback was running
13131 in the thread doing gc). The most likely symptom was "impossible"
13132 ``AttributeError`` exceptions, appearing seemingly at random, on weakly
13133 referenced objects. The cure was to clear all weakrefs to unreachable
13134 objects before allowing any callbacks to run.
13135
13136- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
13137
13138Extension Modules
13139-----------------
13140
13141- Bug #1048870: the compiler now generates distinct code objects for
13142 functions with identical bodies. This was producing confusing
13143 traceback messages which pointed to the function where the code
13144 object was first defined rather than the function being executed.
13145
13146Library
13147-------
13148
13149- Patch #1056967 changes the semantics of Template.safe_substitute() so that
13150 no ValueError is raised on an 'invalid' match group. Now the delimiter is
13151 returned.
13152
13153- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
13154
13155- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
13156 paths with a base path before checking os.path.isfile().
13157
13158- The whichdb module can now be run from the command line.
13159
13160- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
13161 the year) when the day of the week and year are also specified.
13162
13163- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
13164
13165- Bug #1017553: fix bug in tarfile.filemode()
13166
13167- Patch #737473: fix bug that old source code is shown in tracebacks even if
13168 the source code is updated and reloaded.
13169
13170Build
13171-----
13172
13173- Patch #1044395: --enable-shared is allowed in FreeBSD also.
13174
13175What's New in Python 2.4 beta 1?
13176================================
13177
13178*Release date: 15-OCT-2004*
13179
13180Core and builtins
13181-----------------
13182
13183- Patch #975056: Restartable signals were not correctly disabled on
13184 BSD systems. Consistently use PyOS_setsig() instead of signal().
13185
13186- The internal portable implementation of thread-local storage (TLS), used
13187 by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
13188 thread-correct. This could lead to a variety of problems, up to and
13189 including segfaults. See bug 1041645 for an example.
13190
13191- Added a command line option, -m module, which searches sys.path for the
13192 module and then runs it. (Contributed by Nick Coghlan.)
13193
13194- The bytecode optimizer now folds tuples of constants into a single
13195 constant.
13196
13197- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
13198 an integer was compared to a float, the integer was coerced to a float.
13199 That could yield spurious overflow errors (if the integer was very
13200 large), and to anomalies such as
13201 ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
13202 longer performed, and cases like ``long(1e200)-1 < 1e200``,
13203 ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
13204 correctly now.
13205
13206Extension modules
13207-----------------
13208
13209- ``collections.deque`` objects didn't play quite right with garbage
13210 collection, which could lead to a segfault in a release build, or
13211 an assert failure in a debug build. Also, added overflow checks,
13212 better detection of mutation during iteration, and shielded deque
13213 comparisons from unusual subclass overrides of the __iter__() method.
13214
13215Library
13216-------
13217
13218- Patch 1046644: distutils build_ext grew two new options - --swig for
13219 specifying the swig executable to use, and --swig-opts to specify
13220 options to pass to swig. --swig-opts="-c++" is the new way to spell
13221 --swig-cpp.
13222
13223- Patch 983206: distutils now obeys environment variable LDSHARED, if
13224 it is set.
13225
13226- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
13227
13228- time.strptime() now properly escapes timezones and all other locale-specific
13229 strings for regex-specific symbols. Was breaking under Japanese Windows when
13230 the timezone was specified as "Tokyo (standard time)".
13231 Closes bug #1039270.
13232
13233- Updates for the email package:
13234
13235 + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
13236 + All deprecated APIs that in email 2.x issued warnings have been removed:
13237 _encoder argument to the MIMEText constructor, Message.add_payload(),
13238 Utils.dump_address_pair(), Utils.decode(), Utils.encode()
13239 + New deprecations: Generator.__call__(), Message.get_type(),
13240 Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
13241 the Parser constructor. These will be removed in email 3.1.
13242 + Support for Python earlier than 2.3 has been removed (see PEP 291).
13243 + All defect classes have been renamed to end in 'Defect'.
13244 + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
13245 added to messages that claim to be multipart but really aren't.
13246 + Updates to documentation.
13247
13248- re's findall() and finditer() functions now take an optional flags argument
13249 just like the compile(), search(), and match() functions. Also, documented
13250 the previously existing start and stop parameters for the findall() and
13251 finditer() methods of regular expression objects.
13252
13253- rfc822 Messages now support iterating over the headers.
13254
13255- The (undocumented) tarfile.Tarfile.membernames has been removed;
13256 applications should use the getmember function.
13257
13258- httplib now offers symbolic constants for the HTTP status codes.
13259
13260- SF bug #1028306: Trying to compare a ``datetime.date`` to a
13261 ``datetime.datetime`` mistakenly compared only the year, month and day.
13262 Now it acts like a mixed-type comparison: ``False`` for ``==``,
13263 ``True`` for ``!=``, and raises ``TypeError`` for other comparison
13264 operators. Because datetime is a subclass of date, comparing only the
13265 base class (date) members can still be done, if that's desired, by
13266 forcing using of the approprate date method; e.g.,
13267 ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
13268 and day members of ``a_date`` and ``a_datetime`` are equal.
13269
13270- bdist_rpm now supports command line options --force-arch,
13271 {pre,post}-install, {pre,post}-uninstall, and
13272 {prep,build,install,clean,verify}-script.
13273
13274- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
13275 decoding incomplete input (when the input stream is temporarily exhausted).
13276 ``codecs.StreamReader`` now implements buffering, which enables proper
13277 readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
13278 has a new argument ``chars`` which specifies the number of characters to
13279 return. ``codecs.StreamReader.readline()`` and
13280 ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
13281 Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
13282
13283- The documentation for doctest is greatly expanded, and now covers all
13284 the new public features (of which there are many).
13285
13286- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
13287 updates it. This isn't good, because every ``testmod()`` call
13288 contributes to bloating the "hidden" state of ``doctest.master``, but
13289 some old code apparently relies on it. For now, all we can do is
13290 encourage people to stitch doctests together via doctest's unittest
13291 integration features instead.
13292
13293- httplib now handles ipv6 address/port pairs.
13294
13295- SF bug #1017864: ConfigParser now correctly handles default keys,
13296 processing them with ``ConfigParser.optionxform`` when supplied,
13297 consistent with the handling of config file entries and runtime-set
13298 options.
13299
13300- SF bug #997050: Document, test, & check for non-string values in
13301 ConfigParser. Moved the new string-only restriction added in
13302 rev. 1.65 to the SafeConfigParser class, leaving existing
13303 ConfigParser & RawConfigParser behavior alone, and documented the
13304 conditions under which non-string values work.
13305
13306Build
13307-----
13308
13309- Building on darwin now includes /opt/local/include and /opt/local/lib for
13310 building extension modules. This is so as to include software installed as
13311 a DarwinPorts port <http://darwinports.opendarwin.org/>
13312
13313- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
13314 platform C computes true for ``x != x`` if and only if X is a NaN.
13315 Other platforms can override the default definition with a platform-
13316 specific spelling in that platform's pyconfig.h. You can also override
13317 pyport.h's default Py_IS_INFINITY definition now.
13318
13319C API
13320-----
13321
13322- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
13323 non-zero if PyEval_InitThreads() has been called.
13324
13325- The undocumented and unused extern int ``_PyThread_Started`` was removed.
13326
13327- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13328 are two of the very few advertised as being safe to call without holding
13329 the GIL. However, this wasn't true in a debug build, as bug 1041645
13330 demonstrated. In a debug build, Python redirects the ``PyMem`` family
13331 of calls to Python's small-object allocator, to get the benefit of
13332 its extra debugging capabilities. But Python's small-object allocator
13333 isn't threadsafe, relying on the GIL to avoid the expense of doing its
13334 own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13335 call the platform ``malloc()`` directly now, regardless of build type.
13336
13337- PyLong_AsUnsignedLong[Mask] now support int objects as well.
13338
13339- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
13340 ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
13341 decoding.
13342
13343Tests
13344-----
13345
13346- test__locale ported to unittest
13347
13348Mac
13349---
13350
13351- ``plistlib`` now supports non-dict root objects. There is also a new
13352 interface for reading and writing plist files: ``readPlist(pathOrFile)``
13353 and ``writePlist(rootObject, pathOrFile)``
13354
13355Tools/Demos
13356-----------
13357
13358- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
13359 read the input files in universal-newline mode. This spares them
13360 from consuming a great deal of time to deduce the useless result that,
13361 e.g., a file with Windows line ends and a file with Linux line ends
13362 have no lines in common.
13363
13364
13365What's New in Python 2.4 alpha 3?
13366=================================
13367
13368*Release date: 02-SEP-2004*
13369
13370Core and builtins
13371-----------------
13372
13373- SF patch #1007189: ``from ... import ...`` statements now allow the name
13374 list to be surrounded by parentheses.
13375
13376- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
13377 multiplication was sped a little by optimizing the C code. Gradeschool
13378 squaring was sped by about a factor of 2, by exploiting that about half
13379 the digit products are duplicates in a square. Because exponentiation
13380 uses squaring often, this also speeds long power. For example, the time
13381 to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
13382 to this much. The cutoff for Karatsuba multiplication was raised,
13383 since gradeschool multiplication got quicker, and the cutoff was
13384 aggressively small regardless. The exponentiation algorithm was switched
13385 from right-to-left to left-to-right, which is more efficient for small
13386 bases. In addition, if the exponent is large, the algorithm now does
13387 5 bits (instead of 1 bit) at a time. That cut the time to compute
13388 17**1000000 on my box in half again, down to about 4.5 seconds.
13389
13390- OverflowWarning is no longer generated. PEP 237 scheduled this to
13391 occur in Python 2.3, but since OverflowWarning was disabled by default,
13392 nobody realized it was still being generated. On the chance that user
13393 code is still using them, the Python builtin OverflowWarning, and
13394 corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
13395
13396- Py_InitializeEx has been added.
13397
13398- Fix the order of application of decorators. The proper order is bottom-up;
13399 the first decorator listed is the last one called.
13400
13401- SF patch #1005778. Fix a seg fault if the list size changed while
13402 calling list.index(). This could happen if a rich comparison function
13403 modified the list.
13404
13405- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
13406 functions is now writable.
13407
13408- code_new (a.k.a new.code()) now checks its arguments sufficiently
13409 carefully that passing them on to PyCode_New() won't trigger calls
13410 to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
13411 that the returned code object might be entirely insane.
13412
13413- Subclasses of string can no longer be interned. The semantics of
13414 interning were not clear here -- a subclass could be mutable, for
13415 example -- and had bugs. Explicitly interning a subclass of string
13416 via intern() will raise a TypeError. Internal operations that attempt
13417 to intern a string subclass will have no effect.
13418
13419- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
13420 what xrange() intends, and repaired tests accordingly.
13421
13422Extension modules
13423-----------------
13424
13425- difflib now supports HTML side-by-side diff.
13426
13427- os.urandom has been added for systems that support sources of random
13428 data.
13429
Sean Reifscheider54cf12b2007-09-17 17:55:36 +000013430- Patch 1012740: truncate() on a writable cStringIO now resets the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013431 position to the end of the stream. This is consistent with the original
13432 StringIO module and avoids inadvertently resurrecting data that was
13433 supposed to have been truncated away.
13434
13435- Added socket.socketpair().
13436
13437- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
13438 members to xml.parsers.expat.XMLParser object.
13439
13440- The mpz, rotor, and xreadlines modules, all deprecated in earlier
13441 versions of Python, have now been removed.
13442
13443Library
13444-------
13445
13446- Patch #934356: if a module defines __all__, believe that rather than using
13447 heuristics for filtering out imported names.
13448
13449- Patch #941486: added os.path.lexists(), which returns True for broken
13450 symlinks, unlike os.path.exists().
13451
13452- the random module now uses os.urandom() for seeding if it is available.
13453 Added a new generator based on os.urandom().
13454
13455- difflib and diff.py can now generate HTML.
13456
13457- bdist_rpm now includes version and release in the BuildRoot, and
13458 replaces - by ``_`` in version and release.
13459
13460- distutils build/build_scripts now has an -e option to specify the
13461 path to the Python interpreter for installed scripts.
13462
13463- PEP 292 classes Template and SafeTemplate are added to the string module.
13464
13465- tarfile now generates GNU tar files by default.
13466
13467- HTTPResponse has now a getheaders method.
13468
13469- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
13470 Percivall.
13471
13472- logging.handlers.SMTPHandler.date_time has been removed;
13473 the class now uses email.Utils.formatdate to generate the time stamp.
13474
13475- A new function tkFont.nametofont was added to return an existing
13476 font. The Font class constructor now has an additional exists argument
13477 which, if True, requests to return/configure an existing font, rather
13478 than creating a new one.
13479
13480- Updated the decimal package's min() and max() methods to match the
13481 latest revision of the General Decimal Arithmetic Specification.
13482 Quiet NaNs are ignored and equal values are sorted based on sign
13483 and exponent.
13484
13485- The decimal package's Context.copy() method now returns deep copies.
13486
13487- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
13488 attribute will be kept around for backwards compatibility and atexit
13489 will just become the one preferred way to do it.
13490
13491- patch #675551: Add get_history_item and replace_history_item functions
13492 to the readline module.
13493
13494- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
13495 of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
13496 frame, u(p) to an older frame, not the other way around.
13497
13498- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
13499 path, as normalizing the path may alter the meaning of the path if it
13500 contains symlinks.
13501
13502- bug #851123: shutil.copyfile will raise an exception when trying to copy a
13503 file onto a link to itself. Thanks Gregory Ball.
13504
13505- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
13506 so as to properly list all functions in a module when the module itself is
13507 reached through a symlink. Thanks Johannes Gijsbers.
13508
13509- doctest refactoring continued. See the docs for details. As part of
13510 this effort, some old and little- (never?) used features are now
13511 deprecated: the Tester class, the module is_private() function, and the
13512 isprivate argument to testmod(). The Tester class supplied a feeble
13513 "by hand" way to combine multiple doctests, if you knew exactly what
13514 you were doing. The newer doctest features for unittest integration
13515 already did a better job of that, are stronger now than ever, and the
13516 new DocTestRunner class is a saner foundation if you want to do it by
13517 hand. The "private name" filtering gimmick was a mistake from the
13518 start, and testmod() changed long ago to ignore it by default. If
13519 you want to filter out tests, the new DocTestFinder class can be used
13520 to return a list of all doctests, and you can filter that list by
13521 any computable criteria before passing it to a DocTestRunner instance.
13522
13523- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
13524
13525Tools/Demos
13526-----------
13527
13528- IDLE's shortcut keys for windows are now case insensitive so that
13529 Control-V works the same as Control-v.
13530
13531- pygettext.py: Generate POT-Creation-Date header in ISO format.
13532
13533Build
13534-----
13535
13536- Backward incompatibility: longintrepr.h now triggers a compile-time
13537 error if SHIFT (the number of bits in a Python long "digit") isn't
13538 divisible by 5. This new requirement allows simple code for the new
13539 5-bits-at-a-time long_pow() implementation. If necessary, the
13540 restriction could be removed (by complicating long_pow(), or by
13541 falling back to the 1-bit-at-a-time algorithm), but there are no
13542 plans to do so.
13543
13544- bug #991962: When building with --disable-toolbox-glue on Darwin no
13545 attempt to build Mac-specific modules occurs.
13546
13547- The --with-tsc flag to configure to enable VM profiling with the
13548 processor's timestamp counter now works on PPC platforms.
13549
13550- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
13551 GCC's definition and avoid redefinition warnings.
13552
13553- Detect pthreads support (provided by gnu pth pthread emulation) on
13554 GNU/k*BSD systems.
13555
13556- bug #1005737, #1007249: Fixed several build problems and warnings
13557 found on old/legacy C compilers of HP-UX, IRIX and Tru64.
13558
13559C API
13560-----
13561
13562..
13563
13564Documentation
13565-------------
13566
13567- patch #1005936, bug #1009373: fix index entries which contain
13568 an underscore when viewed with Acrobat.
13569
13570- bug #990669: os.path.normpath may alter the meaning of a path if
13571 it contains symbolic links. This has been documented in a comment
13572 since 1992, but is now in the library reference as well.
13573
13574New platforms
13575-------------
13576
13577- FreeBSD 6 is now supported.
13578
13579Tests
13580-----
13581
13582..
13583
13584Windows
13585-------
13586
13587- Boosted the stack reservation for python.exe and pythonw.exe from
13588 the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
13589 bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
13590 within the default sys.getrecursionlimit() default value of 1000 were
13591 able to suffer undetected C stack overflows. The standard test program
13592 test_compiler was one such program. If a Python process on Windows
13593 "just vanishes" without a trace, and without an error message of any
13594 kind, but with an exit code of 128, undetected stack overflow may be
13595 the problem.
13596
13597Mac
13598---
13599
13600..
13601
13602
13603What's New in Python 2.4 alpha 2?
13604=================================
13605
13606*Release date: 05-AUG-2004*
13607
13608Core and builtins
13609-----------------
13610
13611- Patch #980695: Implements efficient string concatenation for statements
13612 of the form s=s+t and s+=t. This will vary across implementations.
13613 Accordingly, the str.join() method is strongly preferred for performance
13614 sensitive code.
13615
13616- PEP-0318, Function Decorators have been added to the language. These are
13617 implemented using the Java-style @decorator syntax, like so::
13618
13619 @staticmethod
13620 def foo(bar):
13621
13622 (The PEP needs to be updated to reflect the current state)
13623
13624- When importing a module M raises an exception, Python no longer leaves M
13625 in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
13626 succeed, picking up a module object from sys.modules reflecting as much
13627 of the initialization of M as completed before the exception was raised.
13628 Subsequent imports got no indication that M was in a partially-
13629 initialized state, and the importers could get into arbitrarily bad
13630 trouble as a result (the M they got was in an unintended state,
13631 arbitrarily far removed from M's author's intent). Now subsequent
13632 imports of M will continue raising exceptions (but if, for example, the
13633 source code for M is edited between import attempts, then perhaps later
13634 attempts will succeed, or raise a different exception).
13635
13636 This can break existing code, but in such cases the code was probably
13637 working before by accident. In the Python source, the only case of
13638 breakage discovered was in a test accidentally relying on a damaged
13639 module remaining in sys.modules. Cases are also known where tests
13640 deliberately provoking import errors remove damaged modules from
13641 sys.modules themselves, and such tests will break now if they do an
13642 unconditional del sys.modules[M].
13643
13644- u'%s' % obj will now try obj.__unicode__() first and fallback to
13645 obj.__str__() if no __unicode__ method can be found.
13646
13647- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
13648 PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
13649
13650- Allow string and unicode return types from .encode()/.decode()
13651 methods on string and unicode objects. Added unicode.decode()
13652 which was missing for no apparent reason.
13653
13654- An attempt to fix the mess that is Python's behaviour with
13655 signal handlers and threads, complicated by readline's behaviour.
13656 It's quite possible that there are still bugs here.
13657
13658- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
13659 types that support garbage collection.
13660
13661- Compiler now treats None as a constant.
13662
13663- The type of values returned by __int__, __float__, __long__,
13664 __oct__, and __hex__ are now checked. Returning an invalid type
13665 will cause a TypeError to be raised. This matches the behavior of
13666 Jython.
13667
13668- Implemented bind_textdomain_codeset() in locale module.
13669
13670- Added a workaround for proper string operations in BSDs. str.split
13671 and str.is* methods can now work correctly with UTF-8 locales.
13672
13673- Bug #989185: unicode.iswide() and unicode.width() is dropped and
13674 the East Asian Width support is moved to unicodedata extension
13675 module.
13676
13677- Patch #941229: The source code encoding in interactive mode
13678 now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
13679 allows for non-latin-1 users to write unicode strings directly.
13680
13681Extension modules
13682-----------------
13683
13684- cpickle now supports the same keyword arguments as pickle.
13685
13686Library
13687-------
13688
13689- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
13690 TIS-620
13691
13692- Thanks to Edward Loper, doctest has been massively refactored, and
13693 many new features were added. Full docs will appear later. For now
13694 the doctest module comments and new test cases give good coverage.
13695 The refactoring provides many hook points for customizing behavior
13696 (such as how to report errors, and how to compare expected to actual
13697 output). New features include a <BLANKLINE> marker for expected
13698 output containing blank lines, options to produce unified or context
13699 diffs when actual output doesn't match expectations, an option to
13700 normalize whitespace before comparing, and an option to use an
13701 ellipsis to signify "don't care" regions of output.
13702
13703- Tkinter now supports the wish -sync and -use options.
13704
13705- The following methods in time support passing of None: ctime(), gmtime(),
13706 and localtime(). If None is provided, the current time is used (the
13707 same as when the argument is omitted).
13708 [SF bug 658254, patch 663482]
13709
13710- nntplib does now allow to ignore a .netrc file.
13711
13712- urllib2 now recognizes Basic authentication even if other authentication
13713 schemes are offered.
13714
13715- Bug #1001053. wave.open() now accepts unicode filenames.
13716
13717- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
13718 underlying file object (provided it has a fileno() method). This is
13719 needed if you want to use os.fsync() on a GzipFile.
13720
13721- imaplib has two new methods: deleteacl and myrights.
13722
13723- nntplib has two new methods: description and descriptions. They
13724 use a more RFC-compliant way of getting a newsgroup description.
13725
13726- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
13727 raised during interpreter shutdown from a registered function with atexit
13728 when dummy_threading is being used.
13729
13730- Bug #857297/Patch #916874. Fix an error when extracting a hard link
13731 from a tarfile.
13732
13733- Patch #846659. Fix an error in tarfile.py when using
13734 GNU longname/longlink creation.
13735
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013736- The obsolete FCNTL.py has been deleted. The built-in fcntl module
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013737 has been available (on platforms that support fcntl) since Python
13738 1.5a3, and all FCNTL.py did is export fcntl's names, after generating
13739 a deprecation warning telling you to use fcntl directly.
13740
13741- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
13742 iso2022_jp_2004, shift_jis_2004.
13743
13744- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
13745 implementations, exploiting Conditions (which didn't exist at the time
13746 Queue was introduced). A minor semantic change is that the Full and
13747 Empty exceptions raised by non-blocking calls now occur only if the
13748 queue truly was full or empty at the instant the queue was checked (of
13749 course the Queue may no longer be full or empty by the time a calling
13750 thread sees those exceptions, though). Before, the exceptions could
13751 also be raised if it was "merely inconvenient" for the implementation
13752 to determine the true state of the Queue (because the Queue was locked
13753 by some other method in progress).
13754
13755- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
13756 case of comparing two empty lists. This affected both context_diff() and
13757 unified_diff(),
13758
13759- Bug #980938: smtplib now prints debug output to sys.stderr.
13760
13761- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
13762 returning the last point in the path that was not part of any loop. Thanks
13763 AM Kuchling.
13764
13765- Bug #980327: ntpath not handles compressing erroneous slashes between the
13766 drive letter and the rest of the path. Also clearly handles UNC addresses now
13767 as well. Thanks Paul Moore.
13768
13769- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
13770 for file sizes (compressed and uncompressed) was being stored as signed
13771 instead of unsigned.
13772
13773- decimal.py now only uses signals in the IBM spec. The other conditions are
13774 no longer part of the public API.
13775
13776- codecs module now has two new generic APIs: encode() and decode()
13777 which don't restrict the return types (unlike the unicode and
13778 string methods of the same name).
13779
13780- Non-blocking SSL sockets work again; they were broken in Python 2.3.
13781 SF patch 945642.
13782
13783- doctest unittest integration improvements:
13784
13785 o Improved the unitest test output for doctest-based unit tests
13786
13787 o Can now pass setUp and tearDown functions when creating
13788 DocTestSuites.
13789
13790- The threading module has a new class, local, for creating objects
13791 that provide thread-local data.
13792
13793- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
13794 no longer returns spurious empty fields.
13795
13796- Implemented bind_textdomain_codeset() in gettext module.
13797
13798- Introduced in gettext module the l*gettext() family of functions,
13799 which return translation strings encoded in the preferred encoding,
13800 as informed by locale module's getpreferredencoding().
13801
13802- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
13803
13804 - Add expansion of default values in help text: the string
13805 "%default" in an option's help string is expanded to str() of
13806 that option's default value, or "none" if no default value.
13807
13808 - Bug #955889: option default values that happen to be strings are
13809 now processed in the same way as values from the command line; this
13810 allows generation of nicer help when using custom types. Can
13811 be disabled with parser.set_process_default_values(False).
13812
13813 - Bug #960515: don't crash when generating help for callback
13814 options that specify 'type', but not 'dest' or 'metavar'.
13815
13816 - Feature #815264: change the default help format for short options
13817 that take an argument from e.g. "-oARG" to "-o ARG"; add
13818 set_short_opt_delimiter() and set_long_opt_delimiter() methods to
13819 HelpFormatter to allow (slight) customization of the formatting.
13820
13821 - Patch #736940: internationalize Optik: all built-in user-
13822 targeted literal strings are passed through gettext.gettext(). (If
13823 you want translations (.po files), they're not included with Python
13824 -- you'll find them in the Optik source distribution from
13825 http://optik.sourceforge.net/ .)
13826
13827 - Bug #878453: respect $COLUMNS environment variable for
13828 wrapping help output.
13829
13830 - Feature #988122: expand "%prog" in the 'description' passed
13831 to OptionParser, just like in the 'usage' and 'version' strings.
13832 (This is *not* done in the 'description' passed to OptionGroup.)
13833
13834C API
13835-----
13836
13837- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
13838 error occurs while loading the module, these now delete the module's
13839 entry from sys.modules. All ways of loading modules eventually call
13840 one of these, so this is an error-case change in semantics for all
13841 ways of loading modules. In rare cases, a module loader may wish
13842 to keep a module object in sys.modules despite that the module's
13843 code cannot be executed. In such cases, the module loader must
13844 arrange to reinsert the name and module object in sys.modules.
13845 PyImport_ReloadModule() has been changed to reinsert the original
13846 module object into sys.modules if the module reload fails, so that
13847 its visible semantics have not changed.
13848
13849- A large pile of datetime field-extraction macros is now documented,
13850 thanks to Anthony Tuininga (patch #986010).
13851
13852Documentation
13853-------------
13854
13855- Improved the tutorial on creating types in C.
13856
13857 - point out the importance of reassigning data members before
13858 assigning their values
13859
13860 - correct my misconception about return values from visitprocs. Sigh.
13861
13862 - mention the labor saving Py_VISIT and Py_CLEAR macros.
13863
13864- Major rewrite of the math module docs, to address common confusions.
13865
13866Tests
13867-----
13868
13869- The test data files for the decimal test suite are now installed on
13870 platforms that use the Makefile.
13871
13872- SF patch 995225: The test file testtar.tar accidentally contained
13873 CVS keywords (like $Id$), which could cause spurious failures in
13874 test_tarfile.py depending on how the test file was checked out.
13875
13876
13877What's New in Python 2.4 alpha 1?
13878=================================
13879
13880*Release date: 08-JUL-2004*
13881
13882Core and builtins
13883-----------------
13884
13885- weakref.ref is now the type object also known as
13886 weakref.ReferenceType; it can be subclassed like any other new-style
13887 class. There's less per-entry overhead in WeakValueDictionary
13888 objects now (one object instead of three).
13889
13890- Bug #951851: Python crashed when reading import table of certain
13891 Windows DLLs.
13892
13893- Bug #215126. The locals argument to eval(), execfile(), and exec now
13894 accept any mapping type.
13895
13896- marshal now shares interned strings. This change introduces
13897 a new .pyc magic.
13898
13899- Bug #966623. classes created with type() in an exec(, {}) don't
13900 have a __module__, but code in typeobject assumed it would always
13901 be there.
13902
13903- Python no longer relies on the LC_NUMERIC locale setting to be
13904 the "C" locale; as a result, it no longer tries to prevent changing
13905 the LC_NUMERIC category.
13906
13907- Bug #952807: Unpickling pickled instances of subclasses of
13908 datetime.date, datetime.datetime and datetime.time could yield insane
13909 objects. Thanks to Jiwon Seo for a fix.
13910
13911- Bug #845802: Python crashes when __init__.py is a directory.
13912
13913- Unicode objects received two new methods: iswide() and width().
13914 These query East Asian width information, as specified in Unicode
13915 TR11.
13916
13917- Improved the tuple hashing algorithm to give fewer collisions in
13918 common cases. Fixes bug #942952.
13919
13920- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
13921
13922- Enabled the profiling of C extension functions (and builtins) - check
13923 new documentation and modified profile and bdb modules for more details
13924
13925- Set file.name to the object passed to open (instead of a new string)
13926
13927- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
13928
13929- Optimized the byte coding for multiple assignments like "a,b=b,a" and
13930 "a,b,c=1,2,3". Improves their speed by 25% to 30%.
13931
13932- Limit the nested depth of a tuple for the second argument to isinstance()
13933 and issubclass() to the recursion limit of the interpreter.
13934 Fixes bug #858016 .
13935
13936- Optimized dict iterators, creating separate types for each
13937 and having them reveal their length. Also optimized the
13938 methods: keys(), values(), and items().
13939
13940- Implemented a newcode opcode, LIST_APPEND, that simplifies
13941 the generated bytecode for list comprehensions and further
13942 improves their performance (about 35%).
13943
13944- Implemented rich comparisons for floats, which seems to make
13945 comparisons involving NaNs somewhat less surprising when the
13946 underlying C compiler actually implements C99 semantics.
13947
13948- Optimized list.extend() to save memory and no longer create
13949 intermediate sequences. Also, extend() now pre-allocates the
13950 needed memory whenever the length of the iterable is known in
13951 advance -- this halves the time to extend the list.
13952
13953- Optimized list resize operations to make fewer calls to the system
13954 realloc(). Significantly speeds up list appends, list pops,
13955 list comprehensions, and the list constructor (when the input iterable
13956 length is not known).
13957
13958- Changed the internal list over-allocation scheme. For larger lists,
13959 overallocation ranged between 3% and 25%. Now, it is a constant 12%.
13960 For smaller lists (n<8), overallocation was upto eight elements. Now,
13961 the overallocation is no more than three elements -- this improves space
13962 utilization for applications that have large numbers of small lists.
13963
13964- Most list bodies now get re-used rather than freed. Speeds up list
13965 instantiation and deletion by saving calls to malloc() and free().
13966
13967- The dict.update() method now accepts all the same argument forms
13968 as the dict() constructor. This now includes item lists and/or
13969 keyword arguments.
13970
13971- Support for arbitrary objects supporting the read-only buffer
13972 interface as the co_code field of code objects (something that was
13973 only possible to create from C code) has been removed.
13974
13975- Made omitted callback and None equivalent for weakref.ref() and
13976 weakref.proxy(); the None case wasn't handled correctly in all
13977 cases.
13978
13979- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
13980 assumed that initial existing entries in an object's weakref list
13981 would not be removed while allocating a new weakref object. Since
13982 GC could be invoked at that time, however, that assumption was
13983 invalid. In a truly obscure case of GC being triggered during
13984 creation for a new weakref object for an referent which already
13985 has a weakref without a callback which is only referenced from
13986 cyclic trash, a memory error can occur. This consistently created a
13987 segfault in a debug build, but provided less predictable behavior in
13988 a release build.
13989
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013990- input() built-in function now respects compiler flags such as
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013991 __future__ statements. SF patch 876178.
13992
13993- Removed PendingDeprecationWarning from apply(). apply() remains
13994 deprecated, but the nuisance warning will not be issued.
13995
13996- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
13997 collection twice, both before and after tearing down modules. The
13998 call after tearing down modules has been disabled, because too much
13999 of Python has been torn down then for __del__ methods and weakref
14000 callbacks to execute sanely. The most common symptom was a sequence
14001 of uninformative messages on stderr when Python shut down, produced
14002 by threads trying to raise exceptions, but unable to report the nature
14003 of their problems because too much of the sys module had already been
14004 destroyed.
14005
14006- Removed FutureWarnings related to hex/oct literals and conversions
14007 and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
14008 This addresses most of the remaining semantic changes promised by
14009 PEP 237, except for repr() of a long, which still shows the trailing
14010 'L'. The PEP appears to promise warnings for operations that
14011 changed semantics compared to Python 2.3, but this is not
14012 implemented; we've suffered through enough warnings related to
14013 hex/oct literals and I think it's best to be silent now.
14014
14015- For str and unicode objects, the ljust(), center(), and rjust()
14016 methods now accept an optional argument specifying a fill
14017 character other than a space.
14018
14019- When method objects have an attribute that can be satisfied either
14020 by the function object or by the method object, the function
14021 object's attribute usually wins. Christian Tismer pointed out that
14022 that this is really a mistake, because this only happens for special
14023 methods (like __reduce__) where the method object's version is
14024 really more appropriate than the function's attribute. So from now
14025 on, all method attributes will have precedence over function
14026 attributes with the same name.
14027
14028- Critical bugfix, for SF bug 839548: if a weakref with a callback,
14029 its callback, and its weakly referenced object, all became part of
14030 cyclic garbage during a single run of garbage collection, the order
14031 in which they were torn down was unpredictable. It was possible for
14032 the callback to see partially-torn-down objects, leading to immediate
14033 segfaults, or, if the callback resurrected garbage objects, to
14034 resurrect insane objects that caused segfaults (or other surprises)
14035 later. In one sense this wasn't surprising, because Python's cyclic gc
14036 had no knowledge of Python's weakref objects. It does now. When
14037 weakrefs with callbacks become part of cyclic garbage now, those
14038 weakrefs are cleared first. The callbacks don't trigger then,
14039 preventing the problems. If you need callbacks to trigger, then just
14040 as when cyclic gc is not involved, you need to write your code so
14041 that weakref objects outlive the objects they weakly reference.
14042
14043- Critical bugfix, for SF bug 840829: if cyclic garbage collection
14044 happened to occur during a weakref callback for a new-style class
14045 instance, subtle memory corruption was the result (in a release build;
14046 in a debug build, a segfault occurred reliably very soon after).
14047 This has been repaired.
14048
14049- Compiler flags set in PYTHONSTARTUP are now active in __main__.
14050
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014051- Added two built-in types, set() and frozenset().
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014052
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014053- Added a reversed() built-in function that returns a reverse iterator
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014054 over a sequence.
14055
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014056- Added a sorted() built-in function that returns a new sorted list
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014057 from any iterable.
14058
14059- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
14060
14061- list.sort() now supports three keyword arguments: cmp, key, and reverse.
14062 The key argument can be a function of one argument that extracts a
14063 comparison key from the original record: mylist.sort(key=str.lower).
14064 The reverse argument is a boolean value and if True will change the
14065 sort order as if the comparison arguments were reversed. In addition,
14066 the documentation has been amended to provide a guarantee that all sorts
14067 starting with Py2.3 are guaranteed to be stable (the relative order of
14068 records with equal keys is unchanged).
14069
14070- Added test whether wchar_t is signed or not. A signed wchar_t is not
14071 usable as internal unicode type base for Py_UNICODE since the
14072 unicode implementation assumes an unsigned type.
14073
14074- Fixed a bug in the cache of length-one Unicode strings that could
14075 lead to a seg fault. The specific problem occurred when an earlier,
14076 non-fatal error left an uninitialized Unicode object in the
14077 freelist.
14078
14079- The % formatting operator now supports '%F' which is equivalent to
14080 '%f'. This has always been documented but never implemented.
14081
14082- complex(obj) could leak a little memory if obj wasn't a string or
14083 number.
14084
14085- zip() with no arguments now returns an empty list instead of raising
14086 a TypeError exception.
14087
14088- obj.__contains__() now returns True/False instead of 1/0. SF patch
14089 820195.
14090
14091- Python no longer tries to be smart about recursive comparisons.
14092 When comparing containers with cyclic references to themselves it
14093 will now just hit the recursion limit. See SF patch 825639.
14094
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014095- str and unicode built-in types now have an rsplit() method that is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014096 same as split() except that it scans the string from the end
14097 working towards the beginning. See SF feature request 801847.
14098
14099- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
14100 to clear the error when attempts to get the __getstate__ attribute
14101 fail caused intermittent errors and odd behavior.
14102
14103- buffer objects based on other objects no longer cache a pointer to
14104 the data and the data length. Instead, the appropriate tp_as_buffer
14105 method is called as necessary.
14106
14107- fixed: if a file is opened with an explicit buffer size >= 1, repeated
14108 close() calls would attempt to free() the buffer already free()ed on
14109 the first call.
14110
14111
14112Extension modules
14113-----------------
14114
14115- Added socket.getservbyport(), and make the second argument in
14116 getservbyname() and getservbyport() optional.
14117
14118- time module code that deals with input POSIX timestamps will now raise
14119 ValueError if more than a second is lost in precision when the
14120 timestamp is cast to the platform C time_t type. There's no chance
14121 that the platform will do anything sensible with the result in such
14122 cases. This includes ctime(), localtime() and gmtime(). Assorted
14123 fromtimestamp() and utcfromtimestamp() methods in the datetime module
14124 were also protected. Closes bugs #919012 and 975996.
14125
14126- fcntl.ioctl now warns if the mutate flag is not specified.
14127
14128- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
14129
14130- the weakref module now supports additional objects: array.array,
14131 sre.pattern_objects, file objects, and sockets.
14132
14133- operator.isMappingType() and operator.isSequenceType() now give
14134 fewer false positives.
14135
14136- socket.sslerror is now a subclass of socket.error . Also added
14137 socket.error to the socket module's C API.
14138
14139- Bug #920575: A problem where the _locale module segfaults on
14140 nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
14141
14142- array objects now support the copy module. Also, their resizing
14143 scheme has been updated to match that used for list objects. This improves
14144 the performance (speed and memory usage) of append() operations.
14145 Also, array.array() and array.extend() now accept any iterable argument
14146 for repeated appends without needing to create another temporary array.
14147
14148- cStringIO.writelines() now accepts any iterable argument and writes
14149 the lines one at a time rather than joining them and writing once.
14150 Made a parallel change to StringIO.writelines(). Saves memory and
14151 makes suitable for use with generator expressions.
14152
14153- time.strftime() now checks that the values in its time tuple argument
14154 are within the proper boundaries to prevent possible crashes from the
14155 platform's C library implementation of strftime(). Can possibly
14156 break code that uses values outside the range that didn't cause
14157 problems previously (such as sitting day of year to 0). Fixes bug
14158 #897625.
14159
14160- The socket module now supports Bluetooth sockets, if the
14161 system has <bluetooth/bluetooth.h>
14162
14163- Added a collections module containing a new datatype, deque(),
14164 offering high-performance, thread-safe, memory friendly appends
14165 and pops on either side of the deque.
14166
14167- Several modules now take advantage of collections.deque() for
14168 improved performance: Queue, mutex, shlex, threading, and pydoc.
14169
14170- The operator module has two new functions, attrgetter() and
14171 itemgetter() which are useful for creating fast data extractor
14172 functions for map(), list.sort(), itertools.groupby(), and
14173 other functions that expect a function argument.
14174
14175- socket.SHUT_{RD,WR,RDWR} was added.
14176
14177- os.getsid was added.
14178
14179- The pwd module incorrectly advertised its struct type as
14180 struct_pwent; this has been renamed to struct_passwd. (The old name
14181 is still supported for backwards compatibility.)
14182
14183- The xml.parsers.expat module now provides Expat 1.95.7.
14184
14185- socket.IPPROTO_IPV6 was added.
14186
14187- readline.clear_history was added.
14188
14189- select.select() now accepts sequences for its first three arguments.
14190
14191- cStringIO now supports the f.closed attribute.
14192
14193- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
14194
14195- curses module now supports use_default_colors(). [patch #739124]
14196
14197- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
14198
14199- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
14200
14201- Implemented non-recursive SRE matching scheme (#757624).
14202
14203- Implemented (?(id/name)yes|no) support in SRE (#572936).
14204
14205- random.seed() with no arguments or None uses time.time() as a default
14206 seed. Modified to match Py2.2 behavior and use fractional seconds so
14207 that successive runs are more likely to produce different sequences.
14208
14209- random.Random has a new method, getrandbits(k), which returns an int
14210 with k random bits. This method is now an optional part of the API
14211 for user defined generators. Any generator that defines genrandbits()
14212 can now use randrange() for ranges with a length >= 2**53. Formerly,
14213 randrange would return only even numbers for ranges that large (see
14214 SF bug #812202). Generators that do not define genrandbits() now
14215 issue a warning when randrange() is called with a range that large.
14216
14217- itertools has a new function, groupby() for aggregating iterables
14218 into groups sharing the same key (as determined by a key function).
14219 It offers some of functionality of SQL's groupby keyword and of
14220 the Unix uniq filter.
14221
14222- itertools now has a new tee() function which produces two independent
14223 iterators from a single iterable.
14224
14225- itertools.izip() with no arguments now returns an empty iterator instead
14226 of raising a TypeError exception.
14227
14228- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
14229 as parameter.
14230
14231Library
14232-------
14233
14234- Added a new module: cProfile, a C profiler with the same interface as the
14235 profile module. cProfile avoids some of the drawbacks of the hotshot
14236 profiler and provides a bit more information than the other two profilers.
14237 Based on "lsprof" (patch #1212837).
14238
14239- Bug #1266283: The new function "lexists" is now in os.path.__all__.
14240
14241- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
14242 the documented behavior: the function passed to the onerror()
14243 handler can now also be os.listdir.
14244
14245- Bug #754449: threading.Thread objects no longer mask exceptions raised during
14246 interpreter shutdown with another exception from attempting to handle the
14247 original exception.
14248
14249- Added decimal.py per PEP 327.
14250
14251- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
14252 "netloc" portion of a URL.
14253
14254- Bug #919012: shutil.move() will not try to move a directory into itself.
14255 Thanks Johannes Gijsbers.
14256
14257- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
14258
14259- Bug #823209: cmath.log() now takes an optional base argument so that its
14260 API matches math.log().
14261
14262- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
14263 that generate a -debuginfo.rpm
14264
14265- os.path.devnull has been added for all supported platforms.
14266
14267- Fixed #877165: distutils now picks the right C++ compiler command
14268 on cygwin and mingw32.
14269
14270- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
14271
14272- refactored site.py into functions. Also wrote regression tests for the
14273 module.
14274
14275- The distutils install command now supports the --home option and
14276 installation scheme for all platforms.
14277
14278- asyncore.loop now has a repeat count parameter that defaults to
14279 looping forever.
14280
14281- The distutils sdist command now ignores all .svn directories, in
14282 addition to CVS and RCS directories. .svn directories hold
14283 administrative files for the Subversion source control system.
14284
14285- Added a new module: cookielib. Automatic cookie handling for HTTP
14286 clients. Also, support for cookielib has been added to urllib2, so
14287 urllib2.urlopen() can transparently handle cookies.
14288
14289- stringprep.py now uses built-in set() instead of sets.Set().
14290
14291- Bug #876278: Unbounded recursion in modulefinder
14292
14293- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
14294 Applications relying on the wrong order need to be corrected.
14295
14296- Bug #926075: Fixed a bug that returns a wrong pattern object
14297 for a string or unicode object in sre.compile() when a different
14298 type pattern with the same value exists.
14299
14300- Added countcallers arg to trace.Trace class (--trackcalls command line arg
14301 when run from the command prompt).
14302
14303- Fixed a caching bug in platform.platform() where the argument of 'terse' was
14304 not taken into consideration when caching value.
14305
14306- Added two new command-line arguments for profile (output file and
14307 default sort).
14308
14309- Added global runctx function to profile module
14310
14311- Add hlist missing entryconfigure and entrycget methods.
14312
14313- The ptcp154 codec was added for Kazakh character set support.
14314
14315- Support non-anonymous ftp URLs in urllib2.
14316
14317- The encodings package will now apply codec name aliases
14318 first before starting to try the import of the codec module.
14319 This simplifies overriding built-in codecs with external
14320 packages, e.g. the included CJK codecs with the JapaneseCodecs
14321 package, by adjusting the aliases dictionary in encodings.aliases
14322 accordingly.
14323
14324- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
14325 decoding standards.
14326
14327- urllib2 now supports processors. A processor is a handler that
14328 implements an xxx_request or xxx_response method. These methods are
14329 called for all requests.
14330
14331- distutils compilers now compile source files in the same order as
14332 they are passed to the compiler.
14333
14334- pprint.pprint() and pprint.pformat() now have additional parameters
14335 indent, width and depth.
14336
14337- Patch #750542: pprint now will pretty print subclasses of list, tuple
14338 and dict too, as long as they don't overwrite __repr__().
14339
14340- Bug #848614: distutils' msvccompiler fails to find the MSVC6
14341 compiler because of incomplete registry entries.
14342
14343- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
14344
14345- Patch #841977: modulefinder didn't find extension modules in packages
14346
14347- imaplib.IMAP4.thread was added.
14348
14349- Plugged a minor hole in tempfile.mktemp() due to the use of
14350 os.path.exists(), switched to using os.lstat() directly if possible.
14351
14352- bisect.py and heapq.py now have underlying C implementations
14353 for better performance.
14354
14355- heapq.py has two new functions, nsmallest() and nlargest().
14356
14357- traceback.format_exc has been added (similar to print_exc but it returns
14358 a string).
14359
14360- xmlrpclib.MultiCall has been added.
14361
14362- poplib.POP3_SSL has been added.
14363
14364- tmpfile.mkstemp now returns an absolute path even if dir is relative.
14365
14366- urlparse is RFC 2396 compliant.
14367
14368- The fieldnames argument to the csv module's DictReader constructor is now
14369 optional. If omitted, the first row of the file will be used as the
14370 list of fieldnames.
14371
14372- encodings.bz2_codec was added for access to bz2 compression
14373 using "a long string".encode('bz2')
14374
14375- Various improvements to unittest.py, realigned with PyUnit CVS.
14376
14377- dircache now passes exceptions to the caller, instead of returning
14378 empty lists.
14379
14380- The bsddb module and dbhash module now support the iterator and
14381 mapping protocols which make them more substitutable for dictionaries
14382 and shelves.
14383
14384- The csv module's DictReader and DictWriter classes now accept keyword
14385 arguments. This was an omission in the initial implementation.
14386
14387- The email package handles some RFC 2231 parameters with missing
14388 CHARSET fields better. It also includes a patch to parameter
14389 parsing when semicolons appear inside quotes.
14390
14391- sets.py now runs under Py2.2. In addition, the argument restrictions
14392 for most set methods (but not the operators) have been relaxed to
14393 allow any iterable.
14394
14395- _strptime.py now has a behind-the-scenes caching mechanism for the most
14396 recent TimeRE instance used along with the last five unique directive
14397 patterns. The overall module was also made more thread-safe.
14398
14399- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
14400 and removed in Py2.4.
14401
14402- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
14403
14404- Patch #873597: CJK codecs are imported into rank of default codecs.
14405
14406Tools/Demos
14407-----------
14408
14409- A hotshotmain script was added to the Tools/scripts directory that
14410 makes it easy to run a script under control of the hotshot profiler.
14411
14412- The db2pickle and pickle2db scripts can now dump/load gdbm files.
14413
14414- The file order on the command line of the pickle2db script was reversed.
14415 It is now [ picklefile ] dbfile. This provides better symmetry with
14416 db2pickle. The file arguments to both scripts are now source followed by
14417 destination in situations where both files are given.
14418
14419- The pydoc script will display a link to the module documentation for
14420 modules determined to be part of the core distribution. The documentation
14421 base directory defaults to http://www.python.org/doc/current/lib/ but can
14422 be changed by setting the PYTHONDOCS environment variable.
14423
14424- texcheck.py now detects double word errors.
14425
14426- md5sum.py mistakenly opened input files in text mode by default, a
14427 silent and dangerous change from previous releases. It once again
14428 opens input files in binary mode by default. The -t and -b flags
14429 remain for compatibility with the 2.3 release, but -b is the default
14430 now.
14431
14432- py-electric-colon now works when pending-delete/delete-selection mode is
14433 in effect
14434
14435- py-help-at-point is no longer bound to the F1 key - it's still bound to
14436 C-c C-h
14437
14438- Pynche was fixed to not crash when there is no ~/.pynche file and no
14439 -d option was given.
14440
14441Build
14442-----
14443
14444- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
14445 build under OS X.
14446
14447- Profiling using gprof is now available if Python is configured with
14448 --enable-profiling.
14449
14450- Profiling the VM using the Pentium TSC is now possible if Python
14451 is configured --with-tsc.
14452
14453- In order to find libraries, setup.py now also looks in /lib64, for use
14454 on AMD64.
14455
14456- Bug #934635: Fixed a bug where the configure script couldn't detect
14457 getaddrinfo() properly if the KAME stack had SCTP support.
14458
14459- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
14460 removed.
14461
14462- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
14463 supported (see PEP 11).
14464
14465- Universal newline support can no longer be disabled (see PEP 11).
14466
14467- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
14468
14469- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
14470 (see PEP 11).
14471
14472- Tests for sizeof(char) were removed since ANSI C mandates that
14473 sizeof(char) must be 1.
14474
14475C API
14476-----
14477
14478- Thanks to Anthony Tuininga, the datetime module now supplies a C API
14479 containing type-check macros and constructors. See new docs in the
14480 Python/C API Reference Manual for details.
14481
14482- Private function _PyTime_DoubleToTimet added, to convert a Python
14483 timestamp (C double) to platform time_t with some out-of-bounds
14484 checking. Declared in new header file timefuncs.h. It would be
14485 good to expose some other internal timemodule.c functions there.
14486
14487- New public functions PyEval_EvaluateFrame and PyGen_New to expose
14488 generator objects.
14489
14490- New public functions Py_IncRef() and Py_DecRef(), exposing the
14491 functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
14492 runtime dynamic embedding of Python. See patch #938302, by Bob
14493 Ippolito.
14494
14495- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
14496 underlying array of PyObject pointers. Useful for high speed looping.
14497
14498- Created a new method flag, METH_COEXIST, which causes a method to be loaded
14499 even if already defined by a slot wrapper. This allows a __contains__
14500 method, for example, to co-exist with a defined sq_contains slot. This
14501 is helpful because the PyCFunction can take advantage of optimized calls
14502 whenever METH_O or METH_NOARGS flags are defined.
14503
14504- Added a new function, PyDict_Contains(d, k) which is like
14505 PySequence_Contains() but is specific to dictionaries and executes
14506 about 10% faster.
14507
14508- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
14509 Each return the singleton they mention after Py_INCREF()ing them.
14510
14511- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
14512 variable length argument list of Python objects without having to invoke
14513 the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
14514 is equivalent to Py_BuildValue("(OOO)", a, b, c).
14515
14516Windows
14517-------
14518
14519- The _winreg module could segfault when reading very large registry
14520 values, due to unchecked alloca() calls (SF bug 851056). The fix is
14521 uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
14522 as appropriate, followed by a size check.
14523
14524- file.truncate() could misbehave if the file was open for update
14525 (modes r+, rb+, w+, wb+), and the most recent file operation before
14526 the truncate() call was an input operation. SF bug 801631.
14527
14528
14529What's New in Python 2.3 final?
14530===============================
14531
14532*Release date: 29-Jul-2003*
14533
14534IDLE
14535----
14536
14537- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
14538 This was unique to Windows, and was fixed by adding an -n switch to
14539 the command the Windows installer creates to execute "Edit with IDLE"
14540 context-menu actions.
14541
14542- IDLE displays a new message upon startup: some "personal firewall"
14543 kinds of programs (for example, ZoneAlarm) open a dialog of their
14544 own when any program opens a socket. IDLE does use sockets, talking
14545 on the computer's internal loopback interface. This connection is not
14546 visible on any external interface and no data is sent to or received
14547 from the Internet. So, if you get such a dialog when opening IDLE,
14548 asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
14549 and rest assured no communication external to your machine is taking
14550 place. If you don't allow it, IDLE won't be able to start.
14551
14552
14553What's New in Python 2.3 release candidate 2?
14554=============================================
14555
14556*Release date: 24-Jul-2003*
14557
14558Core and builtins
14559-----------------
14560
14561- It is now possible to import from zipfiles containing additional
14562 data bytes before the zip compatible archive. Zipfiles containing a
14563 comment at the end are still unsupported.
14564
14565Extension modules
14566-----------------
14567
14568- A longstanding bug in the parser module's initialization could cause
14569 fatal internal refcount confusion when the module got initialized more
14570 than once. This has been fixed.
14571
14572- Fixed memory leak in pyexpat; using the parser's ParseFile() method
14573 with open files that aren't instances of the standard file type
14574 caused an instance of the bound .read() method to be leaked on every
14575 call.
14576
14577- Fixed some leaks in the locale module.
14578
14579Library
14580-------
14581
14582- Lib/encodings/rot_13.py when used as a script, now more properly
14583 uses the first Python interpreter on your path.
14584
14585- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
14586 fix a locale related bug in the test suite. Although another patch
14587 was needed to actually fix the problem, the cache code was not
14588 restored.
14589
14590IDLE
14591----
14592
14593- Calltips patches.
14594
14595Build
14596-----
14597
14598- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
14599 on Panther (OSX 10.3).
14600
14601C API
14602-----
14603
14604Windows
14605-------
14606
14607- The tempfile module could do insane imports on Windows if PYTHONCASEOK
14608 was set, making temp file creation impossible. Repaired.
14609
14610- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
14611
14612Mac
14613---
14614
14615- Various fixes to pimp.
14616
14617- Scripts runs with pythonw no longer had full window manager access.
14618
14619- Don't force boot-disk-only install, for reasons unknown it causes
14620 more problems than it solves.
14621
14622
14623What's New in Python 2.3 release candidate 1?
14624=============================================
14625
14626*Release date: 18-Jul-2003*
14627
14628Core and builtins
14629-----------------
14630
14631- The new function sys.getcheckinterval() returns the last value set
14632 by sys.setcheckinterval().
14633
14634- Several bugs in the symbol table phase of the compiler have been
14635 fixed. Errors could be lost and compilation could fail without
14636 reporting an error. SF patch 763201.
14637
14638- The interpreter is now more robust about importing the warnings
14639 module. In an executable generated by freeze or similar programs,
14640 earlier versions of 2.3 would fail if the warnings module could
14641 not be found on the file system. Fixes SF bug 771097.
14642
14643- A warning about assignments to module attributes that shadow
14644 builtins, present in earlier releases of 2.3, has been removed.
14645
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014646- It is not possible to create subclasses of built-in types like str
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014647 and tuple that define an itemsize. Earlier releases of Python 2.3
14648 allowed this by mistake, leading to crashes and other problems.
14649
14650- The thread_id is now initialized to 0 in a non-thread build. SF bug
14651 770247.
14652
14653- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
14654
14655Extension modules
14656-----------------
14657
14658- weakref.proxy() can now handle "del obj[i]" for proxy objects
14659 defining __delitem__. Formerly, it generated a SystemError.
14660
14661- SSL no longer crashes the interpreter when the remote side disconnects.
14662
14663- On Unix the mmap module can again be used to map device files.
14664
14665- time.strptime now exclusively uses the Python implementation
14666 contained within the _strptime module.
14667
14668- The print slot of weakref proxy objects was removed, because it was
14669 not consistent with the object's repr slot.
14670
14671- The mmap module only checks file size for regular files, not
14672 character or block devices. SF patch 708374.
14673
14674- The cPickle Pickler garbage collection support was fixed to traverse
14675 the find_class attribute, if present.
14676
14677- There are several fixes for the bsddb3 wrapper module.
14678
14679 bsddb3 no longer crashes if an environment is closed before a cursor
14680 (SF bug 763298).
14681
14682 The DB and DBEnv set_get_returns_none function was extended to take
14683 a level instead of a boolean flag. The new level 2 means that in
14684 addition, cursor.set()/.get() methods return None instead of raising
14685 an exception.
14686
14687 A typo was fixed in DBCursor.join_item(), preventing a crash.
14688
14689Library
14690-------
14691
14692- distutils now supports MSVC 7.1
14693
14694- doctest now examines all docstrings by default. Previously, it would
14695 skip over functions with private names (as indicated by the underscore
14696 naming convention). The old default created too much of a risk that
14697 user tests were being skipped inadvertently. Note, this change could
14698 break code in the unlikely case that someone had intentionally put
14699 failing tests in the docstrings of private functions. The breakage
14700 is easily fixable by specifying the old behavior when calling testmod()
14701 or Tester().
14702
14703- There were several fixes to the way dumbdbms are closed. It's vital
14704 that a dumbdbm database be closed properly, else the on-disk data
14705 and directory files can be left in mutually inconsistent states.
14706 dumbdbm.py's _Database.__del__() method attempted to close the
14707 database properly, but a shutdown race in _Database._commit() could
14708 prevent this from working, so that a program trusting __del__() to
14709 get the on-disk files in synch could be badly surprised. The race
14710 has been repaired. A sync() method was also added so that shelve
14711 can guarantee data is written to disk.
14712
14713 The close() method can now be called more than once without complaint.
14714
14715- The classes in threading.py are now new-style classes. That they
14716 weren't before was an oversight.
14717
14718- The urllib2 digest authentication handlers now define the correct
14719 auth_header. The earlier versions would fail at runtime.
14720
14721- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
14722 when there are no lines.
14723
14724- SF bug 763637: fix exception in Tkinter with after_cancel
14725 which could occur with Tk 8.4
14726
14727- SF bug 770601: CGIHTTPServer.py now passes the entire environment
14728 to child processes.
14729
14730- SF bug 765238: add filter to fnmatch's __all__.
14731
14732- SF bug 748201: make time.strptime() error messages more helpful.
14733
14734- SF patch 764470: Do not dump the args attribute of a Fault object in
14735 xmlrpclib.
14736
14737- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
14738 responses.
14739
14740- SF patch 766650: The whichdb module was fixed to recognize dbm files
14741 generated by gdbm on OS/2 EMX.
14742
14743- SF bugs 763047 and 763052: fixes bug of timezone value being left as
14744 -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
14745 is true when it should only when time.daylight is true.
14746
14747- SF bug 764548: re now allows subclasses of str and unicode to be
14748 used as patterns.
14749
14750- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
14751 of varying sizes. Tk 8.4 returns a different number of values
14752 than Tk 8.3.
14753
14754- SF bug 763023: difflib.ratio() did not catch zero division.
14755
14756- The Queue module now has an __all__ attribute.
14757
14758Tools/Demos
14759-----------
14760
14761- See Lib/idlelib/NEWS.txt for IDLE news.
14762
14763- SF bug 753592: webchecker/wsgui now handles user supplied directories.
14764
14765- The trace.py script has been removed. It is now in the standard library.
14766
14767Build
14768-----
14769
14770- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
14771
14772- The socket module compiles on IRIX 6.5.10.
14773
14774- An irix64 system is treated the same way as an irix6 system (SF
14775 patch 764560).
14776
14777- Several definitions were missing on FreeBSD 5.x unless the
14778 __BSD_VISIBLE symbol was defined. configure now defines it as
14779 needed.
14780
14781C API
14782-----
14783
14784- Unicode objects now support mbcs as a built-in encoding, so the C
14785 API can use it without deferring to the encodings package.
14786
14787Windows
14788-------
14789
14790- The Windows implementation of PyThread_start_new_thread() never
14791 checked error returns from Windows functions correctly. As a result,
14792 it could claim to start a new thread even when the Microsoft
14793 _beginthread() function failed (due to "too many threads" -- this is
14794 on the order of thousands when it happens). In these cases, the
14795 Python exception ::
14796
14797 thread.error: can't start new thread
14798
14799 is raised now.
14800
14801- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
14802 use. The interpreter now calls WSACleanup() from Py_Finalize()
14803 instead of from DLL teardown.
14804
14805Mac
14806---
14807
14808- Bundlebuilder now inherits default values in the right way. It was
14809 previously possible for app bundles to get a type of "BNDL" instead
14810 of "APPL." Other improvements include, a --build-id option to
14811 specify the CFBundleIdentifier and using the --python option to set
14812 the executable in the bundle.
14813
14814- Fixed two bugs in MacOSX framework handling.
14815
14816- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
14817
14818- Python is now compiled with -mno-fused-madd, making all tests pass
14819 on Panther.
14820
14821What's New in Python 2.3 beta 2?
14822================================
14823
14824*Release date: 29-Jun-2003*
14825
14826Core and builtins
14827-----------------
14828
14829- A program can now set the environment variable PYTHONINSPECT to some
14830 string value in Python, and cause the interpreter to enter the
14831 interactive prompt at program exit, as if Python had been invoked
14832 with the -i option.
14833
14834- list.index() now accepts optional start and stop arguments. Similar
14835 changes were made to UserList.index(). SF feature request 754014.
14836
14837- SF patch 751998 fixes an unwanted side effect of the previous fix
14838 for SF bug 742860 (the next item).
14839
14840- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
14841 wasn't threadsafe, was very inefficient (expected time O(len(dict))
14842 instead of O(1)), and could raise a spurious RuntimeError if another
14843 thread mutated the dict during __delitem__, or if a comparison function
14844 mutated it. It also neglected to raise KeyError when the key wasn't
14845 present; didn't raise TypeError when the key wasn't of a weakly
14846 referencable type; and broke various more-or-less obscure dict
14847 invariants by using a sequence of equality comparisons over the whole
14848 set of dict keys instead of computing the key's hash code to narrow
14849 the search to those keys with the same hash code. All of these are
14850 considered to be bugs. A new implementation of __delitem__ repairs all
14851 that, but note that fixing these bugs may change visible behavior in
14852 code relying (whether intentionally or accidentally) on old behavior.
14853
14854- SF bug 734869: Fixed a compiler bug that caused a fatal error when
14855 compiling a list comprehension that contained another list comprehension
14856 embedded in a lambda expression.
14857
14858- SF bug 705231: builtin pow() no longer lets the platform C pow()
14859 raise -1.0 to integer powers, because (at least) glibc gets it wrong
14860 in some cases. The result should be -1.0 if the power is odd and 1.0
14861 if the power is even, and any float with a sufficiently large exponent
14862 is (mathematically) an exact even integer.
14863
14864- SF bug 759227: A new-style class that implements __nonzero__() must
14865 return a bool or int (but not an int subclass) from that method. This
14866 matches the restriction on classic classes.
14867
14868- The encoding attribute has been added for file objects, and set to
14869 the terminal encoding on Unix and Windows.
14870
14871- The softspace attribute of file objects became read-only by oversight.
14872 It's writable again.
14873
14874- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
14875 tuple. By default, the iterators now access data elements directly
14876 instead of going through __getitem__. If __getitem__ access is
14877 preferred, then __iter__ can be overridden.
14878
14879- SF bug 735247: The staticmethod and super types participate in
14880 garbage collection. Before this change, it was possible for leaks to
14881 occur in functions with non-global free variables that used these types.
14882
14883Extension modules
14884-----------------
14885
14886- the socket module has a new exception, socket.timeout, to allow
14887 timeouts to be handled separately from other socket errors.
14888
14889- SF bug 751276: cPickle has fixed to propagate exceptions raised in
14890 user code. In earlier versions, cPickle caught and ignored any
14891 exception when it performed operations that it expected to raise
14892 specific exceptions like AttributeError.
14893
14894- cPickle Pickler and Unpickler objects now participate in garbage
14895 collection.
14896
14897- mimetools.choose_boundary() could return duplicate strings at times,
14898 especially likely on Windows. The strings returned are now guaranteed
14899 unique within a single program run.
14900
14901- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
14902 dummy_thread has also been modified to try to simulate the behavior.
14903
14904- array.array.insert() now treats negative indices as being relative
14905 to the end of the array, just like list.insert() does. (SF bug #739313)
14906
14907- The datetime module classes datetime, time, and timedelta are now
14908 properly subclassable.
14909
14910- _tkinter.{get|set}busywaitinterval was added.
14911
14912- itertools.islice() now accepts stop=None as documented.
14913 Fixes SF bug #730685.
14914
14915- the bsddb185 module is built in one restricted instance -
14916 /usr/include/db.h exists and defines HASHVERSION to be 2. This is true
14917 for many BSD-derived systems.
14918
14919
14920Library
14921-------
14922
14923- Some happy doctest extensions from Jim Fulton have been added to
14924 doctest.py. These are already being used in Zope3. The two
14925 primary ones:
14926
14927 doctest.debug(module, name) extracts the doctests from the named object
14928 in the given module, puts them in a temp file, and starts pdb running
14929 on that file. This is great when a doctest fails.
14930
14931 doctest.DocTestSuite(module=None) returns a synthesized unittest
14932 TestSuite instance, to be run by the unittest framework, which
14933 runs all the doctests in the module. This allows writing tests in
14934 doctest style (which can be clearer and shorter than writing tests
14935 in unittest style), without losing unittest's powerful testing
14936 framework features (which doctest lacks).
14937
14938- For compatibility with doctests created before 2.3, if an expected
14939 output block consists solely of "1" and the actual output block
14940 consists solely of "True", it's accepted as a match; similarly
14941 for "0" and "False". This is quite un-doctest-like, but is practical.
14942 The behavior can be disabled by passing the new doctest module
14943 constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
14944 argument.
14945
14946- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
14947 a bare except caught to much and reported all errors as a problem
14948 in the archive.
14949
14950- The logging module now has a new function, makeLogRecord() making
14951 LogHandler easier to interact with DatagramHandler and SocketHandler.
14952
14953- The cgitb module has been extended to support plain text display (SF patch
14954 569574).
14955
14956- A brand new version of IDLE (from the IDLEfork project at
14957 SourceForge) is now included as Lib/idlelib. The old Tools/idle is
14958 no more.
14959
14960- Added a new module: trace (documentation missing). This module used
14961 to be distributed in Tools/scripts. It uses sys.settrace() to trace
14962 code execution -- either function calls or individual lines. It can
14963 generate tracing output during execution or a post-mortem report of
14964 code coverage.
14965
14966- The threading module has new functions settrace() and setprofile()
14967 that cooperate with the functions of the same name in the sys
14968 module. A function registered with the threading module will
14969 be used for all threads it creates. The new trace module uses this
14970 to provide tracing for code running in threads.
14971
14972- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
14973 Taschuk. Copying a new-style class that had a reference to itself
14974 didn't work. (The same thing worked fine for old-style classes.)
14975 Builtin functions are now treated as atomic, fixing bug #746304.
14976
14977- difflib.py has two new functions: context_diff() and unified_diff().
14978
14979- More fixes to urllib (SF 549151): (a) When redirecting, always use
14980 GET. This is common practice and more-or-less sanctioned by the
14981 HTTP standard. (b) Add a handler for 307 redirection, which becomes
14982 an error for POST, but a regular redirect for GET and HEAD
14983
14984- Added optional 'onerror' argument to os.walk(), to control error
14985 handling.
14986
14987- inspect.is{method|data}descriptor was added, to allow pydoc display
14988 __doc__ of data descriptors.
14989
14990- Fixed socket speed loss caused by use of the _socketobject wrapper class
14991 in socket.py.
14992
14993- timeit.py now checks the current directory for imports.
14994
14995- urllib2.py now knows how to order proxy classes, so the user doesn't
14996 have to insert it in front of other classes, nor do dirty tricks like
14997 inserting a "dummy" HTTPHandler after a ProxyHandler when building an
14998 opener with proxy support.
14999
15000- Iterators have been added for dbm keys.
15001
15002- random.Random objects can now be pickled.
15003
15004Tools/Demos
15005-----------
15006
15007- pydoc now offers help on keywords and topics.
15008
15009- Tools/idle is gone; long live Lib/idlelib.
15010
15011- diff.py prints file diffs in context, unified, or ndiff formats,
15012 providing a command line interface to difflib.py.
15013
15014- texcheck.py is a new script for making a rough validation of Python LaTeX
15015 files.
15016
15017Build
15018-----
15019
15020- Setting DESTDIR during 'make install' now allows specifying a
15021 different root directory.
15022
15023C API
15024-----
15025
15026- PyType_Ready(): If a type declares that it participates in gc
15027 (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
15028 tp_free slot is the default _PyObject_Del, and type does not define
15029 a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
15030 Previously _PyObject_Del was inherited, which could at best lead to a
15031 segfault. In addition, if even after this magic the type's tp_free
15032 slot is _PyObject_Del or NULL, and the type is a base type
15033 (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
15034 type, its dealloc function must call type->tp_free, and since the type
15035 is gc'able, tp_free must not be NULL or _PyObject_Del.
15036
15037- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
15038 from C) to interrupt a thread by sending it an exception. It is
15039 intentional that you have to write your own C extension to call it
15040 from Python.
15041
15042
15043New platforms
15044-------------
15045
15046None this time.
15047
15048Tests
15049-----
15050
15051- test_imp rewritten so that it doesn't raise RuntimeError if run as a
15052 side effect of being imported ("import test.autotest").
15053
15054Windows
15055-------
15056
15057- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
15058
15059- The installer always suggested that Python be installed on the C:
15060 drive, due to a hardcoded "C:" generated by the Wise installation
15061 wizard. People with machines where C: is not the system drive
15062 usually want Python installed on whichever drive is their system drive
15063 instead. We removed the hardcoded "C:", and two testers on machines
15064 where C: is not the system drive report that the installer now
15065 suggests their system drive. Note that you can always select the
15066 directory you want in the "Select Destination Directory" dialog --
15067 that's what it's for.
15068
15069Mac
15070---
15071
15072- There's a new module called "autoGIL", which offers a mechanism to
15073 automatically release the Global Interpreter Lock when an event loop
15074 goes to sleep, allowing other threads to run. It's currently only
15075 supported on OSX, in the Mach-O version.
15076- The OSA modules now allow direct access to properties of the
15077 toplevel application class (in AppleScript terminology).
15078- The Package Manager can now update itself.
15079
15080SourceForge Bugs and Patches Applied
15081------------------------------------
15082
15083430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
15084598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
15085622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
15086661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
15087683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
15088697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
15089713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
15090724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
15091727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
15092729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
15093730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
15094731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
15095732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
15096733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
15097735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
15098740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
15099744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
15100745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
15101747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
15102749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
15103751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
15104753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
15105755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
15106757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
15107760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
15108
15109
15110What's New in Python 2.3 beta 1?
15111================================
15112
15113*Release date: 25-Apr-2003*
15114
15115Core and builtins
15116-----------------
15117
15118- New format codes B, H, I, k and K have been implemented for
15119 PyArg_ParseTuple and PyBuild_Value.
15120
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015121- New built-in function sum(seq, start=0) returns the sum of all the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015122 items in iterable object seq, plus start (items are normally numbers,
15123 and cannot be strings).
15124
15125- bool() called without arguments now returns False rather than
15126 raising an exception. This is consistent with calling the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015127 constructors for the other built-in types -- called without argument
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015128 they all return the false value of that type. (SF patch #724135)
15129
15130- In support of PEP 269 (making the pgen parser generator accessible
15131 from Python), some changes to the pgen code structure were made; a
15132 few files that used to be linked only with pgen are now linked with
15133 Python itself.
15134
15135- The repr() of a weakref object now shows the __name__ attribute of
15136 the referenced object, if it has one.
15137
15138- super() no longer ignores data descriptors, except __class__. See
15139 the thread started at
15140 http://mail.python.org/pipermail/python-dev/2003-April/034338.html
15141
15142- list.insert(i, x) now interprets negative i as it would be
15143 interpreted by slicing, so negative values count from the end of the
15144 list. This was the only place where such an interpretation was not
15145 placed on a list index.
15146
15147- range() now works even if the arguments are longs with magnitude
15148 larger than sys.maxint, as long as the total length of the sequence
15149 fits. E.g., range(2**100, 2**101, 2**100) is the following list:
15150 [1267650600228229401496703205376L]. (SF patch #707427.)
15151
15152- Some horridly obscure problems were fixed involving interaction
15153 between garbage collection and old-style classes with "ambitious"
15154 getattr hooks. If an old-style instance didn't have a __del__ method,
15155 but did have a __getattr__ hook, and the instance became reachable
15156 only from an unreachable cycle, and the hook resurrected or deleted
15157 unreachable objects when asked to resolve "__del__", anything up to
15158 a segfault could happen. That's been repaired.
15159
15160- dict.pop now takes an optional argument specifying a default
15161 value to return if the key is not in the dict. If a default is not
15162 given and the key is not found, a KeyError will still be raised.
15163 Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
15164 [SF patch #693753] (contributed by Michael Stone.)
15165
15166- sys.getfilesystemencoding() was added to expose
15167 Py_FileSystemDefaultEncoding.
15168
15169- New function sys.exc_clear() clears the current exception. This is
15170 rarely needed, but can sometimes be useful to release objects
15171 referenced by the traceback held in sys.exc_info()[2]. (SF patch
15172 #693195.)
15173
15174- On 64-bit systems, a dictionary could contain duplicate long/int keys
15175 if the key value was larger than 2**32. See SF bug #689659.
15176
15177- Fixed SF bug #663074. The codec system was using global static
15178 variables to store internal data. As a result, any attempts to use the
15179 unicode system with multiple active interpreters, or successive
15180 interpreter executions, would fail.
15181
15182- "%c" % u"a" now returns a unicode string instead of raising a
15183 TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
15184 of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
15185
15186Extension modules
15187-----------------
15188
15189- The socket module now provides the functions inet_pton and inet_ntop
15190 for converting between string and packed representation of IP
15191 addresses. There is also a new module variable, has_ipv6, which is
15192 True iff the current Python has IPv6 support. See SF patch #658327.
15193
15194- Tkinter wrappers around Tcl variables now pass objects directly
15195 to Tcl, instead of first converting them to strings.
15196
15197- The .*? pattern in the re module is now special-cased to avoid the
15198 recursion limit. (SF patch #720991 -- many thanks to Gary Herron
15199 and Greg Chapman.)
15200
15201- New function sys.call_tracing() allows pdb to debug code
15202 recursively.
15203
15204- New function gc.get_referents(obj) returns a list of objects
15205 directly referenced by obj. In effect, it exposes what the object's
15206 tp_traverse slot does, and can be helpful when debugging memory
15207 leaks.
15208
15209- The iconv module has been removed from this release.
15210
15211- The platform-independent routines for packing floats in IEEE formats
15212 (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
15213 pickling of floats) ignored that rounding can cause a carry to
15214 propagate. The worst consequence was that, in rare cases, <f and >f
15215 could produce strings that, when unpacked again, were a factor of 2
15216 away from the original float. This has been fixed. See SF bug
15217 #705836.
15218
15219- New function time.tzset() provides access to the C library tzset()
15220 function, if supported. (SF patch #675422.)
15221
15222- Using createfilehandler, deletefilehandler, createtimerhandler functions
15223 on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
15224 See SF bug #692416.
15225
15226- Modified the fcntl.ioctl() function to allow modification of a passed
15227 mutable buffer (for details see the reference documentation).
15228
15229- Made user requested changes to the itertools module.
15230 Subsumed the times() function into repeat().
15231 Added chain() and cycle().
15232
15233- The rotor module is now deprecated; the encryption algorithm it uses
15234 is not believed to be secure, and including crypto code with Python
15235 has implications for exporting and importing it in various countries.
15236
15237- The socket module now always uses the _socketobject wrapper class, even on
15238 platforms which have dup(2). The makefile() method is built directly
15239 on top of the socket without duplicating the file descriptor, allowing
15240 timeouts to work properly.
15241
15242Library
15243-------
15244
15245- New generator function os.walk() is an easy-to-use alternative to
15246 os.path.walk(). See os module docs for details. os.path.walk()
15247 isn't deprecated at this time, but may become deprecated in a
15248 future release.
15249
15250- Added new module "platform" which provides a wide range of tools
15251 for querying platform dependent features.
15252
15253- netrc now allows ASCII punctuation characters in passwords.
15254
15255- shelve now supports the optional writeback argument, and exposes
15256 pickle protocol versions.
15257
15258- Several methods of nntplib.NNTP have grown an optional file argument
15259 which specifies a file where to divert the command's output
15260 (already supported by the body() method). (SF patch #720468)
15261
15262- The self-documenting XML server library DocXMLRPCServer was added.
15263
15264- Support for internationalized domain names has been added through
15265 the 'idna' and 'punycode' encodings, the 'stringprep' module, the
15266 'mkstringprep' tool, and enhancements to the socket and httplib
15267 modules.
15268
15269- htmlentitydefs has two new dictionaries: name2codepoint maps
15270 HTML entity names to Unicode codepoints (as integers).
15271 codepoint2name is the reverse mapping. See SF patch #722017.
15272
15273- pdb has a new command, "debug", which lets you step through
15274 arbitrary code from the debugger's (pdb) prompt.
15275
15276- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
15277 return 'not a == b' rather than 'a != b'. This gives the desired
15278 result for classes that define __eq__ without defining __ne__.
15279
15280- sgmllib now supports SGML marked sections, in particular the
15281 MS Office extensions.
15282
15283- The urllib module now offers support for the iterator protocol.
15284 SF patch 698520 contributed by Brett Cannon.
15285
15286- New module timeit provides a simple framework for timing the
15287 execution speed of expressions and statements.
15288
15289- sets.Set objects now support mixed-type __eq__ and __ne__, instead
15290 of raising TypeError. If x is a Set object and y is a non-Set object,
15291 x == y is False, and x != y is True. This is akin to the change made
15292 for mixed-type comparisons of datetime objects in 2.3a2; more info
15293 about the rationale is in the NEWS entry for that. See also SF bug
15294 report <http://www.python.org/sf/693121>.
15295
15296- On Unix platforms, if os.listdir() is called with a Unicode argument,
15297 it now returns Unicode strings. (This behavior was added earlier
15298 to the Windows NT/2k/XP version of os.listdir().)
15299
15300- Distutils: both 'py_modules' and 'packages' keywords can now be specified
15301 in core.setup(). Previously you could supply one or the other, but
15302 not both of them. (SF patch #695090 from Bernhard Herzog)
15303
15304- New csv package makes it easy to read/write CSV files.
15305
15306- Module shlex has been extended to allow posix-like shell parsings,
15307 including a split() function for easy spliting of quoted strings and
15308 commands. An iterator interface was also implemented.
15309
15310Tools/Demos
15311-----------
15312
15313- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
15314 See the module docstring for details.
15315
15316Build
15317-----
15318
15319- Fix problem building on OSF1 because the compiler only accepted
15320 preprocessor directives that start in column 1. (SF bug #691793.)
15321
15322C API
15323-----
15324
15325- Added PyGC_Collect(), equivalent to calling gc.collect().
15326
15327- PyThreadState_GetDict() was changed not to raise an exception or
15328 issue a fatal error when no current thread state is available. This
15329 makes it possible to print dictionaries when no thread is active.
15330
15331- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
15332 need compatibility with previous versions can use this:
15333
15334 #ifndef PY_LONG_LONG
15335 #define PY_LONG_LONG LONG_LONG
15336 #endif
15337
15338- Added PyObject_SelfIter() to fill the tp_iter slot for the
15339 typical case where the method returns its self argument.
15340
15341- The extended type structure used for heap types (new-style
15342 classes defined by Python code using a class statement) is now
15343 exported from object.h as PyHeapTypeObject. (SF patch #696193.)
15344
15345New platforms
15346-------------
15347
15348None this time.
15349
15350Tests
15351-----
15352
15353- test_timeout now requires -u network to be passed to regrtest to run.
15354 See SF bug #692988.
15355
15356Windows
15357-------
15358
15359- os.fsync() now exists on Windows, and calls the Microsoft _commit()
15360 function.
15361
15362- New function winsound.MessageBeep() wraps the Win32 API
15363 MessageBeep().
15364
15365Mac
15366---
15367
15368- os.listdir() now returns Unicode strings on MacOS X when called with
15369 a Unicode argument. See the general news item under "Library".
15370
15371- A new method MacOS.WMAvailable() returns true if it is safe to access
15372 the window manager, false otherwise.
15373
15374- EasyDialogs dialogs are now movable-modal, and if the application is
15375 currently in the background they will ask to be moved to the foreground
15376 before displaying.
15377
15378- OSA Scripting support has improved a lot, and gensuitemodule.py can now
15379 be used by mere mortals. The documentation is now also more or less
15380 complete.
15381
15382- The IDE (in a framework build) now includes introductory documentation
15383 in Apple Help Viewer format.
15384
15385
15386What's New in Python 2.3 alpha 2?
15387=================================
15388
15389*Release date: 19-Feb-2003*
15390
15391Core and builtins
15392-----------------
15393
15394- Negative positions returned from PEP 293 error callbacks are now
15395 treated as being relative to the end of the input string. Positions
15396 that are out of bounds raise an IndexError.
15397
15398- sys.path[0] (the directory from which the script is loaded) is now
15399 turned into an absolute pathname, unless it is the empty string.
15400 (SF patch #664376.)
15401
15402- Finally fixed the bug in compile() and exec where a string ending
15403 with an indented code block but no newline would raise SyntaxError.
15404 This would have been a four-line change in parsetok.c... Except
15405 codeop.py depends on this behavior, so a compilation flag had to be
15406 invented that causes the tokenizer to revert to the old behavior;
15407 this required extra changes to 2 .h files, 2 .c files, and 2 .py
15408 files. (Fixes SF bug #501622.)
15409
15410- If a new-style class defines neither __new__ nor __init__, its
15411 constructor would ignore all arguments. This is changed now: the
15412 constructor refuses arguments in this case. This might break code
15413 that worked under Python 2.2. The simplest fix is to add a no-op
15414 __init__: ``def __init__(self, *args, **kw): pass``.
15415
15416- Through a bytecode optimizer bug (and I bet you didn't even know
15417 Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
15418 with a leading minus sign would come out with the wrong sign.
15419 ("Unsigned" hex/oct constants are those with a face value in the
15420 range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
15421 always been interpreted as negative numbers through sign folding.)
15422 E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
15423 come out as -4294967295. This was the case in Python 2.2 through
15424 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
15425 value, but according to PEP 237 it really needs to be 1 now. This
15426 will be backported to Python 2.2.3 a well. (SF #660455)
15427
15428- int(s, base) sometimes sign-folds hex and oct constants; it only
15429 does this when base is 0 and s.strip() starts with a '0'. When the
15430 sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
15431 machine, which returns -1, a FutureWarning is now issued; in Python
15432 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
15433 int("0xffffffff", 16) right now. (PEP 347)
15434
15435- super(X, x): x may now be a proxy for an X instance, i.e.
15436 issubclass(x.__class__, X) but not issubclass(type(x), X).
15437
15438- isinstance(x, X): if X is a new-style class, this is now equivalent
15439 to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
15440 only type(x) was tested. (For classic classes this was already the
15441 case.)
15442
15443- compile(), eval() and the exec statement now fully support source code
15444 passed as unicode strings.
15445
15446- int subclasses can be initialized with longs if the value fits in an int.
15447 See SF bug #683467.
15448
15449- long(string, base) takes time linear in len(string) when base is a power
15450 of 2 now. It used to take time quadratic in len(string).
15451
15452- filter returns now Unicode results for Unicode arguments.
15453
15454- raw_input can now return Unicode objects.
15455
15456- List objects' sort() method now accepts None as the comparison function.
15457 Passing None is semantically identical to calling sort() with no
15458 arguments.
15459
15460- Fixed crash when printing a subclass of str and __str__ returned self.
15461 See SF bug #667147.
15462
15463- Fixed an invalid RuntimeWarning and an undetected error when trying
15464 to convert a long integer into a float which couldn't fit.
15465 See SF bug #676155.
15466
15467- Function objects now have a __module__ attribute that is bound to
15468 the name of the module in which the function was defined. This
15469 applies for C functions and methods as well as functions and methods
15470 defined in Python. This attribute is used by pickle.whichmodule(),
15471 which changes the behavior of whichmodule slightly. In Python 2.2
15472 whichmodule() returns "__main__" for functions that are not defined
15473 at the top-level of a module (examples: methods, nested functions).
15474 Now whichmodule() will return the proper module name.
15475
15476Extension modules
15477-----------------
15478
15479- operator.isNumberType() now checks that the object has a nb_int or
15480 nb_float slot, rather than simply checking whether it has a non-NULL
15481 tp_as_number pointer.
15482
15483- The imp module now has ways to acquire and release the "import
15484 lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
15485 reentrant lock, so releasing the lock only truly releases it when
15486 this is the last release_lock() call. You can check with
15487 imp.lock_held(). (SF bug #580952 and patch #683257.)
15488
15489- Change to cPickle to match pickle.py (see below and PEP 307).
15490
15491- Fix some bugs in the parser module. SF bug #678518.
15492
15493- Thanks to Scott David Daniels, a subtle bug in how the zlib
15494 extension implemented flush() was fixed. Scott also rewrote the
15495 zlib test suite using the unittest module. (SF bug #640230 and
15496 patch #678531.)
15497
15498- Added an itertools module containing high speed, memory efficient
15499 looping constructs inspired by tools from Haskell and SML.
15500
15501- The SSL module now handles sockets with a timeout set correctly (SF
15502 patch #675750, fixing SF bug #675552).
15503
15504- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
15505
15506- Fixed broken threadstate swap in readline that could cause fatal
15507 errors when a readline hook was being invoked while a background
15508 thread was active. (SF bugs #660476 and #513033.)
15509
15510- fcntl now exposes the strops.h I_* constants.
15511
15512- Fix a crash on Solaris that occurred when calling close() on
15513 an mmap'ed file which was already closed. (SF patch #665913)
15514
15515- Fixed several serious bugs in the zipimport implementation.
15516
15517- datetime changes:
15518
15519 The date class is now properly subclassable. (SF bug #720908)
15520
15521 The datetime and datetimetz classes have been collapsed into a single
15522 datetime class, and likewise the time and timetz classes into a single
15523 time class. Previously, a datetimetz object with tzinfo=None acted
15524 exactly like a datetime object, and similarly for timetz. This wasn't
15525 enough of a difference to justify distinct classes, and life is simpler
15526 now.
15527
15528 today() and now() now round system timestamps to the closest
15529 microsecond <http://www.python.org/sf/661086>. This repairs an
15530 irritation most likely seen on Windows systems.
15531
15532 In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
15533 ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
15534 as 0 instead, but a tzinfo subclass wishing to participate in
15535 time zone conversion has to take a stand on whether it supports
15536 DST; if you don't care about DST, then code dst() to return 0 minutes,
15537 meaning that DST is never in effect).
15538
15539 The tzinfo methods utcoffset() and dst() must return a timedelta object
15540 (or None) now. In 2.3a1 they could also return an int or long, but that
15541 was an unhelpfully redundant leftover from an earlier version wherein
15542 they couldn't return a timedelta. TOOWTDI.
15543
15544 The example tzinfo class for local time had a bug. It was replaced
15545 by a later example coded by Guido.
15546
15547 datetime.astimezone(tz) no longer raises an exception when the
15548 input datetime has no UTC equivalent in tz. For typical "hybrid" time
15549 zones (a single tzinfo subclass modeling both standard and daylight
15550 time), this case can arise one hour per year, at the hour daylight time
15551 ends. See new docs for details. In short, the new behavior mimics
15552 the local wall clock's behavior of repeating an hour in local time.
15553
15554 dt.astimezone() can no longer be used to convert between naive and aware
15555 datetime objects. If you merely want to attach, or remove, a tzinfo
15556 object, without any conversion of date and time members, use
15557 dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
15558 tzinfo subclass instance.
15559
15560 A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
15561 to give complete control over how a UTC time is to be converted to
15562 a local time. The default astimezone() implementation calls fromutc()
15563 as its last step, so a tzinfo subclass can affect that too by overriding
15564 fromutc(). It's expected that the default fromutc() implementation will
15565 be suitable as-is for "almost all" time zone subclasses, but the
15566 creativity of political time zone fiddling appears unbounded -- fromutc()
15567 allows the highly motivated to emulate any scheme expressible in Python.
15568
15569 datetime.now(): The optional tzinfo argument was undocumented (that's
15570 repaired), and its name was changed to tz ("tzinfo" is overloaded enough
15571 already). With a tz argument, now(tz) used to return the local date
15572 and time, and attach tz to it, without any conversion of date and time
15573 members. This was less than useful. Now now(tz) returns the current
15574 date and time as local time in tz's time zone, akin to ::
15575
15576 tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
15577
15578 where "utc" is an instance of a tzinfo subclass modeling UTC. Without
15579 a tz argument, now() continues to return the current local date and time,
15580 as a naive datetime object.
15581
15582 datetime.fromtimestamp(): Like datetime.now() above, this had less than
15583 useful behavior when the optional tinzo argument was specified. See
15584 also SF bug report <http://www.python.org/sf/660872>.
15585
15586 date and datetime comparison: In order to prevent comparison from
15587 falling back to the default compare-object-addresses strategy, these
15588 raised TypeError whenever they didn't understand the other object type.
15589 They still do, except when the other object has a "timetuple" attribute,
15590 in which case they return NotImplemented now. This gives other
15591 datetime objects (e.g., mxDateTime) a chance to intercept the
15592 comparison.
15593
15594 date, time, datetime and timedelta comparison: When the exception
15595 for mixed-type comparisons in the last paragraph doesn't apply, if
15596 the comparison is == then False is returned, and if the comparison is
15597 != then True is returned. Because dict lookup and the "in" operator
15598 only invoke __eq__, this allows, for example, ::
15599
15600 if some_datetime in some_sequence:
15601
15602 and ::
15603
15604 some_dict[some_timedelta] = whatever
15605
15606 to work as expected, without raising TypeError just because the
15607 sequence is heterogeneous, or the dict has mixed-type keys. [This
15608 seems like a good idea to implement for all mixed-type comparisons
15609 that don't want to allow falling back to address comparison.]
15610
15611 The constructors building a datetime from a timestamp could raise
15612 ValueError if the platform C localtime()/gmtime() inserted "leap
15613 seconds". Leap seconds are ignored now. On such platforms, it's
15614 possible to have timestamps that differ by a second, yet where
15615 datetimes constructed from them are equal.
15616
15617 The pickle format of date, time and datetime objects has changed
15618 completely. The undocumented pickler and unpickler functions no
15619 longer exist. The undocumented __setstate__() and __getstate__()
15620 methods no longer exist either.
15621
15622Library
15623-------
15624
15625- The logging module was updated slightly; the WARN level was renamed
15626 to WARNING, and the matching function/method warn() to warning().
15627
15628- The pickle and cPickle modules were updated with a new pickling
15629 protocol (documented by pickletools.py, see below) and several
15630 extensions to the pickle customization API (__reduce__, __setstate__
15631 etc.). The copy module now uses more of the pickle customization
15632 API to copy objects that don't implement __copy__ or __deepcopy__.
15633 See PEP 307 for details.
15634
15635- The distutils "register" command now uses http://www.python.org/pypi
15636 as the default repository. (See PEP 301.)
15637
Skip Montanaro7a98be22007-08-16 14:35:24 +000015638- the platform dependent path related variables sep, altsep,
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015639 pathsep, curdir, pardir and defpath are now defined in the platform
15640 dependent path modules (e.g. ntpath.py) rather than os.py, so these
15641 variables are now available via os.path. They continue to be
15642 available from the os module.
15643 (see <http://www.python.org/sf/680789>).
15644
15645- array.array was added to the types repr.py knows about (see
15646 <http://www.python.org/sf/680789>).
15647
15648- The new pickletools.py contains lots of documentation about pickle
15649 internals, and supplies some helpers for working with pickles, such as
15650 a symbolic pickle disassembler.
15651
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015652- xmlrpclib.py now supports the built-in boolean type.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015653
15654- py_compile has a new 'doraise' flag and a new PyCompileError
15655 exception.
15656
15657- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
15658 class.
15659
15660- The sets module now raises TypeError in __cmp__, to clarify that
15661 sets are not intended to be three-way-compared; the comparison
15662 operators are overloaded as subset/superset tests.
15663
15664- Bastion.py and rexec.py are disabled. These modules are not safe in
15665 Python 2.2. or 2.3.
15666
15667- realpath is now exported when doing ``from poxixpath import *``.
15668 It is also exported for ntpath, macpath, and os2emxpath.
15669 See SF bug #659228.
15670
15671- New module tarfile from Lars Gustäbel provides a comprehensive interface
15672 to tar archive files with transparent gzip and bzip2 compression.
15673 See SF patch #651082.
15674
15675- urlparse can now parse imap:// URLs. See SF feature request #618024.
15676
15677- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
15678 the gain value which is passed to Tk. SF bug# 602259.
15679
15680- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
15681 See SF patch #642974.
15682
15683- The dospath module was deleted. Use the ntpath module when manipulating
15684 DOS paths from other platforms.
15685
15686Tools/Demos
15687-----------
15688
15689- Two new scripts (db2pickle.py and pickle2db.py) were added to the
15690 Tools/scripts directory to facilitate conversion from the old bsddb module
15691 to the new one. While the user-visible API of the new module is
15692 compatible with the old one, it's likely that the version of the
15693 underlying database library has changed. To convert from the old library,
15694 run the db2pickle.py script using the old version of Python to convert it
15695 to a pickle file. After upgrading Python, run the pickle2db.py script
15696 using the new version of Python to reconstitute your database. For
15697 example:
15698
15699 % python2.2 db2pickle.py -h some.db > some.pickle
15700 % python2.3 pickle2db.py -h some.db.new < some.pickle
15701
15702 Run the scripts without any args to get a usage message.
15703
15704
15705Build
15706-----
15707
15708- The audio driver tests (test_ossaudiodev.py and
15709 test_linuxaudiodev.py) are no longer run by default. This is
15710 because they don't always work, depending on your hardware and
15711 software. To run these tests, you must use an invocation like ::
15712
15713 ./python Lib/test/regrtest.py -u audio test_ossaudiodev
15714
15715- On systems which build using the configure script, compiler flags which
15716 used to be lumped together using the OPT flag have been split into two
15717 groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
15718 debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
15719 compiler flags that are required to get a clean compile. On some
15720 platforms (many Linux flavors in particular) BASECFLAGS will be empty by
15721 default. On others, such as Mac OS X and SCO, it will contain required
15722 flags. This change allows people building Python to override OPT without
15723 fear of clobbering compiler flags which are required to get a clean build.
15724
15725- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
15726 relevant search lists in setup.py. This allows users building Python to
15727 take advantage of the many packages available from the fink project
15728 <http://fink.sf.net/>.
15729
15730- A new Makefile target, scriptsinstall, installs a number of useful scripts
15731 from the Tools/scripts directory.
15732
15733C API
15734-----
15735
15736- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
15737 instead of a plain ``PyObject *``. (SF patch #686601.)
15738
15739- PyNumber_Check() now checks that the object has a nb_int or nb_float
15740 slot, rather than simply checking whether it has a non-NULL
15741 tp_as_number pointer.
15742
15743- A C type that inherits from a base type that defines tp_as_buffer
15744 will now inherit the tp_as_buffer pointer if it doesn't define one.
15745 (SF #681367)
15746
15747- The PyArg_Parse functions now issue a DeprecationWarning if a float
15748 argument is provided when an integer is specified (this affects the 'b',
15749 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
15750 raise a TypeError.
15751
15752Tests
15753-----
15754
15755- Several tests weren't being run from regrtest.py (test_timeout.py,
15756 test_tarfile.py, test_netrc.py, test_multifile.py,
15757 test_importhooks.py and test_imp.py). Now they are. (Note to
15758 developers: please read Lib/test/README when creating a new test, to
15759 make sure to do it right! All tests need to use either unittest or
15760 pydoc.)
15761
15762- Added test_posix.py, a test suite for the posix module.
15763
15764- Added test_hexoct.py, a test suite for hex/oct constant folding.
15765
15766Windows
15767-------
15768
15769- The timeout code for socket connect() didn't work right; this has
15770 now been fixed. test_timeout.py should pass (at least most of the
15771 time).
15772
15773- distutils' msvccompiler class now passes the preprocessor options to
15774 the resource compiler. See SF patch #669198.
15775
15776- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
15777 release without strong cryptography.
15778
15779- sys.path[0], if it contains a directory name, is now always an
15780 absolute pathname. (SF patch #664376.)
15781
15782- The new logging package is now installed by the Windows installer. It
15783 wasn't in 2.3a1 due to oversight.
15784
15785Mac
15786---
15787
15788- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
15789 and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
15790
15791- Most of the standard library now uses pathnames or FSRefs in preference
15792 of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
15793 in stead of macfs. macfs will probably be deprecated in the future.
15794
15795- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
15796 This also makes macfs.FSSpec.SetDates() work again.
15797
15798- There is a new module pimp, the package install manager for Python, and
15799 accompanying applet PackageManager. These allow you to easily download
15800 and install pretested extension packages either in source or binary
15801 form. Only in MacPython-OSX.
15802
15803- Applets are now built with bundlebuilder in MacPython-OSX, which should make
15804 them more robust and also provides a path towards BuildApplication. The
15805 downside of this change is that applets can no longer be run from the
15806 Terminal window, this will hopefully be fixed in the 2.3b1.
15807
15808
15809What's New in Python 2.3 alpha 1?
15810=================================
15811
15812*Release date: 31-Dec-2002*
15813
15814Type/class unification and new-style classes
15815--------------------------------------------
15816
15817- One can now assign to __bases__ and __name__ of new-style classes.
15818
15819- dict() now accepts keyword arguments so that dict(one=1, two=2)
15820 is the equivalent of {"one": 1, "two": 2}. Accordingly,
15821 the existing (but undocumented) 'items' keyword argument has
15822 been eliminated. This means that dict(items=someMapping) now has
15823 a different meaning than before.
15824
15825- int() now returns a long object if the argument is outside the
15826 integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
15827 all return long objects instead of raising an OverflowError.
15828
15829- Assignment to __class__ is disallowed if either the old or the new
15830 class is a statically allocated type object (such as defined by an
15831 extension module). This prevents anomalies like 2.__class__ = bool.
15832
15833- New-style object creation and deallocation have been sped up
15834 significantly; they are now faster than classic instance creation
15835 and deallocation.
15836
15837- The __slots__ variable can now mention "private" names, and the
15838 right thing will happen (e.g. __slots__ = ["__foo"]).
15839
15840- The built-ins slice() and buffer() are now callable types. The
15841 types classobj (formerly class), code, function, instance, and
15842 instancemethod (formerly instance-method), which have no built-in
15843 names but are accessible through the types module, are now also
15844 callable. The type dict-proxy is renamed to dictproxy.
15845
15846- Cycles going through the __class__ link of a new-style instance are
15847 now detected by the garbage collector.
15848
15849- Classes using __slots__ are now properly garbage collected.
15850 [SF bug 519621]
15851
15852- Tightened the __slots__ rules: a slot name must be a valid Python
15853 identifier.
15854
15855- The constructor for the module type now requires a name argument and
15856 takes an optional docstring argument. Previously, this constructor
15857 ignored its arguments. As a consequence, deriving a class from a
15858 module (not from the module type) is now illegal; previously this
15859 created an unnamed module, just like invoking the module type did.
15860 [SF bug 563060]
15861
15862- A new type object, 'basestring', is added. This is a common base type
15863 for 'str' and 'unicode', and can be used instead of
15864 types.StringTypes, e.g. to test whether something is "a string":
15865 isinstance(x, basestring) is True for Unicode and 8-bit strings. This
15866 is an abstract base class and cannot be instantiated directly.
15867
15868- Changed new-style class instantiation so that when C's __new__
15869 method returns something that's not a C instance, its __init__ is
15870 not called. [SF bug #537450]
15871
15872- Fixed super() to work correctly with class methods. [SF bug #535444]
15873
15874- If you try to pickle an instance of a class that has __slots__ but
15875 doesn't define or override __getstate__, a TypeError is now raised.
15876 This is done by adding a bozo __getstate__ to the class that always
15877 raises TypeError. (Before, this would appear to be pickled, but the
15878 state of the slots would be lost.)
15879
15880Core and builtins
15881-----------------
15882
15883- Import from zipfiles is now supported. The name of a zipfile placed
15884 on sys.path causes the import statement to look for importable Python
15885 modules (with .py, pyc and .pyo extensions) and packages inside the
15886 zipfile. The zipfile import follows the specification (though not
15887 the sample implementation) of PEP 273. The semantics of __path__ are
15888 compatible with those that have been implemented in Jython since
15889 Jython 2.1.
15890
15891- PEP 302 has been accepted. Although it was initially developed to
15892 support zipimport, it offers a new, general import hook mechanism.
15893 Several new variables have been added to the sys module:
15894 sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
15895 make extending the import statement much more convenient than
15896 overriding the __import__ built-in function. For a description of
15897 these, see PEP 302.
15898
15899- A frame object's f_lineno attribute can now be written to from a
15900 trace function to change which line will execute next. A command to
15901 exploit this from pdb has been added. [SF patch #643835]
15902
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015903- The _codecs support module for codecs.py was turned into a built-in
15904 module to assure that at least the built-in codecs are available
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015905 to the Python parser for source code decoding according to PEP 263.
15906
15907- issubclass now supports a tuple as the second argument, just like
15908 isinstance does. ``issubclass(X, (A, B))`` is equivalent to
15909 ``issubclass(X, A) or issubclass(X, B)``.
15910
15911- Thanks to Armin Rigo, the last known way to provoke a system crash
15912 by cleverly arranging for a comparison function to mutate a list
15913 during a list.sort() operation has been fixed. The effect of
15914 attempting to mutate a list, or even to inspect its contents or
15915 length, while a sort is in progress, is not defined by the language.
15916 The C implementation of Python 2.3 attempts to detect mutations,
15917 and raise ValueError if one occurs, but there's no guarantee that
15918 all mutations will be caught, or that any will be caught across
15919 releases or implementations.
15920
15921- Unicode file name processing for Windows (PEP 277) is implemented.
15922 All platforms now have an os.path.supports_unicode_filenames attribute,
15923 which is set to True on Windows NT/2000/XP, and False elsewhere.
15924
15925- Codec error handling callbacks (PEP 293) are implemented.
15926 Error handling in unicode.encode or str.decode can now be customized.
15927
15928- A subtle change to the semantics of the built-in function intern():
15929 interned strings are no longer immortal. You must keep a reference
15930 to the return value intern() around to get the benefit.
15931
15932- Use of 'None' as a variable, argument or attribute name now
15933 issues a SyntaxWarning. In the future, None may become a keyword.
15934
15935- SET_LINENO is gone. co_lnotab is now consulted to determine when to
15936 call the trace function. C code that accessed f_lineno should call
15937 PyCode_Addr2Line instead (f_lineno is still there, but only kept up
15938 to date when there is a trace function set).
15939
15940- There's a new warning category, FutureWarning. This is used to warn
15941 about a number of situations where the value or sign of an integer
15942 result will change in Python 2.4 as a result of PEP 237 (integer
15943 unification). The warnings implement stage B0 mentioned in that
15944 PEP. The warnings are about the following situations:
15945
15946 - Octal and hex literals without 'L' prefix in the inclusive range
15947 [0x80000000..0xffffffff]; these are currently negative ints, but
15948 in Python 2.4 they will be positive longs with the same bit
15949 pattern.
15950
15951 - Left shifts on integer values that cause the outcome to lose
15952 bits or have a different sign than the left operand. To be
15953 precise: x<<n where this currently doesn't yield the same value
15954 as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
15955
15956 - Conversions from ints to string that show negative values as
15957 unsigned ints in the inclusive range [0x80000000..0xffffffff];
15958 this affects the functions hex() and oct(), and the string
15959 formatting codes %u, %o, %x, and %X. In Python 2.4, these will
15960 show signed values (e.g. hex(-1) currently returns "0xffffffff";
15961 in Python 2.4 it will return "-0x1").
15962
15963- The bits manipulated under the cover by sys.setcheckinterval() have
15964 been changed. Both the check interval and the ticker used to be
15965 per-thread values. They are now just a pair of global variables.
15966 In addition, the default check interval was boosted from 10 to 100
15967 bytecode instructions. This may have some effect on systems that
15968 relied on the old default value. In particular, in multi-threaded
15969 applications which try to be highly responsive, response time will
15970 increase by some (perhaps imperceptible) amount.
15971
15972- When multiplying very large integers, a version of the so-called
15973 Karatsuba algorithm is now used. This is most effective if the
15974 inputs have roughly the same size. If they both have about N digits,
15975 Karatsuba multiplication has O(N**1.58) runtime (the exponent is
15976 log_base_2(3)) instead of the previous O(N**2). Measured results may
15977 be better or worse than that, depending on platform quirks. Besides
15978 the O() improvement in raw instruction count, the Karatsuba algorithm
15979 appears to have much better cache behavior on extremely large integers
15980 (starting in the ballpark of a million bits). Note that this is a
15981 simple implementation, and there's no intent here to compete with,
15982 e.g., GMP. It gives a very nice speedup when it applies, but a package
15983 devoted to fast large-integer arithmetic should run circles around it.
15984
15985- u'%c' will now raise a ValueError in case the argument is an
15986 integer outside the valid range of Unicode code point ordinals.
15987
15988- The tempfile module has been overhauled for enhanced security. The
15989 mktemp() function is now deprecated; new, safe replacements are
15990 mkstemp() (for files) and mkdtemp() (for directories), and the
15991 higher-level functions NamedTemporaryFile() and TemporaryFile().
15992 Use of some global variables in this module is also deprecated; the
15993 new functions have keyword arguments to provide the same
15994 functionality. All Lib, Tools and Demo modules that used the unsafe
15995 interfaces have been updated to use the safe replacements. Thanks
15996 to Zack Weinberg!
15997
15998- When x is an object whose class implements __mul__ and __rmul__,
15999 1.0*x would correctly invoke __rmul__, but 1*x would erroneously
16000 invoke __mul__. This was due to the sequence-repeat code in the int
16001 type. This has been fixed now.
16002
16003- Previously, "str1 in str2" required str1 to be a string of length 1.
16004 This restriction has been relaxed to allow str1 to be a string of
16005 any length. Thus "'el' in 'hello world'" returns True now.
16006
16007- File objects are now their own iterators. For a file f, iter(f) now
16008 returns f (unless f is closed), and f.next() is similar to
16009 f.readline() when EOF is not reached; however, f.next() uses a
16010 readahead buffer that messes up the file position, so mixing
16011 f.next() and f.readline() (or other methods) doesn't work right.
16012 Calling f.seek() drops the readahead buffer, but other operations
16013 don't. It so happens that this gives a nice additional speed boost
16014 to "for line in file:"; the xreadlines method and corresponding
16015 module are now obsolete. Thanks to Oren Tirosh!
16016
16017- Encoding declarations (PEP 263, phase 1) have been implemented. A
16018 comment of the form "# -*- coding: <encodingname> -*-" in the first
16019 or second line of a Python source file indicates the encoding.
16020
16021- list.sort() has a new implementation. While cross-platform results
16022 may vary, and in data-dependent ways, this is much faster on many
16023 kinds of partially ordered lists than the previous implementation,
16024 and reported to be just as fast on randomly ordered lists on
16025 several major platforms. This sort is also stable (if A==B and A
16026 precedes B in the list at the start, A precedes B after the sort too),
16027 although the language definition does not guarantee stability. A
16028 potential drawback is that list.sort() may require temp space of
16029 len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
16030 for list.sort() to raise MemoryError now, even if a comparison function
16031 does not. See <http://www.python.org/sf/587076> for full details.
16032
16033- All standard iterators now ensure that, once StopIteration has been
16034 raised, all future calls to next() on the same iterator will also
16035 raise StopIteration. There used to be various counterexamples to
16036 this behavior, which could caused confusion or subtle program
16037 breakage, without any benefits. (Note that this is still an
16038 iterator's responsibility; the iterator framework does not enforce
16039 this.)
16040
16041- Ctrl+C handling on Windows has been made more consistent with
16042 other platforms. KeyboardInterrupt can now reliably be caught,
16043 and Ctrl+C at an interactive prompt no longer terminates the
16044 process under NT/2k/XP (it never did under Win9x). Ctrl+C will
16045 interrupt time.sleep() in the main thread, and any child processes
16046 created via the popen family (on win2k; we can't make win9x work
16047 reliably) are also interrupted (as generally happens on for Linux/Unix.)
16048 [SF bugs 231273, 439992 and 581232]
16049
16050- sys.getwindowsversion() has been added on Windows. This
16051 returns a tuple with information about the version of Windows
16052 currently running.
16053
16054- Slices and repetitions of buffer objects now consistently return
16055 a string. Formerly, strings would be returned most of the time,
16056 but a buffer object would be returned when the repetition count
16057 was one or when the slice range was all inclusive.
16058
16059- Unicode objects in sys.path are no longer ignored but treated
16060 as directory names.
16061
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016062- Fixed string.startswith and string.endswith built-in methods
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016063 so they accept negative indices. [SF bug 493951]
16064
16065- Fixed a bug with a continue inside a try block and a yield in the
16066 finally clause. [SF bug 567538]
16067
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016068- Most built-in sequences now support "extended slices", i.e. slices
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016069 with a third "stride" parameter. For example, "hello world"[::-1]
16070 gives "dlrow olleh".
16071
16072- A new warning PendingDeprecationWarning was added to provide
16073 direction on features which are in the process of being deprecated.
16074 The warning will not be printed by default. To see the pending
16075 deprecations, use -Walways::PendingDeprecationWarning::
16076 as a command line option or warnings.filterwarnings() in code.
16077
16078- Deprecated features of xrange objects have been removed as
16079 promised. The start, stop, and step attributes and the tolist()
16080 method no longer exist. xrange repetition and slicing have been
16081 removed.
16082
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016083- New built-in function enumerate(x), from PEP 279. Example:
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016084 enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
16085 The argument can be an arbitrary iterable object.
16086
16087- The assert statement no longer tests __debug__ at runtime. This means
16088 that assert statements cannot be disabled by assigning a false value
16089 to __debug__.
16090
16091- A method zfill() was added to str and unicode, that fills a numeric
16092 string to the left with zeros. For example,
16093 "+123".zfill(6) -> "+00123".
16094
16095- Complex numbers supported divmod() and the // and % operators, but
16096 these make no sense. Since this was documented, they're being
16097 deprecated now.
16098
16099- String and unicode methods lstrip(), rstrip() and strip() now take
16100 an optional argument that specifies the characters to strip. For
16101 example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
16102
16103- There's a new dictionary constructor (a class method of the dict
16104 class), dict.fromkeys(iterable, value=None). It constructs a
16105 dictionary with keys taken from the iterable and all values set to a
16106 single value. It can be used for building sets and for removing
16107 duplicates from sequences.
16108
16109- Added a new dict method pop(key). This removes and returns the
16110 value corresponding to key. [SF patch #539949]
16111
16112- A new built-in type, bool, has been added, as well as built-in
16113 names for its two values, True and False. Comparisons and sundry
16114 other operations that return a truth value have been changed to
16115 return a bool instead. Read PEP 285 for an explanation of why this
16116 is backward compatible.
16117
16118- Fixed two bugs reported as SF #535905: under certain conditions,
16119 deallocating a deeply nested structure could cause a segfault in the
16120 garbage collector, due to interaction with the "trashcan" code;
16121 access to the current frame during destruction of a local variable
16122 could access a pointer to freed memory.
16123
16124- The optional object allocator ("pymalloc") has been enabled by
16125 default. The recommended practice for memory allocation and
16126 deallocation has been streamlined. A header file is included,
16127 Misc/pymemcompat.h, which can be bundled with 3rd party extensions
16128 and lets them use the same API with Python versions from 1.5.2
16129 onwards.
16130
16131- PyErr_Display will provide file and line information for all exceptions
16132 that have an attribute print_file_and_line, not just SyntaxErrors.
16133
16134- The UTF-8 codec will now encode and decode Unicode surrogates
16135 correctly and without raising exceptions for unpaired ones.
16136
16137- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
16138 instead of 'r' when opening a text file for reading changes the line
16139 ending convention so that any of '\r', '\r\n', and '\n' is
16140 recognized (even mixed in one file); all three are converted to
16141 '\n', the standard Python line end character.
16142
16143- file.xreadlines() now raises a ValueError if the file is closed:
16144 Previously, an xreadlines object was returned which would raise
16145 a ValueError when the xreadlines.next() method was called.
16146
16147- sys.exit() inadvertently allowed more than one argument.
16148 An exception will now be raised if more than one argument is used.
16149
16150- Changed evaluation order of dictionary literals to conform to the
16151 general left to right evaluation order rule. Now {f1(): f2()} will
16152 evaluate f1 first.
16153
16154- Fixed bug #521782: when a file was in non-blocking mode, file.read()
16155 could silently lose data or wrongly throw an unknown error.
16156
16157- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
16158 slots are now always tried after trying the corresponding nb_* slots.
16159 This fixes a number of minor bugs (see bug #624807).
16160
16161- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
16162
16163Extension modules
16164-----------------
16165
16166- Added three operators to the operator module:
16167 operator.pow(a,b) which is equivalent to: a**b.
16168 operator.is_(a,b) which is equivalent to: a is b.
16169 operator.is_not(a,b) which is equivalent to: a is not b.
16170
16171- posix.openpty now works on all systems that have /dev/ptmx.
16172
16173- A module zipimport exists to support importing code from zip
16174 archives.
16175
16176- The new datetime module supplies classes for manipulating dates and
16177 times. The basic design came from the Zope "fishbowl process", and
16178 favors practical commercial applications over calendar esoterica. See
16179
16180 http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
16181
16182- _tkinter now returns Tcl objects, instead of strings. Objects which
16183 have Python equivalents are converted to Python objects, other objects
16184 are wrapped. This can be configured through the wantobjects method,
16185 or Tkinter.wantobjects.
16186
16187- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
16188 been added as the package bsddb. The traditional bsddb module is
16189 still available in source code, but not built automatically anymore,
16190 and is now named bsddb185. This supports Berkeley DB versions from
16191 3.0 to 4.1. For help converting your databases from the old module (which
16192 probably used an obsolete version of Berkeley DB) to the new module, see
16193 the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
16194 section above.
16195
16196- unicodedata was updated to Unicode 3.2. It supports normalization
16197 and names for Hangul syllables and CJK unified ideographs.
16198
16199- resource.getrlimit() now returns longs instead of ints.
16200
16201- readline now dynamically adjusts its input/output stream if
16202 sys.stdin/stdout changes.
16203
16204- The _tkinter module (and hence Tkinter) has dropped support for
16205 Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
16206 supported.
16207
16208- cPickle.BadPickleGet is now a class.
16209
16210- The time stamps in os.stat_result are floating point numbers
16211 after stat_float_times has been called.
16212
16213- If the size passed to mmap.mmap() is larger than the length of the
16214 file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
16215
16216- The xreadlines module is slated for obsolescence.
16217
16218- The strptime function in the time module is now always available (a
16219 Python implementation is used when the C library doesn't define it).
16220
16221- The 'new' module is no longer an extension, but a Python module that
16222 only exists for backwards compatibility. Its contents are no longer
16223 functions but callable type objects.
16224
16225- The bsddb.*open functions can now take 'None' as a filename.
16226 This will create a temporary in-memory bsddb that won't be
16227 written to disk.
16228
16229- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
16230 posix.getpgid have been added where available.
16231
16232- The locale module now exposes the C library's gettext interface. It
16233 also has a new function getpreferredencoding.
16234
16235- A security hole ("double free") was found in zlib-1.1.3, a popular
16236 third party compression library used by some Python modules. The
16237 hole was quickly plugged in zlib-1.1.4, and the Windows build of
16238 Python now ships with zlib-1.1.4.
16239
16240- pwd, grp, and resource return enhanced tuples now, with symbolic
16241 field names.
16242
16243- array.array is now a type object. A new format character
16244 'u' indicates Py_UNICODE arrays. For those, .tounicode and
16245 .fromunicode methods are available. Arrays now support __iadd__
16246 and __imul__.
16247
16248- dl now builds on every system that has dlfcn.h. Failure in case
16249 of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
16250 is called.
16251
16252- The sys module acquired a new attribute, api_version, which evaluates
16253 to the value of the PYTHON_API_VERSION macro with which the
16254 interpreter was compiled.
16255
16256- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
16257 when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
16258 returns (None, None, 'ab'), as expected. Also fixed handling of
16259 lastindex/lastgroup match attributes in similar cases. For example,
16260 when running the expression r'(a)(b)?b' over 'ab', lastindex must be
16261 1, not 2.
16262
16263- Fixed bug #581080: sre scanner was not checking the buffer limit
16264 before increasing the current pointer. This was creating an infinite
16265 loop in the search function, once the pointer exceeded the buffer
16266 limit.
16267
16268- The os.fdopen function now enforces a file mode starting with the
16269 letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
16270 bug #623464.
16271
16272- The linuxaudiodev module is now deprecated; it is being replaced by
16273 ossaudiodev. The interface has been extended to cover a lot more of
16274 OSS (see www.opensound.com), including most DSP ioctls and the
16275 OSS mixer API. Documentation forthcoming in 2.3a2.
16276
16277Library
16278-------
16279
16280- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
16281
16282- Freeze's modulefinder.py has been moved to the standard library;
16283 slightly improved so it will issue less false missing submodule
16284 reports (see sf path #643711 for details). Documentation will follow
16285 with Python 2.3a2.
16286
16287- os.path exposes getctime.
16288
16289- unittest.py now has two additional methods called assertAlmostEqual()
16290 and failIfAlmostEqual(). They implement an approximate comparison
16291 by rounding the difference between the two arguments and comparing
16292 the result to zero. Approximate comparison is essential for
16293 unit tests of floating point results.
16294
16295- calendar.py now depends on the new datetime module rather than
16296 the time module. As a result, the range of allowable dates
16297 has been increased.
16298
16299- pdb has a new 'j(ump)' command to select the next line to be
16300 executed.
16301
16302- The distutils created windows installers now can run a
16303 postinstallation script.
16304
16305- doctest.testmod can now be called without argument, which means to
16306 test the current module.
16307
16308- When canceling a server that implemented threading with a keyboard
16309 interrupt, the server would shut down but not terminate (waiting on
16310 client threads). A new member variable, daemon_threads, was added to
16311 the ThreadingMixIn class in SocketServer.py to make it explicit that
16312 this behavior needs to be controlled.
16313
16314- A new module, optparse, provides a fancy alternative to getopt for
16315 command line parsing. It is a slightly modified version of Greg
16316 Ward's Optik package.
16317
16318- UserDict.py now defines a DictMixin class which defines all dictionary
16319 methods for classes that already have a minimum mapping interface.
16320 This greatly simplifies writing classes that need to be substitutable
16321 for dictionaries (such as the shelve module).
16322
16323- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
16324 all dictionary methods. This eases the transition to persistent
16325 storage for scripts originally written with dictionaries in mind.
16326
16327- shelve.open and the various classes in shelve.py now accept an optional
16328 binary flag, which defaults to False. If True, the values stored in the
16329 shelf are binary pickles.
16330
16331- A new package, logging, implements the logging API defined by PEP
16332 282. The code is written by Vinay Sajip.
16333
16334- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
16335 modules are iterators now.
16336
16337- gzip.py now handles files exceeding 2GB. Files over 4GB also work
16338 now (provided the OS supports it, and Python is configured with large
16339 file support), but in that case the underlying gzip file format can
16340 record only the least-significant 32 bits of the file size, so that
16341 some tools working with gzipped files may report an incorrect file
16342 size.
16343
16344- xml.sax.saxutils.unescape has been added, to replace entity references
16345 with their entity value.
16346
16347- Queue.Queue.{put,get} now support an optional timeout argument.
16348
16349- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
16350 option of tkFileDialog is exposed as function askopenfile{,name}s.
16351
16352- Various configure methods of Tkinter have been stream-lined, so that
16353 tag_configure, image_configure, window_configure now return a
16354 dictionary when invoked with no argument.
16355
16356- Importing the readline module now no longer has the side effect of
16357 calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
16358 whatever locale is explicitly set by the user, is preserved. If you
16359 want repr() of 8-bit strings in your preferred encoding to preserve
16360 all printable characters of that encoding, you have to add the
16361 following code to your $PYTHONSTARTUP file or to your application's
16362 main():
16363
16364 import locale
16365 locale.setlocale(locale.LC_CTYPE, "")
16366
16367- shutil.move was added. shutil.copytree now reports errors as an
16368 exception at the end, instead of printing error messages.
16369
16370- Encoding name normalization was generalized to not only
16371 replace hyphens with underscores, but also all other non-alphanumeric
16372 characters (with the exception of the dot which is used for Python
16373 package names during lookup). The aliases.py mapping was updated
16374 to the new standard.
16375
16376- mimetypes has two new functions: guess_all_extensions() which
16377 returns a list of all known extensions for a mime type, and
16378 add_type() which adds one mapping between a mime type and
16379 an extension to the database.
16380
16381- New module: sets, defines the class Set that implements a mutable
16382 set type using the keys of a dict to represent the set. There's
16383 also a class ImmutableSet which is useful when you need sets of sets
16384 or when you need to use sets as dict keys, and a class BaseSet which
16385 is the base class of the two.
16386
16387- Added random.sample(population,k) for random sampling without replacement.
16388 Returns a k length list of unique elements chosen from the population.
16389
16390- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
16391 OverflowError. That is, it now accepts any combination of 'start'
16392 and 'stop' arguments so long as each is in the range of Python's
16393 bounded integers.
16394
16395- Thanks to Raymond Hettinger, random.random() now uses a new core
16396 generator. The Mersenne Twister algorithm is implemented in C,
16397 threadsafe, faster than the previous generator, has an astronomically
16398 large period (2**19937-1), creates random floats to full 53-bit
16399 precision, and may be the most widely tested random number generator
16400 in existence.
16401
16402 The random.jumpahead(n) method has different semantics for the new
16403 generator. Instead of jumping n steps ahead, it uses n and the
16404 existing state to create a new state. This means that jumpahead()
16405 continues to support multi-threaded code needing generators of
16406 non-overlapping sequences. However, it will break code which relies
16407 on jumpahead moving a specific number of steps forward.
16408
16409 The attributes random.whseed and random.__whseed have no meaning for
16410 the new generator. Code using these attributes should switch to a
16411 new class, random.WichmannHill which is provided for backward
16412 compatibility and to make an alternate generator available.
16413
16414- New "algorithms" module: heapq, implements a heap queue. Thanks to
16415 Kevin O'Connor for the code and François Pinard for an entertaining
16416 write-up explaining the theory and practical uses of heaps.
16417
16418- New encoding for the Palm OS character set: palmos.
16419
16420- binascii.crc32() and the zipfile module had problems on some 64-bit
16421 platforms. These have been fixed. On a platform with 8-byte C longs,
16422 crc32() now returns a signed-extended 4-byte result, so that its value
16423 as a Python int is equal to the value computed a 32-bit platform.
16424
16425- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
16426 argument.
16427
16428- Some fixes in the copy module: when an object is copied through its
16429 __reduce__ method, there was no check for a __setstate__ method on
16430 the result [SF patch 565085]; deepcopy should treat instances of
16431 custom metaclasses the same way it treats instances of type 'type'
16432 [SF patch 560794].
16433
16434- Sockets now support timeout mode. After s.settimeout(T), where T is
16435 a float expressing seconds, subsequent operations raise an exception
16436 if they cannot be completed within T seconds. To disable timeout
16437 mode, use s.settimeout(None). There's also a module function,
16438 socket.setdefaulttimeout(T), which sets the default for all sockets
16439 created henceforth.
16440
16441- getopt.gnu_getopt was added. This supports GNU-style option
16442 processing, where options can be mixed with non-option arguments.
16443
16444- Stop using strings for exceptions. String objects used for
16445 exceptions are now classes deriving from Exception. The objects
16446 changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
16447 tabnanny.NannyNag, and xdrlib.Error.
16448
16449- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
16450 BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
16451 Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
16452 big endian systems were added to the codecs module. The old names
16453 BOM32_* and BOM64_* were off by a factor of 2.
16454
16455- Added conversion functions math.degrees() and math.radians().
16456
16457- math.log() now takes an optional argument: math.log(x[, base]).
16458
16459- ftplib.retrlines() now tests for callback is None rather than testing
16460 for False. Was causing an error when given a callback object which
16461 was callable but also returned len() as zero. The change may
16462 create new breakage if the caller relied on the undocumented behavior
16463 and called with callback set to [] or some other False value not
16464 identical to None.
16465
16466- random.gauss() uses a piece of hidden state used by nothing else,
16467 and the .seed() and .whseed() methods failed to reset it. In other
16468 words, setting the seed didn't completely determine the sequence of
16469 results produced by random.gauss(). It does now. Programs repeatedly
16470 mixing calls to a seed method with calls to gauss() may see different
16471 results now.
16472
16473- The pickle.Pickler class grew a clear_memo() method to mimic that
16474 provided by cPickle.Pickler.
16475
16476- difflib's SequenceMatcher class now does a dynamic analysis of
16477 which elements are so frequent as to constitute noise. For
16478 comparing files as sequences of lines, this generally works better
16479 than the IS_LINE_JUNK function, and function ndiff's linejunk
16480 argument defaults to None now as a result. A happy benefit is
16481 that SequenceMatcher may run much faster now when applied
16482 to large files with many duplicate lines (for example, C program
16483 text with lots of repeated "}" and "return NULL;" lines).
16484
16485- New Text.dump() method in Tkinter module.
16486
16487- New distutils commands for building packagers were added to
16488 support pkgtool on Solaris and swinstall on HP-UX.
16489
16490- distutils now has a new abstract binary packager base class
16491 command/bdist_packager, which simplifies writing packagers.
16492 This will hopefully provide the missing bits to encourage
16493 people to submit more packagers, e.g. for Debian, FreeBSD
16494 and other systems.
16495
16496- The UTF-16, -LE and -BE stream readers now raise a
16497 NotImplementedError for all calls to .readline(). Previously, they
16498 used to just produce garbage or fail with an encoding error --
16499 UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
16500 work well with these.
16501
16502- compileall now supports quiet operation.
16503
16504- The BaseHTTPServer now implements optional HTTP/1.1 persistent
16505 connections.
16506
16507- socket module: the SSL support was broken out of the main
16508 _socket module C helper and placed into a new _ssl helper
16509 which now gets imported by socket.py if available and working.
16510
16511- encodings package: added aliases for all supported IANA character
16512 sets
16513
16514- ftplib: to safeguard the user's privacy, anonymous login will use
16515 "anonymous@" as default password, rather than the real user and host
16516 name.
16517
16518- webbrowser: tightened up the command passed to os.system() so that
16519 arbitrary shell code can't be executed because a bogus URL was
16520 passed in.
16521
16522- gettext.translation has an optional fallback argument, and
16523 gettext.find an optional all argument. Translations will now fallback
16524 on a per-message basis. The module supports plural forms, by means
16525 of gettext.[d]ngettext and Translation.[u]ngettext.
16526
16527- distutils bdist commands now offer a --skip-build option.
16528
16529- warnings.warn now accepts a Warning instance as first argument.
16530
16531- The xml.sax.expatreader.ExpatParser class will no longer create
16532 circular references by using itself as the locator that gets passed
16533 to the content handler implementation. [SF bug #535474]
16534
16535- The email.Parser.Parser class now properly parses strings regardless
16536 of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
16537 or CRLF). Also, the Header class's constructor default arguments
16538 has changed slightly so that an explicit maxlinelen value is always
16539 honored, and so unicode conversion error handling can be specified.
16540
16541- distutils' build_ext command now links C++ extensions with the C++
16542 compiler available in the Makefile or CXX environment variable, if
16543 running under \*nix.
16544
16545- New module bz2: provides a comprehensive interface for the bz2 compression
16546 library. It implements a complete file interface, one-shot (de)compression
16547 functions, and types for sequential (de)compression.
16548
16549- New pdb command 'pp' which is like 'p' except that it pretty-prints
16550 the value of its expression argument.
16551
16552- Now bdist_rpm distutils command understands a verify_script option in
16553 the config file, including the contents of the referred filename in
16554 the "%verifyscript" section of the rpm spec file.
16555
16556- Fixed bug #495695: webbrowser module would run graphic browsers in a
16557 unix environment even if DISPLAY was not set. Also, support for
16558 skipstone browser was included.
16559
16560- Fixed bug #636769: rexec would run unallowed code if subclasses of
16561 strings were used as parameters for certain functions.
16562
16563Tools/Demos
16564-----------
16565
16566- pygettext.py now supports globbing on Windows, and accepts module
16567 names in addition to accepting file names.
16568
16569- The SGI demos (Demo/sgi) have been removed. Nobody thought they
16570 were interesting any more. (The SGI library modules and extensions
16571 are still there; it is believed that at least some of these are
16572 still used and useful.)
16573
16574- IDLE supports the new encoding declarations (PEP 263); it can also
16575 deal with legacy 8-bit files if they use the locale's encoding. It
16576 allows non-ASCII strings in the interactive shell and executes them
16577 in the locale's encoding.
16578
16579- freeze.py now produces binaries which can import shared modules,
16580 unlike before when this failed due to missing symbol exports in
16581 the generated binary.
16582
16583Build
16584-----
16585
16586- On Unix, IDLE is now installed automatically.
16587
16588- The fpectl module is not built by default; it's dangerous or useless
16589 except in the hands of experts.
16590
16591- The public Python C API will generally be declared using PyAPI_FUNC
16592 and PyAPI_DATA macros, while Python extension module init functions
16593 will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
16594 are deprecated.
16595
16596- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
16597 get into infinite loops, when a new-style class got garbage-collected.
16598 Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
16599 that new-style classes be immortal in COUNT_ALLOCS builds. Note that
16600 COUNT_ALLOCS is not enabled by default, in either release or debug
16601 builds, and that new-style classes are immortal only in COUNT_ALLOCS
16602 builds.
16603
16604- Compiling out the cyclic garbage collector is no longer an option.
16605 The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
16606 that it's always defined (for the benefit of any extension modules
16607 that may be conditionalizing on it). A bonus is that any extension
16608 type participating in cyclic gc can choose to participate in the
16609 Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
16610 to require editing the core to teach the trashcan mechanism about the
16611 new type.
16612
16613- According to Annex F of the current C standard,
16614
16615 The Standard C macro HUGE_VAL and its float and long double analogs,
16616 HUGE_VALF and HUGE_VALL, expand to expressions whose values are
16617 positive infinities.
16618
16619 Python only uses the double HUGE_VAL, and only to #define its own symbol
16620 Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
16621 pyport.h used to try to worm around that, but the workarounds triggered
16622 other bugs on other platforms, so we gave up. If your platform defines
16623 HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
16624 that works on your platform. The only instance of this I'm sure about
16625 is on an unknown subset of Cray systems, described here:
16626
16627 http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
16628
16629 Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
16630
16631- The configure option --without-doc-strings can be used to remove the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016632 doc strings from the built-in functions and modules; this reduces the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016633 size of the executable.
16634
16635- The universal newlines option (PEP 278) is on by default. On Unix
16636 it can be disabled by passing --without-universal-newlines to the
16637 configure script. On other platforms, remove
16638 WITH_UNIVERSAL_NEWLINES from pyconfig.h.
16639
16640- On Unix, a shared libpython2.3.so can be created with --enable-shared.
16641
16642- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
16643 preprocessor symbols were eliminated. The internal decisions they
16644 controlled stopped being experimental long ago.
16645
16646- The tools used to build the documentation now work under Cygwin as
16647 well as Unix.
16648
16649- The bsddb and dbm module builds have been changed to try and avoid version
16650 skew problems and disable linkage with Berkeley DB 1.85 unless the
16651 installer knows what s/he's doing. See the section on building these
16652 modules in the README file for details.
16653
16654C API
16655-----
16656
16657- PyNumber_Check() now returns true for string and unicode objects.
16658 This is a result of these types having a partially defined
16659 tp_as_number slot. (This is not a feature, but an indication that
16660 PyNumber_Check() is not very useful to determine numeric behavior.
16661 It may be deprecated.)
16662
16663- The string object's layout has changed: the pointer member
16664 ob_sinterned has been replaced by an int member ob_sstate. On some
16665 platforms (e.g. most 64-bit systems) this may change the offset of
16666 the ob_sval member, so as a precaution the API_VERSION has been
16667 incremented. The apparently unused feature of "indirect interned
16668 strings", supported by the ob_sinterned member, is gone. Interned
16669 strings are now usually mortal; there is a new API,
16670 PyString_InternImmortal() that creates immortal interned strings.
16671 (The ob_sstate member can only take three values; however, while
16672 making it a char saves a few bytes per string object on average, in
16673 it also slowed things down a bit because ob_sval was no longer
16674 aligned.)
16675
16676- The Py_InitModule*() functions now accept NULL for the 'methods'
16677 argument. Modules without global functions are becoming more common
16678 now that factories can be types rather than functions.
16679
16680- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
16681 level.
16682
16683- New functions PyErr_SetExcFromWindowsErr() and
16684 PyErr_SetExcFromWindowsErrWithFilename(). Similar to
16685 PyErr_SetFromWindowsErrWithFilename() and
16686 PyErr_SetFromWindowsErr(), but they allow to specify
16687 the exception type to raise. Available on Windows.
16688
16689- Py_FatalError() is now declared as taking a const char* argument. It
16690 was previously declared without const. This should not affect working
16691 code.
16692
16693- Added new macro PySequence_ITEM(o, i) that directly calls
16694 sq_item without rechecking that o is a sequence and without
16695 adjusting for negative indices.
16696
16697- PyRange_New() now raises ValueError if the fourth argument is not 1.
16698 This is part of the removal of deprecated features of the xrange
16699 object.
16700
16701- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
16702 coercion if both arguments have the same type but this type has the
16703 CHECKTYPES flag set. This is to better support proxies.
16704
16705- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
16706 "``void (*)(void *)``".
16707
16708- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
16709
16710- A type can now inherit its metatype from its base type. Previously,
16711 when PyType_Ready() was called, if ob_type was found to be NULL, it
16712 was always set to &PyType_Type; now it is set to base->ob_type,
16713 where base is tp_base, defaulting to &PyObject_Type.
16714
16715- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
16716
16717- The PyCore_* family of APIs have been removed.
16718
16719- The "u#" parser marker will now pass through Unicode objects as-is
16720 without going through the buffer API.
16721
16722- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
16723
16724- An old #define of ANY as void has been removed from pyport.h. This
16725 hasn't been used since Python's pre-ANSI days, and the #define has
16726 been marked as obsolete since then. SF bug 495548 says it created
16727 conflicts with other packages, so keeping it around wasn't harmless.
16728
16729- Because Python's magic number scheme broke on January 1st, we decided
16730 to stop Python development. Thanks for all the fish!
16731
16732- Some of us don't like fish, so we changed Python's magic number
16733 scheme to a new one. See Python/import.c for details.
16734
16735New platforms
16736-------------
16737
16738- OpenVMS is now supported.
16739
16740- AtheOS is now supported.
16741
16742- the EMX runtime environment on OS/2 is now supported.
16743
16744- GNU/Hurd is now supported.
16745
16746Tests
16747-----
16748
16749- The regrtest.py script's -u option now provides a way to say "allow
16750 all resources except this one." For example, to allow everything
16751 except bsddb, give the option '-uall,-bsddb'.
16752
16753Windows
16754-------
16755
16756- The Windows distribution now ships with version 4.0.14 of the
16757 Sleepycat Berkeley database library. This should be a huge
16758 improvement over the previous Berkeley DB 1.85, which had many
16759 bugs.
16760 XXX What are the licensing issues here?
16761 XXX If a user has a database created with a previous version of
16762 XXX Python, what must they do to convert it?
16763 XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
16764 XXX The version # is likely to change before 2.3a1.
16765
16766- The Windows distribution now ships with a Secure Sockets Library (SLL)
16767 module (_ssl.pyd)
16768
16769- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
16770 previously shipped with Tcl/Tk 8.3.2).
16771
16772- When Python is built under a Microsoft compiler, sys.version now
16773 includes the compiler version number (_MSC_VER). For example, under
16774 MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
16775 the value of _MSC_VER under MSVC 6.
16776
16777- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
16778 of that has been fixed in the installer (disabled Wise's "delete in-
16779 use files" uninstall option).
16780
16781- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
16782
16783- The installer now installs Start menu shortcuts under (the local
16784 equivalent of) "All Users" when doing an Admin install.
16785
16786- file.truncate([newsize]) now works on Windows for all newsize values.
16787 It used to fail if newsize didn't fit in 32 bits, reflecting a
16788 limitation of MS _chsize (which is no longer used).
16789
16790- os.waitpid() is now implemented for Windows, and can be used to block
16791 until a specified process exits. This is similar to, but not exactly
16792 the same as, os.waitpid() on POSIX systems. If you're waiting for
16793 a specific process whose pid was obtained from one of the spawn()
16794 functions, the same Python os.waitpid() code works across platforms.
16795 See the docs for details. The docs were changed to clarify that
16796 spawn functions return, and waitpid requires, a process handle on
16797 Windows (not the same thing as a Windows process id).
16798
16799- New tempfile.TemporaryFile implementation for Windows: this doesn't
16800 need a TemporaryFileWrapper wrapper anymore, and should be immune
16801 to a nasty problem: before 2.3, if you got a temp file on Windows, it
16802 got wrapped in an object whose close() method first closed the
16803 underlying file, then deleted the file. This usually worked fine.
16804 However, the spawn family of functions on Windows create (at a low C
16805 level) the same set of open files in the spawned process Q as were
16806 open in the spawning process P. If a temp file f was among them, then
16807 doing f.close() in P first closed P's C-level file handle on f, but Q's
16808 C-level file handle on f remained open, so the attempt in P to delete f
16809 blew up with a "Permission denied" error (Windows doesn't allow
16810 deleting open files). This was surprising, subtle, and difficult to
16811 work around.
16812
16813- The os module now exports all the symbolic constants usable with the
16814 low-level os.open() on Windows: the new constants in 2.3 are
16815 O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
16816 The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
16817 O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
16818 to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
16819 (so specify both if you want both; note that neither is useful unless
16820 specified with O_CREAT too).
16821
16822Mac
16823----
16824
16825- Mac/Relnotes is gone, the release notes are now here.
16826
16827- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
16828 version) now fully supports unicode strings as arguments to various file
16829 system calls, eg. open(), file(), os.stat() and os.listdir().
16830
16831- The current naming convention for Python on the Macintosh is that MacPython
16832 refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
16833 CFM-based version that runs on both OS9 and OSX.
16834
16835- All MacPython-OS9 functionality is now available in an OSX unix build,
16836 including the Carbon modules, the IDE, OSA support, etc. A lot of this
16837 will only work correctly in a framework build, though, because you cannot
16838 talk to the window manager unless your application is run from a .app
16839 bundle. There is a command line tool "pythonw" that runs your script
16840 with an interpreter living in such a .app bundle, this interpreter should
16841 be used to run any Python script using the window manager (including
16842 Tkinter or wxPython scripts).
16843
16844- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
16845 MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
16846 are specifically for MacPython-OS9 (CFM support, preference resources, etc).
16847
16848- A new utility PythonLauncher will start a Python interpreter when a .py or
16849 .pyw script is double-clicked in the Finder. By default .py scripts are
16850 run with a normal Python interpreter in a Terminal window and .pyw
16851 files are run with a window-aware pythonw interpreter without a Terminal
16852 window, but all this can be customized.
16853
16854- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
16855 possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
16856 releases.
16857
16858- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
16859 line interface too.
16860
16861- All the Carbon classes are now PEP253 compliant, meaning that you can
16862 subclass them from Python. Most of the attributes have gone, you should
16863 now use the accessor function call API, which is also what Apple's
16864 documentation uses. Some attributes such as grafport.visRgn are still
16865 available for convenience.
16866
16867- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016868 and Folder (APIs from Folders.h). The old macfs built-in module is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016869 gone, and replaced by a Python wrapper around the new modules.
16870
16871- Pathname handling should now be fully consistent: MacPython-OSX always uses
16872 unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
16873 (also when running on Mac OS X).
16874
16875- New Carbon modules Help and AH give access to the Carbon Help Manager.
16876 There are hooks in the IDE to allow accessing the Python documentation
16877 (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
16878 See Mac/OSX/README for converting the Python documentation to a
16879 Help Viewer compatible form and installing it.
16880
16881- OSA support has been redesigned and the generated Python classes now
16882 mirror the inheritance defined by the underlying OSA classes.
16883
16884- MacPython no longer maps both \r and \n to \n on input for any text file.
16885 This feature has been replaced by universal newline support (PEP278).
16886
16887- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
16888 mac-roman (or whatever your local Mac encoding was) but "ascii", like on
16889 other platforms. If you really need sourcefiles with Mac characters in them
16890 you can change this in site.py.
16891
16892
16893What's New in Python 2.2 final?
16894===============================
16895
16896*Release date: 21-Dec-2001*
16897
16898Type/class unification and new-style classes
16899--------------------------------------------
16900
16901- pickle.py, cPickle: allow pickling instances of new-style classes
16902 with a custom metaclass.
16903
16904Core and builtins
16905-----------------
16906
16907- weakref proxy object: when comparing, unwrap both arguments if both
16908 are proxies.
16909
16910Extension modules
16911-----------------
16912
16913- binascii.b2a_base64(): fix a potential buffer overrun when encoding
16914 very short strings.
16915
16916- cPickle: the obscure "fast" mode was suspected of causing stack
16917 overflows on the Mac. Hopefully fixed this by setting the recursion
16918 limit much smaller. If the limit is too low (it only affects
16919 performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
16920 when compiling cPickle.c (or in pyconfig.h).
16921
16922Library
16923-------
16924
16925- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
16926 close or delete time).
16927
16928- rfc822.py: fixed a bug where the address '<>' was converted to None
16929 instead of an empty string (also fixes the email.Utils module).
16930
16931- xmlrpclib.py: version 1.0.0; uses precision for doubles.
16932
16933- test suite: the pickle and cPickle tests were not executing any code
16934 when run from the standard regression test.
16935
16936Tools/Demos
16937-----------
16938
16939Build
16940-----
16941
16942C API
16943-----
16944
16945New platforms
16946-------------
16947
16948Tests
16949-----
16950
16951Windows
16952-------
16953
16954- distutils package: fixed broken Windows installers (bdist_wininst).
16955
16956- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
16957 instances are deleted at process exit time.
16958
16959- socket.py: prevent mysterious warnings when socket instances are
16960 deleted at process exit time.
16961
16962- posixmodule.c: fix a Windows crash with stat() of a filename ending
16963 in backslash.
16964
16965Mac
16966----
16967
16968- The Carbon toolbox modules have been upgraded to Universal Headers
16969 3.4, and experimental CoreGraphics and CarbonEvents modules have
16970 been added. All only for framework-enabled MacOSX.
16971
16972
16973What's New in Python 2.2c1?
16974===========================
16975
16976*Release date: 14-Dec-2001*
16977
16978Type/class unification and new-style classes
16979--------------------------------------------
16980
16981- Guido's tutorial introduction to the new type/class features has
16982 been extensively updated. See
16983
16984 http://www.python.org/2.2/descrintro.html
16985
16986 That remains the primary documentation in this area.
16987
16988- Fixed a leak: instance variables declared with __slots__ were never
16989 deleted!
16990
16991- The "delete attribute" method of descriptor objects is called
16992 __delete__, not __del__. In previous releases, it was mistakenly
16993 called __del__, which created an unfortunate overloading condition
16994 with finalizers. (The "get attribute" and "set attribute" methods
16995 are still called __get__ and __set__, respectively.)
16996
16997- Some subtle issues with the super built-in were fixed:
16998
16999 (a) When super itself is subclassed, its __get__ method would still
17000 return an instance of the base class (i.e., of super).
17001
17002 (b) super(C, C()).__class__ would return C rather than super. This
17003 is confusing. To fix this, I decided to change the semantics of
17004 super so that it only applies to code attributes, not to data
17005 attributes. After all, overriding data attributes is not
17006 supported anyway.
17007
17008 (c) The __get__ method didn't check whether the argument was an
17009 instance of the type used in creation of the super instance.
17010
17011- Previously, hash() of an instance of a subclass of a mutable type
17012 (list or dictionary) would return some value, rather than raising
17013 TypeError. This has been fixed. Also, directly calling
17014 dict.__hash__ and list.__hash__ now raises the same TypeError
17015 (previously, these were the same as object.__hash__).
17016
17017- New-style objects now support deleting their __dict__. This is for
17018 all intents and purposes equivalent to assigning a brand new empty
17019 dictionary, but saves space if the object is not used further.
17020
17021Core and builtins
17022-----------------
17023
17024- -Qnew now works as documented in PEP 238: when -Qnew is passed on
17025 the command line, all occurrences of "/" use true division instead
17026 of classic division. See the PEP for details. Note that "all"
17027 means all instances in library and 3rd-party modules, as well as in
17028 your own code. As the PEP says, -Qnew is intended for use only in
17029 educational environments with control over the libraries in use.
17030 Note that test_coercion.py in the standard Python test suite fails
17031 under -Qnew; this is expected, and won't be repaired until true
17032 division becomes the default (in the meantime, test_coercion is
17033 testing the current rules).
17034
17035- complex() now only allows the first argument to be a string
17036 argument, and raises TypeError if either the second arg is a string
17037 or if the second arg is specified when the first is a string.
17038
17039Extension modules
17040-----------------
17041
17042- gc.get_referents was renamed to gc.get_referrers.
17043
17044Library
17045-------
17046
17047- Functions in the os.spawn() family now release the global interpreter
17048 lock around calling the platform spawn. They should always have done
17049 this, but did not before 2.2c1. Multithreaded programs calling
17050 an os.spawn function with P_WAIT will no longer block all Python threads
17051 until the spawned program completes. It's possible that some programs
17052 relies on blocking, although more likely by accident than by design.
17053
17054- webbrowser defaults to netscape.exe on OS/2 now.
17055
17056- Tix.ResizeHandle exposes detach_widget, hide, and show.
17057
17058- The charset alias windows_1252 has been added.
17059
17060- types.StringTypes is a tuple containing the defined string types;
17061 usually this will be (str, unicode), but if Python was compiled
17062 without Unicode support it will be just (str,).
17063
17064- The pulldom and minidom modules were synchronized to PyXML.
17065
17066Tools/Demos
17067-----------
17068
17069- A new script called Tools/scripts/google.py was added, which fires
17070 off a search on Google.
17071
17072Build
17073-----
17074
17075- Note that release builds of Python should arrange to define the
17076 preprocessor symbol NDEBUG on the command line (or equivalent).
17077 In the 2.2 pre-release series we tried to define this by magic in
17078 Python.h instead, but it proved to cause problems for extension
17079 authors. The Unix, Windows and Mac builds now all define NDEBUG in
17080 release builds via cmdline (or equivalent) instead. Ports to
17081 other platforms should do likewise.
17082
17083- It is no longer necessary to use --with-suffix when building on a
17084 case-insensitive file system (such as Mac OS X HFS+). In the build
17085 directory an extension is used, but not in the installed python.
17086
17087C API
17088-----
17089
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017090- New function PyDict_MergeFromSeq2() exposes the built-in dict
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017091 constructor's logic for updating a dictionary from an iterable object
17092 producing key-value pairs.
17093
17094- PyArg_ParseTupleAndKeywords() requires that the number of entries in
17095 the keyword list equal the number of argument specifiers. This
17096 wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
17097 dump core in some bad cases. This has been repaired. As a result,
17098 PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
17099 previously went unchallenged.
17100
17101New platforms
17102-------------
17103
17104Tests
17105-----
17106
17107Windows
17108-------
17109
17110Mac
17111----
17112
17113- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
17114 without any trailing digits.
17115
17116- Changed logic for finding python home in Mac OS X framework Pythons.
17117 Now sys.executable points to the executable again, in stead of to
17118 the shared library. The latter is used only for locating the python
17119 home.
17120
17121
17122What's New in Python 2.2b2?
17123===========================
17124
17125*Release date: 16-Nov-2001*
17126
17127Type/class unification and new-style classes
17128--------------------------------------------
17129
17130- Multiple inheritance mixing new-style and classic classes in the
17131 list of base classes is now allowed, so this works now:
17132
17133 class Classic: pass
17134 class Mixed(Classic, object): pass
17135
17136 The MRO (method resolution order) for each base class is respected
17137 according to its kind, but the MRO for the derived class is computed
17138 using new-style MRO rules if any base class is a new-style class.
17139 This needs to be documented.
17140
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017141- The new built-in dictionary() constructor, and dictionary type, have
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017142 been renamed to dict. This reflects a decade of common usage.
17143
17144- dict() now accepts an iterable object producing 2-sequences. For
17145 example, dict(d.items()) == d for any dictionary d. The argument,
17146 and the elements of the argument, can be any iterable objects.
17147
17148- New-style classes can now have a __del__ method, which is called
17149 when the instance is deleted (just like for classic classes).
17150
17151- Assignment to object.__dict__ is now possible, for objects that are
17152 instances of new-style classes that have a __dict__ (unless the base
17153 class forbids it).
17154
17155- Methods of built-in types now properly check for keyword arguments
17156 (formerly these were silently ignored). The only built-in methods
17157 that take keyword arguments are __call__, __init__ and __new__.
17158
17159- The socket function has been converted to a type; see below.
17160
17161Core and builtins
17162-----------------
17163
17164- Assignment to __debug__ raises SyntaxError at compile-time. This
17165 was promised when 2.1c1 was released as "What's New in Python 2.1c1"
17166 (see below) says.
17167
17168- Clarified the error messages for unsupported operands to an operator
17169 (like 1 + '').
17170
17171Extension modules
17172-----------------
17173
17174- mmap has a new keyword argument, "access", allowing a uniform way for
17175 both Windows and Unix users to create read-only, write-through and
17176 copy-on-write memory mappings. This was previously possible only on
17177 Unix. A new keyword argument was required to support this in a
17178 uniform way because the mmap() signatures had diverged across
17179 platforms. Thanks to Jay T Miller for repairing this!
17180
17181- By default, the gc.garbage list now contains only those instances in
17182 unreachable cycles that have __del__ methods; in 2.1 it contained all
17183 instances in unreachable cycles. "Instances" here has been generalized
17184 to include instances of both new-style and old-style classes.
17185
17186- The socket module defines a new method for socket objects,
17187 sendall(). This is like send() but may make multiple calls to
17188 send() until all data has been sent. Also, the socket function has
17189 been converted to a subclassable type, like list and tuple (etc.)
17190 before it; socket and SocketType are now the same thing.
17191
17192- Various bugfixes to the curses module. There is now a test suite
17193 for the curses module (you have to run it manually).
17194
17195- binascii.b2a_base64 no longer places an arbitrary restriction of 57
17196 bytes on its input.
17197
17198Library
17199-------
17200
17201- tkFileDialog exposes a Directory class and askdirectory
17202 convenience function.
17203
17204- Symbolic group names in regular expressions must be unique. For
17205 example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
17206 single name can't mean both "group 1" and "group 2" simultaneously.
17207 Python 2.2 detects this error at regexp compilation time;
17208 previously, the error went undetected, and results were
17209 unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
17210 pattern.subn() methods have been rewritten in C. Also, an
17211 experimental function/method finditer() has been added, which works
17212 like findall() but returns an iterator.
17213
17214- Tix exposes more commands through the classes DirSelectBox,
17215 DirSelectDialog, ListNoteBook, Meter, CheckList, and the
17216 methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
17217 tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
17218
17219- Traceback objects are now scanned by cyclic garbage collection, so
17220 cycles created by casual use of sys.exc_info() no longer cause
17221 permanent memory leaks (provided garbage collection is enabled).
17222
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017223- mimetypes.py has optional support for non-standard, but commonly
17224 found types. guess_type() and guess_extension() now accept an
17225 optional 'strict' flag, defaulting to true, which controls whether
17226 recognize non-standard types or not. A few non-standard types we
17227 know about have been added. Also, when run as a script, there are
17228 new -l and -e options.
17229
17230- statcache is now deprecated.
17231
17232- email.Utils.formatdate() now produces the preferred RFC 2822 style
17233 dates with numeric timezones (it used to produce obsolete dates
17234 hard coded to "GMT" timezone). An optional 'localtime' flag is
17235 added to produce dates in the local timezone, with daylight savings
17236 time properly taken into account.
17237
17238- In pickle and cPickle, instead of masking errors in load() by
17239 transforming them into SystemError, we let the original exception
17240 propagate out. Also, implement support for __safe_for_unpickling__
17241 in pickle, as it already was supported in cPickle.
17242
17243Tools/Demos
17244-----------
17245
17246Build
17247-----
17248
17249- The dbm module is built using libdb1 if available. The bsddb module
17250 is built with libdb3 if available.
17251
17252- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
17253
17254C API
17255-----
17256
17257- New function PySequence_Fast_GET_SIZE() returns the size of a non-
17258 NULL result from PySequence_Fast(), more quickly than calling
17259 PySequence_Size().
17260
17261- New argument unpacking function PyArg_UnpackTuple() added.
17262
17263- New functions PyObject_CallFunctionObjArgs() and
17264 PyObject_CallMethodObjArgs() have been added to make it more
17265 convenient and efficient to call functions and methods from C.
17266
17267- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
17268 possible that this will propagate errors it didn't before.
17269
17270- New function PyObject_CheckReadBuffer(), which returns true if its
17271 argument supports the single-segment readable buffer interface.
17272
17273New platforms
17274-------------
17275
17276- We've finally confirmed that this release builds on HP-UX 11.00,
17277 *with* threads, and passes the test suite.
17278
17279- Thanks to a series of patches from Michael Muller, Python may build
17280 again under OS/2 Visual Age C++.
17281
17282- Updated RISCOS port by Dietmar Schwertberger.
17283
17284Tests
17285-----
17286
17287- Added a test script for the curses module. It isn't run automatically;
17288 regrtest.py must be run with '-u curses' to enable it.
17289
17290Windows
17291-------
17292
17293Mac
17294----
17295
17296- PythonScript has been moved to unsupported and is slated to be
17297 removed completely in the next release.
17298
17299- It should now be possible to build applets that work on both OS9 and
17300 OSX.
17301
17302- The core is now linked with CoreServices not Carbon; as a side
17303 result, default 8bit encoding on OSX is now ASCII.
17304
17305- Python should now build on OSX 10.1.1
17306
17307
17308What's New in Python 2.2b1?
17309===========================
17310
17311*Release date: 19-Oct-2001*
17312
17313Type/class unification and new-style classes
17314--------------------------------------------
17315
17316- New-style classes are now always dynamic (except for built-in and
17317 extension types). There is no longer a performance penalty, and I
17318 no longer see another reason to keep this baggage around. One relic
17319 remains: the __dict__ of a new-style class is a read-only proxy; you
17320 must set the class's attribute to modify it. As a consequence, the
17321 __defined__ attribute of new-style types no longer exists, for lack
17322 of need: there is once again only one __dict__ (although in the
17323 future a __cache__ may be resurrected with a similar function, if I
17324 can prove that it actually speeds things up).
17325
17326- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
17327 always returned None, even when there was a class docstring).
17328
17329- doctest now finds and runs docstrings attached to new-style classes,
17330 class methods, static methods, and properties.
17331
17332Core and builtins
17333-----------------
17334
17335- A very subtle syntactical pitfall in list comprehensions was fixed.
17336 For example: [a+b for a in 'abc', for b in 'def']. The comma in
17337 this example is a mistake. Previously, this would silently let 'a'
17338 iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
17339 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
17340 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
17341 Note that [a for a in <singleton>] is a convoluted way to say
17342 [<singleton>] anyway, so it's not like any expressiveness is lost.
17343
17344- getattr(obj, name, default) now only catches AttributeError, as
17345 documented, rather than returning the default value for all
17346 exceptions (which could mask bugs in a __getattr__ hook, for
17347 example).
17348
17349- Weak reference objects are now part of the core and offer a C API.
17350 A bug which could allow a core dump when binary operations involved
17351 proxy reference has been fixed. weakref.ReferenceError is now a
17352 built-in exception.
17353
17354- unicode(obj) now behaves more like str(obj), accepting arbitrary
17355 objects, and calling a __unicode__ method if it exists.
17356 unicode(obj, encoding) and unicode(obj, encoding, errors) still
17357 require an 8-bit string or character buffer argument.
17358
17359- isinstance() now allows any object as the first argument and a
17360 class, a type or something with a __bases__ tuple attribute for the
17361 second argument. The second argument may also be a tuple of a
17362 class, type, or something with __bases__, in which case isinstance()
17363 will return true if the first argument is an instance of any of the
17364 things contained in the second argument tuple. E.g.
17365
17366 isinstance(x, (A, B))
17367
17368 returns true if x is an instance of A or B.
17369
17370Extension modules
17371-----------------
17372
17373- thread.start_new_thread() now returns the thread ID (previously None).
17374
17375- binascii has now two quopri support functions, a2b_qp and b2a_qp.
17376
17377- readline now supports setting the startup_hook and the
17378 pre_event_hook, and adds the add_history() function.
17379
17380- os and posix supports chroot(), setgroups() and unsetenv() where
17381 available. The stat(), fstat(), statvfs() and fstatvfs() functions
17382 now return "pseudo-sequences" -- the various fields can now be
17383 accessed as attributes (e.g. os.stat("/").st_mtime) but for
17384 backwards compatibility they also behave as a fixed-length sequence.
17385 Some platform-specific fields (e.g. st_rdev) are only accessible as
17386 attributes.
17387
17388- time: localtime(), gmtime() and strptime() now return a
17389 pseudo-sequence similar to the os.stat() return value, with
17390 attributes like tm_year etc.
17391
17392- Decompression objects in the zlib module now accept an optional
17393 second parameter to decompress() that specifies the maximum amount
17394 of memory to use for the uncompressed data.
17395
17396- optional SSL support in the socket module now exports OpenSSL
17397 functions RAND_add(), RAND_egd(), and RAND_status(). These calls
17398 are useful on platforms like Solaris where OpenSSL does not
17399 automatically seed its PRNG. Also, the keyfile and certfile
17400 arguments to socket.ssl() are now optional.
17401
17402- posixmodule (and by extension, the os module on POSIX platforms) now
17403 exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
17404
17405Library
17406-------
17407
17408- doctest now excludes functions and classes not defined by the module
17409 being tested, thanks to Tim Hochberg.
17410
17411- HotShot, a new profiler implemented using a C-based callback, has
17412 been added. This substantially reduces the overhead of profiling,
17413 but it is still quite preliminary. Support modules and
17414 documentation will be added in upcoming releases (before 2.2 final).
17415
17416- profile now produces correct output in situations where an exception
17417 raised in Python is cleared by C code (e.g. hasattr()). This used
17418 to cause wrong output, including spurious claims of recursive
17419 functions and attribution of time spent to the wrong function.
17420
17421 The code and documentation for the derived OldProfile and HotProfile
17422 profiling classes was removed. The code hasn't worked for years (if
17423 you tried to use them, they raised exceptions). OldProfile
17424 intended to reproduce the behavior of the profiler Python used more
17425 than 7 years ago, and isn't interesting anymore. HotProfile intended
17426 to provide a faster profiler (but producing less information), and
17427 that's a worthy goal we intend to meet via a different approach (but
17428 without losing information).
17429
17430- Profile.calibrate() has a new implementation that should deliver
17431 a much better system-specific calibration constant. The constant can
17432 now be specified in an instance constructor, or as a Profile class or
17433 instance variable, instead of by editing profile.py's source code.
17434 Calibration must still be done manually (see the docs for the profile
17435 module).
17436
17437 Note that Profile.calibrate() must be overridden by subclasses.
17438 Improving the accuracy required exploiting detailed knowledge of
17439 profiler internals; the earlier method abstracted away the details
17440 and measured a simplified model instead, but consequently computed
17441 a constant too small by a factor of 2 on some modern machines.
17442
17443- quopri's encode and decode methods take an optional header parameter,
17444 which indicates whether output is intended for the header 'Q'
17445 encoding.
17446
17447- The SocketServer.ThreadingMixIn class now closes the request after
17448 finish_request() returns. (Not when it errors out though.)
17449
17450- The nntplib module's NNTP.body() method has grown a 'file' argument
17451 to allow saving the message body to a file.
17452
17453- The email package has added a class email.Parser.HeaderParser which
17454 only parses headers and does not recurse into the message's body.
17455 Also, the module/class MIMEAudio has been added for representing
17456 audio data (contributed by Anthony Baxter).
17457
17458- ftplib should be able to handle files > 2GB.
17459
17460- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
17461 ON, and OFF.
17462
17463- xml.dom.minidom NodeList objects now support the length attribute
17464 and item() method as required by the DOM specifications.
17465
17466Tools/Demos
17467-----------
17468
17469- Demo/dns was removed. It no longer serves any purpose; a package
17470 derived from it is now maintained by Anthony Baxter, see
17471 http://PyDNS.SourceForge.net.
17472
17473- The freeze tool has been made more robust, and two new options have
17474 been added: -X and -E.
17475
17476Build
17477-----
17478
17479- configure will use CXX in LINKCC if CXX is used to build main() and
17480 the system requires to link a C++ main using the C++ compiler.
17481
17482C API
17483-----
17484
17485- The documentation for the tp_compare slot is updated to require that
17486 the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
17487 not correct. This is not yet enforced but will be enforced in
17488 Python 2.3; even later, we may use -2 to indicate errors and +2 for
17489 "NotImplemented". Right now, -1 should be used for an error return.
17490
17491- PyLong_AsLongLong() now accepts int (as well as long) arguments.
17492 Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
17493 as long) arguments.
17494
17495- PyThread_start_new_thread() now returns a long int giving the thread
17496 ID, if one can be calculated; it returns -1 for error, 0 if no
17497 thread ID is calculated (this is an incompatible change, but only
17498 the thread module used this API). This code has only really been
17499 tested on Linux and Windows; other platforms please beware (and
17500 report any bugs or strange behavior).
17501
17502- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
17503 input.
17504
17505New platforms
17506-------------
17507
17508Tests
17509-----
17510
17511Windows
17512-------
17513
17514- Installer: If you install IDLE, and don't disable file-extension
17515 registration, a new "Edit with IDLE" context (right-click) menu entry
17516 is created for .py and .pyw files.
17517
17518- The signal module now supports SIGBREAK on Windows, thanks to Steven
17519 Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
17520 action remains to call Win32 ExitProcess(). This can be changed via
17521 signal.signal(). For example::
17522
17523 # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
17524 # (SIGINT) behavior.
17525 import signal
17526 signal.signal(signal.SIGBREAK, signal.default_int_handler)
17527
17528 try:
17529 while 1:
17530 pass
17531 except KeyboardInterrupt:
17532 # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
17533 # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
17534 # program without the possibility for any Python-level cleanup).
17535 print "Clean exit"
17536
17537
17538What's New in Python 2.2a4?
17539===========================
17540
17541*Release date: 28-Sep-2001*
17542
17543Type/class unification and new-style classes
17544--------------------------------------------
17545
17546- pydoc and inspect are now aware of new-style classes;
17547 e.g. help(list) at the interactive prompt now shows proper
17548 documentation for all operations on list objects.
17549
17550- Applications using Jim Fulton's ExtensionClass module can now safely
17551 be used with Python 2.2. In particular, Zope 2.4.1 now works with
17552 Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
17553 examples also work again. It is hoped that Gtk and Boost also work
17554 with 2.2a4 and beyond. (If you can confirm this, please write
17555 webmaster@python.org; if there are still problems, please open a bug
17556 report on SourceForge.)
17557
17558- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
17559 These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
17560 in the constructed property object. fget, fset and fdel weren't
17561 discoverable from Python in 2.2a3. __doc__ is new, and allows to
17562 associate a docstring with a property.
17563
17564- Comparison overloading is now more completely implemented. For
17565 example, a str subclass instance can properly be compared to a str
17566 instance, and it can properly overload comparison. Ditto for most
17567 other built-in object types.
17568
17569- The repr() of new-style classes has changed; instead of <type
17570 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
17571 *except* for built-in types, which are still rendered as <type
17572 'Foo'> (to avoid upsetting existing code that might parse or
17573 otherwise rely on repr() of certain type objects).
17574
17575- The repr() of new-style objects is now always <Foo object at XXX>;
17576 previously, it was sometimes <Foo instance at XXX>.
17577
17578- For new-style classes, what was previously called __getattr__ is now
17579 called __getattribute__. This method, if defined, is called for
17580 *every* attribute access. A new __getattr__ hook more similar to the
17581 one in classic classes is defined which is called only if regular
17582 attribute access raises AttributeError; to catch *all* attribute
17583 access, you can use __getattribute__ (for new-style classes). If
17584 both are defined, __getattribute__ is called first, and if it raises
17585 AttributeError, __getattr__ is called.
17586
17587- The __class__ attribute of new-style objects can be assigned to.
17588 The new class must have the same C-level object layout as the old
17589 class.
17590
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017591- The built-in file type can be subclassed now. In the usual pattern,
17592 "file" is the name of the built-in type, and file() is a new built-in
17593 constructor, with the same signature as the built-in open() function.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017594 file() is now the preferred way to open a file.
17595
17596- Previously, __new__ would only see sequential arguments passed to
17597 the type in a constructor call; __init__ would see both sequential
17598 and keyword arguments. This made no sense whatsoever any more, so
17599 now both __new__ and __init__ see all arguments.
17600
17601- Previously, hash() applied to an instance of a subclass of str or
17602 unicode always returned 0. This has been repaired.
17603
17604- Previously, an operation on an instance of a subclass of an
17605 immutable type (int, long, float, complex, tuple, str, unicode),
17606 where the subtype didn't override the operation (and so the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017607 operation was handled by the built-in type), could return that
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017608 instance instead a value of the base type. For example, if s was of
17609 a str subclass type, s[:] returned s as-is. Now it returns a str
17610 with the same value as s.
17611
17612- Provisional support for pickling new-style objects has been added.
17613
17614Core
17615----
17616
17617- file.writelines() now accepts any iterable object producing strings.
17618
17619- PyUnicode_FromEncodedObject() now works very much like
17620 PyObject_Str(obj) in that it tries to use __str__/tp_str
17621 on the object if the object is not a string or buffer. This
17622 makes unicode() behave like str() when applied to non-string/buffer
17623 objects.
17624
17625- PyFile_WriteObject now passes Unicode objects to the file's write
17626 method. As a result, all file-like objects which may be the target
17627 of a print statement must support Unicode objects, i.e. they must
17628 at least convert them into ASCII strings.
17629
17630- Thread scheduling on Solaris should be improved; it is no longer
17631 necessary to insert a small sleep at the start of a thread in order
17632 to let other runnable threads be scheduled.
17633
17634Library
17635-------
17636
17637- StringIO.StringIO instances and cStringIO.StringIO instances support
17638 read character buffer compatible objects for their .write() methods.
17639 These objects are converted to strings and then handled as such
17640 by the instances.
17641
17642- The "email" package has been added. This is basically a port of the
17643 mimelib package <http://sf.net/projects/mimelib> with API changes
17644 and some implementations updated to use iterators and generators.
17645
17646- difflib.ndiff() and difflib.Differ.compare() are generators now. This
17647 restores the ability of Tools/scripts/ndiff.py to start producing output
17648 before the entire comparison is complete.
17649
17650- StringIO.StringIO instances and cStringIO.StringIO instances support
17651 iteration just like file objects (i.e. their .readline() method is
17652 called for each iteration until it returns an empty string).
17653
17654- The codecs module has grown four new helper APIs to access
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017655 built-in codecs: getencoder(), getdecoder(), getreader(),
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017656 getwriter().
17657
17658- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
17659 simplifies writing XML RPC servers.
17660
17661- os.path.realpath(): a new function that returns the absolute pathname
17662 after interpretation of symbolic links. On non-Unix systems, this
17663 is an alias for os.path.abspath().
17664
17665- operator.indexOf() (PySequence_Index() in the C API) now works with any
17666 iterable object.
17667
17668- smtplib now supports various authentication and security features of
17669 the SMTP protocol through the new login() and starttls() methods.
17670
17671- hmac: a new module implementing keyed hashing for message
17672 authentication.
17673
17674- mimetypes now recognizes more extensions and file types. At the
17675 same time, some mappings not sanctioned by IANA were removed.
17676
17677- The "compiler" package has been brought up to date to the state of
17678 Python 2.2 bytecode generation. It has also been promoted from a
17679 Tool to a standard library package. (Tools/compiler still exists as
17680 a sample driver.)
17681
17682Build
17683-----
17684
17685- Large file support (LFS) is now automatic when the platform supports
17686 it; no more manual configuration tweaks are needed. On Linux, at
17687 least, it's possible to have a system whose C library supports large
17688 files but whose kernel doesn't; in this case, large file support is
17689 still enabled but doesn't do you any good unless you upgrade your
17690 kernel or share your Python executable with another system whose
17691 kernel has large file support.
17692
17693- The configure script now supplies plausible defaults in a
17694 cross-compilation environment. This doesn't mean that the supplied
17695 values are always correct, or that cross-compilation now works
17696 flawlessly -- but it's a first step (and it shuts up most of
17697 autoconf's warnings about AC_TRY_RUN).
17698
17699- The Unix build is now a bit less chatty, courtesy of the parser
17700 generator. The build is completely silent (except for errors) when
17701 using "make -s", thanks to a -q option to setup.py.
17702
17703C API
17704-----
17705
17706- The "structmember" API now supports some new flag bits to deny read
17707 and/or write access to attributes in restricted execution mode.
17708
17709New platforms
17710-------------
17711
17712- Compaq's iPAQ handheld, running the "familiar" Linux distribution
17713 (http://familiar.handhelds.org).
17714
17715Tests
17716-----
17717
17718- The "classic" standard tests, which work by comparing stdout to
17719 an expected-output file under Lib/test/output/, no longer stop at
17720 the first mismatch. Instead the test is run to completion, and a
17721 variant of ndiff-style comparison is used to report all differences.
17722 This is much easier to understand than the previous style of reporting.
17723
17724- The unittest-based standard tests now use regrtest's test_main()
17725 convention, instead of running as a side-effect of merely being
17726 imported. This allows these tests to be run in more natural and
17727 flexible ways as unittests, outside the regrtest framework.
17728
17729- regrtest.py is much better integrated with unittest and doctest now,
17730 especially in regard to reporting errors.
17731
17732Windows
17733-------
17734
17735- Large file support now also works for files > 4GB, on filesystems
17736 that support it (NTFS under Windows 2000). See "What's New in
17737 Python 2.2a3" for more detail.
17738
17739
17740What's New in Python 2.2a3?
17741===========================
17742
17743*Release Date: 07-Sep-2001*
17744
17745Core
17746----
17747
17748- Conversion of long to float now raises OverflowError if the long is too
17749 big to represent as a C double.
17750
17751- The 3-argument builtin pow() no longer allows a third non-None argument
17752 if either of the first two arguments is a float, or if both are of
17753 integer types and the second argument is negative (in which latter case
17754 the arguments are converted to float, so this is really the same
17755 restriction).
17756
17757- The builtin dir() now returns more information, and sometimes much
17758 more, generally naming all attributes of an object, and all attributes
17759 reachable from the object via its class, and from its class's base
17760 classes, and so on from them too. Example: in 2.2a2, dir([]) returned
17761 an empty list. In 2.2a3,
17762
17763 >>> dir([])
17764 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
17765 '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
17766 '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
17767 '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
17768 '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
17769 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
17770 'reverse', 'sort']
17771
17772 dir(module) continues to return only the module's attributes, though.
17773
17774- Overflowing operations on plain ints now return a long int rather
17775 than raising OverflowError. This is a partial implementation of PEP
17776 237. You can use -Wdefault::OverflowWarning to enable a warning for
17777 this situation, and -Werror::OverflowWarning to revert to the old
17778 OverflowError exception.
17779
17780- A new command line option, -Q<arg>, is added to control run-time
17781 warnings for the use of classic division. (See PEP 238.) Possible
17782 values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
17783 -Qold, meaning the / operator has its classic meaning and no
17784 warnings are issued. Using -Qwarn issues a run-time warning about
17785 all uses of classic division for int and long arguments; -Qwarnall
17786 also warns about classic division for float and complex arguments
17787 (for use with fixdiv.py).
17788 [Note: the remainder of this item (preserved below) became
17789 obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
17790
17791 Using -Qnew is questionable; it turns on new division by default, but
17792 only in the __main__ module. You can usefully combine -Qwarn or
17793 -Qwarnall and -Qnew: this gives the __main__ module new division, and
17794 warns about classic division everywhere else.
17795
17796- Many built-in types can now be subclassed. This applies to int,
17797 long, float, str, unicode, and tuple. (The types complex, list and
17798 dictionary can also be subclassed; this was introduced earlier.)
17799 Note that restrictions apply when subclassing immutable built-in
17800 types: you can only affect the value of the instance by overloading
17801 __new__. You can add mutable attributes, and the subclass instances
17802 will have a __dict__ attribute, but you cannot change the "value"
17803 (as implemented by the base class) of an immutable subclass instance
17804 once it is created.
17805
17806- The dictionary constructor now takes an optional argument, a
17807 mapping-like object, and initializes the dictionary from its
17808 (key, value) pairs.
17809
17810- A new built-in type, super, has been added. This facilitates making
17811 "cooperative super calls" in a multiple inheritance setting. For an
17812 explanation, see http://www.python.org/2.2/descrintro.html#cooperation
17813
17814- A new built-in type, property, has been added. This enables the
17815 creation of "properties". These are attributes implemented by
17816 getter and setter functions (or only one of these for read-only or
17817 write-only attributes), without the need to override __getattr__.
17818 See http://www.python.org/2.2/descrintro.html#property
17819
17820- The syntax of floating-point and imaginary literals has been
17821 liberalized, to allow leading zeroes. Examples of literals now
17822 legal that were SyntaxErrors before:
17823
17824 00.0 0e3 0100j 07.5 00000000000000000008.
17825
17826- An old tokenizer bug allowed floating point literals with an incomplete
17827 exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
17828
17829Library
17830-------
17831
17832- telnetlib includes symbolic names for the options, and support for
17833 setting an option negotiation callback. It also supports processing
17834 of suboptions.
17835
17836- The new C standard no longer requires that math libraries set errno to
17837 ERANGE on overflow. For platform libraries that exploit this new
17838 freedom, Python's overflow-checking was wholly broken. A new overflow-
17839 checking scheme attempts to repair that, but may not be reliable on all
17840 platforms (C doesn't seem to provide anything both useful and portable
17841 in this area anymore).
17842
17843- Asynchronous timeout actions are available through the new class
17844 threading.Timer.
17845
17846- math.log and math.log10 now return sensible results for even huge
17847 long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
17848
17849- A new function, imp.lock_held(), returns 1 when the import lock is
17850 currently held. See the docs for the imp module.
17851
17852- pickle, cPickle and marshal on 32-bit platforms can now correctly read
17853 dumps containing ints written on platforms where Python ints are 8 bytes.
17854 When read on a box where Python ints are 4 bytes, such values are
17855 converted to Python longs.
17856
17857- In restricted execution mode (using the rexec module), unmarshalling
17858 code objects is no longer allowed. This plugs a security hole.
17859
17860- unittest.TestResult instances no longer store references to tracebacks
17861 generated by test failures. This prevents unexpected dangling references
17862 to objects that should be garbage collected between tests.
17863
17864Tools
17865-----
17866
17867- Tools/scripts/fixdiv.py has been added which can be used to fix
17868 division operators as per PEP 238.
17869
17870Build
17871-----
17872
17873- If you are an adventurous person using Mac OS X you may want to look at
17874 Mac/OSX. There is a Makefile there that will build Python as a real Mac
17875 application, which can be used for experimenting with Carbon or Cocoa.
17876 Discussion of this on pythonmac-sig, please.
17877
17878C API
17879-----
17880
17881- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
17882
17883- Note that PyLong_AsDouble can fail! This has always been true, but no
17884 callers checked for it. It's more likely to fail now, because overflow
17885 errors are properly detected now. The proper way to check::
17886
17887 double x = PyLong_AsDouble(some_long_object);
17888 if (x == -1.0 && PyErr_Occurred()) {
17889 /* The conversion failed. */
17890 }
17891
17892- The GC API has been changed. Extensions that use the old API will still
17893 compile but will not participate in GC. To upgrade an extension
17894 module:
17895
17896 - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
17897
17898 - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
17899 PyObject_GC_Del to deallocate them
17900
17901 - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
17902 to PyObject_GC_UnTrack
17903
17904 - remove PyGC_HEAD_SIZE from object size calculations
17905
17906 - remove calls to PyObject_AS_GC and PyObject_FROM_GC
17907
17908- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
17909 These can be used safely to construct string objects from a
17910 sprintf-style format string (similar to the format string supported
17911 by PyErr_Format()).
17912
17913New platforms
17914-------------
17915
17916- Stephen Hansen contributed patches sufficient to get a clean compile
17917 under Borland C (Windows), but he reports problems running it and ran
17918 out of time to complete the port. Volunteers? Expect a MemoryError
17919 when importing the types module; this is probably shallow, and
17920 causing later failures too.
17921
17922Tests
17923-----
17924
17925Windows
17926-------
17927
17928- Large file support is now enabled on Win32 platforms as well as on
17929 Win64. This means that, for example, you can use f.tell() and f.seek()
17930 to manipulate files larger than 2 gigabytes (provided you have enough
17931 disk space, and are using a Windows filesystem that supports large
17932 partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
17933 filesize limit, and large file support makes no difference there.
17934 FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
17935 NTFS has no practical limit on file size, and files of any size can be
17936 used from Python now.
17937
17938- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
17939 points to command.com (patch from Brian Quinlan).
17940
17941
17942What's New in Python 2.2a2?
17943===========================
17944
17945*Release Date: 22-Aug-2001*
17946
17947Build
17948-----
17949
17950- Tim Peters developed a brand new Windows installer using Wise 8.1,
17951 generously donated to us by Wise Solutions.
17952
17953- configure supports a new option --enable-unicode, with the values
17954 ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
17955 type and supporting code is completely removed from the interpreter.
17956
17957- A new configure option --enable-framework builds a Mac OS X framework,
17958 which "make frameworkinstall" will install. This provides a starting
17959 point for more mac-like functionality, join pythonmac-sig@python.org
17960 if you are interested in helping.
17961
17962- The NeXT platform is no longer supported.
17963
17964- The 'new' module is now statically linked.
17965
17966Tools
17967-----
17968
17969- The new Tools/scripts/cleanfuture.py can be used to automatically
17970 edit out obsolete future statements from Python source code. See
17971 the module docstring for details.
17972
17973Tests
17974-----
17975
17976- regrtest.py now knows which tests are expected to be skipped on some
17977 platforms, allowing to give clearer test result output. regrtest
17978 also has optional --use/-u switch to run normally disabled tests
17979 which require network access or consume significant disk resources.
17980
17981- Several new tests in the standard test suite, with special thanks to
17982 Nick Mathewson.
17983
17984Core
17985----
17986
17987- The floor division operator // has been added as outlined in PEP
17988 238. The / operator still provides classic division (and will until
17989 Python 3.0) unless "from __future__ import division" is included, in
17990 which case the / operator will provide true division. The operator
17991 module provides truediv() and floordiv() functions. Augmented
17992 assignment variants are included, as are the equivalent overloadable
17993 methods and C API methods. See the PEP for a full discussion:
17994 <http://python.sf.net/peps/pep-0238.html>
17995
17996- Future statements are now effective in simulated interactive shells
17997 (like IDLE). This should "just work" by magic, but read Michael
17998 Hudson's "Future statements in simulated shells" PEP 264 for full
17999 details: <http://python.sf.net/peps/pep-0264.html>.
18000
18001- The type/class unification (PEP 252-253) was integrated into the
18002 trunk and is not so tentative any more (the exact specification of
18003 some features is still tentative). A lot of work has done on fixing
18004 bugs and adding robustness and features (performance still has to
18005 come a long way).
18006
18007- Warnings about a mismatch in the Python API during extension import
18008 now use the Python warning framework (which makes it possible to
18009 write filters for these warnings).
18010
18011- A function's __dict__ (aka func_dict) will now always be a
18012 dictionary. It used to be possible to delete it or set it to None,
18013 but now both actions raise TypeErrors. It is still legal to set it
18014 to a dictionary object. Getting func.__dict__ before any attributes
18015 have been assigned now returns an empty dictionary instead of None.
18016
18017- A new command line option, -E, was added which disables the use of
18018 all environment variables, or at least those that are specifically
18019 significant to Python. Usually those have a name starting with
18020 "PYTHON". This was used to fix a problem where the tests fail if
18021 the user happens to have PYTHONHOME or PYTHONPATH pointing to an
18022 older distribution.
18023
18024Library
18025-------
18026
18027- New class Differ and new functions ndiff() and restore() in difflib.py.
18028 These package the algorithms used by the popular Tools/scripts/ndiff.py,
18029 for programmatic reuse.
18030
18031- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
18032 value using the minimal quoting required for the value; more
18033 reliable than using xml.sax.saxutils.escape() for attribute values.
18034
18035- Readline completion support for cmd.Cmd was added.
18036
18037- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
18038
18039- Added function threading.BoundedSemaphore()
18040
18041- Added Ka-Ping Yee's cgitb.py module.
18042
18043- The 'new' module now exposes the CO_xxx flags.
18044
18045- The gc module offers the get_referents function.
18046
18047New platforms
18048-------------
18049
18050C API
18051-----
18052
18053- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
18054 which provide a cross-platform implementations for the
18055 relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
18056 the standard sprintf() and vsprintf() C lib APIs, these versions
18057 apply bounds checking on the used buffer which enhances protection
18058 against buffer overruns.
18059
18060- Unicode APIs now use name mangling to assure that mixing interpreters
18061 and extensions using different Unicode widths is rendered next to
18062 impossible. Trying to import an incompatible Unicode-aware extension
18063 will result in an ImportError. Unicode extensions writers must make
18064 sure to check the Unicode width compatibility in their extensions by
18065 using at least one of the mangled Unicode APIs in the extension.
18066
18067- Two new flags METH_NOARGS and METH_O are available in method definition
18068 tables to simplify implementation of methods with no arguments and a
18069 single untyped argument. Calling such methods is more efficient than
18070 calling corresponding METH_VARARGS methods. METH_OLDARGS is now
18071 deprecated.
18072
18073Windows
18074-------
18075
18076- "import module" now compiles module.pyw if it exists and nothing else
18077 relevant is found.
18078
18079
18080What's New in Python 2.2a1?
18081===========================
18082
18083*Release date: 18-Jul-2001*
18084
18085Core
18086----
18087
18088- TENTATIVELY, a large amount of code implementing much of what's
18089 described in PEP 252 (Making Types Look More Like Classes) and PEP
18090 253 (Subtyping Built-in Types) was added. This will be released
18091 with Python 2.2a1. Documentation will be provided separately
18092 through http://www.python.org/2.2/. The purpose of releasing this
18093 with Python 2.2a1 is to test backwards compatibility. It is
18094 possible, though not likely, that a decision is made not to release
18095 this code as part of 2.2 final, if any serious backwards
18096 incompatibilities are found during alpha testing that cannot be
18097 repaired.
18098
18099- Generators were added; this is a new way to create an iterator (see
18100 below) using what looks like a simple function containing one or
18101 more 'yield' statements. See PEP 255. Since this adds a new
18102 keyword to the language, this feature must be enabled by including a
18103 future statement: "from __future__ import generators" (see PEP 236).
18104 Generators will become a standard feature in a future release
18105 (probably 2.3). Without this future statement, 'yield' remains an
18106 ordinary identifier, but a warning is issued each time it is used.
18107 (These warnings currently don't conform to the warnings framework of
18108 PEP 230; we intend to fix this in 2.2a2.)
18109
18110- The UTF-16 codec was modified to be more RFC compliant. It will now
18111 only remove BOM characters at the start of the string and then
18112 only if running in native mode (UTF-16-LE and -BE won't remove a
18113 leading BMO character).
18114
18115- Strings now have a new method .decode() to complement the already
18116 existing .encode() method. These two methods provide direct access
18117 to the corresponding decoders and encoders of the registered codecs.
18118
18119 To enhance the usability of the .encode() method, the special
18120 casing of Unicode object return values was dropped (Unicode objects
18121 were auto-magically converted to string using the default encoding).
18122
18123 Both methods will now return whatever the codec in charge of the
18124 requested encoding returns as object, e.g. Unicode codecs will
18125 return Unicode objects when decoding is requested ("äöü".decode("latin-1")
18126 will return u"äöü"). This enables codec writer to create codecs
18127 for various simple to use conversions.
18128
18129 New codecs were added to demonstrate these new features (the .encode()
18130 and .decode() columns indicate the type of the returned objects):
18131
18132 +---------+-----------+-----------+-----------------------------+
18133 |Name | .encode() | .decode() | Description |
18134 +=========+===========+===========+=============================+
18135 |uu | string | string | UU codec (e.g. for email) |
18136 +---------+-----------+-----------+-----------------------------+
18137 |base64 | string | string | base64 codec |
18138 +---------+-----------+-----------+-----------------------------+
18139 |quopri | string | string | quoted-printable codec |
18140 +---------+-----------+-----------+-----------------------------+
18141 |zlib | string | string | zlib compression |
18142 +---------+-----------+-----------+-----------------------------+
18143 |hex | string | string | 2-byte hex codec |
18144 +---------+-----------+-----------+-----------------------------+
18145 |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
18146 +---------+-----------+-----------+-----------------------------+
18147
18148- Some operating systems now support the concept of a default Unicode
18149 encoding for file system operations. Notably, Windows supports 'mbcs'
18150 as the default. The Macintosh will also adopt this concept in the medium
18151 term, although the default encoding for that platform will be other than
18152 'mbcs'.
18153
18154 On operating system that support non-ASCII filenames, it is common for
18155 functions that return filenames (such as os.listdir()) to return Python
18156 string objects pre-encoded using the default file system encoding for
18157 the platform. As this encoding is likely to be different from Python's
18158 default encoding, converting this name to a Unicode object before passing
18159 it back to the Operating System would result in a Unicode error, as Python
18160 would attempt to use its default encoding (generally ASCII) rather than
18161 the default encoding for the file system.
18162
18163 In general, this change simply removes surprises when working with
18164 Unicode and the file system, making these operations work as you expect,
18165 increasing the transparency of Unicode objects in this context.
18166 See [????] for more details, including examples.
18167
18168- Float (and complex) literals in source code were evaluated to full
18169 precision only when running from a .py file; the same code loaded from a
18170 .pyc (or .pyo) file could suffer numeric differences starting at about the
18171 12th significant decimal digit. For example, on a machine with IEEE-754
18172 floating arithmetic,
18173
18174 x = 9007199254740992.0
18175 print long(x)
18176
18177 printed 9007199254740992 if run directly from .py, but 9007199254740000
18178 if from a compiled (.pyc or .pyo) file. This was due to marshal using
18179 str(float) instead of repr(float) when building code objects. marshal
18180 now uses repr(float) instead, which should reproduce floats to full
18181 machine precision (assuming the platform C float<->string I/O conversion
18182 functions are of good quality).
18183
18184 This may cause floating-point results to change in some cases, and
18185 usually for the better, but may also cause numerically unstable
18186 algorithms to break.
18187
18188- The implementation of dicts suffers fewer collisions, which has speed
18189 benefits. However, the order in which dict entries appear in dict.keys(),
18190 dict.values() and dict.items() may differ from previous releases for a
18191 given dict. Nothing is defined about this order, so no program should
18192 rely on it. Nevertheless, it's easy to write test cases that rely on the
18193 order by accident, typically because of printing the str() or repr() of a
18194 dict to an "expected results" file. See Lib/test/test_support.py's new
18195 sortdict(dict) function for a simple way to display a dict in sorted
18196 order.
18197
18198- Many other small changes to dicts were made, resulting in faster
18199 operation along the most common code paths.
18200
18201- Dictionary objects now support the "in" operator: "x in dict" means
18202 the same as dict.has_key(x).
18203
18204- The update() method of dictionaries now accepts generic mapping
18205 objects. Specifically the argument object must support the .keys()
18206 and __getitem__() methods. This allows you to say, for example,
18207 {}.update(UserDict())
18208
18209- Iterators were added; this is a generalized way of providing values
18210 to a for loop. See PEP 234. There's a new built-in function iter()
18211 to return an iterator. There's a new protocol to get the next value
18212 from an iterator using the next() method (in Python) or the
18213 tp_iternext slot (in C). There's a new protocol to get iterators
18214 using the __iter__() method (in Python) or the tp_iter slot (in C).
18215 Iterating (i.e. a for loop) over a dictionary generates its keys.
18216 Iterating over a file generates its lines.
18217
18218- The following functions were generalized to work nicely with iterator
18219 arguments::
18220
18221 map(), filter(), reduce(), zip()
18222 list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
18223 max(), min()
18224 join() method of strings
18225 extend() method of lists
18226 'x in y' and 'x not in y' (PySequence_Contains() in C API)
18227 operator.countOf() (PySequence_Count() in C API)
18228 right-hand side of assignment statements with multiple targets, such as ::
18229 x, y, z = some_iterable_object_returning_exactly_3_values
18230
18231- Accessing module attributes is significantly faster (for example,
18232 random.random or os.path or yourPythonModule.yourAttribute).
18233
18234- Comparing dictionary objects via == and != is faster, and now works even
18235 if the keys and values don't support comparisons other than ==.
18236
18237- Comparing dictionaries in ways other than == and != is slower: there were
18238 insecurities in the dict comparison implementation that could cause Python
18239 to crash if the element comparison routines for the dict keys and/or
18240 values mutated the dicts. Making the code bulletproof slowed it down.
18241
18242- Collisions in dicts are resolved via a new approach, which can help
18243 dramatically in bad cases. For example, looking up every key in a dict
18244 d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
18245 faster now. Thanks to Christian Tismer for pointing out the cause and
18246 the nature of an effective cure (last December! better late than never).
18247
18248- repr() is much faster for large containers (dict, list, tuple).
18249
18250
18251Library
18252-------
18253
18254- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
18255 were added to the string module. These a locale-independent
18256 constants, unlike letters, lowercase, and uppercase. These are now
18257 use in appropriate locations in the standard library.
18258
18259- The flags used in dlopen calls can now be configured using
18260 sys.setdlopenflags and queried using sys.getdlopenflags.
18261
18262- Fredrik Lundh's xmlrpclib is now a standard library module. This
18263 provides full client-side XML-RPC support. In addition,
18264 Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
18265 one asyncore-based). Thanks to Eric Raymond for the documentation.
18266
18267- The xrange() object is simplified: it no longer supports slicing,
18268 repetition, comparisons, efficient 'in' checking, the tolist()
18269 method, or the start, stop and step attributes. See PEP 260.
18270
18271- A new function fnmatch.filter to filter lists of file names was added.
18272
18273- calendar.py uses month and day names based on the current locale.
18274
18275- strop is now *really* obsolete (this was announced before with 1.6),
18276 and issues DeprecationWarning when used (except for the four items
18277 that are still imported into string.py).
18278
18279- Cookie.py now sorts key+value pairs by key in output strings.
18280
18281- pprint.isrecursive(object) didn't correctly identify recursive objects.
18282 Now it does.
18283
18284- pprint functions now much faster for large containers (tuple, list, dict).
18285
18286- New 'q' and 'Q' format codes in the struct module, corresponding to C
18287 types "long long" and "unsigned long long" (on Windows, __int64). In
18288 native mode, these can be used only when the platform C compiler supports
18289 these types (when HAVE_LONG_LONG is #define'd by the Python config
18290 process), and then they inherit the sizes and alignments of the C types.
18291 In standard mode, 'q' and 'Q' are supported on all platforms, and are
18292 8-byte integral types.
18293
18294- The site module installs a new built-in function 'help' that invokes
18295 pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
18296 it displays a message reminding the user to use 'help()' or
18297 'help(object)'.
18298
18299Tests
18300-----
18301
18302- New test_mutants.py runs dict comparisons where the key and value
18303 comparison operators mutate the dicts randomly during comparison. This
18304 rapidly causes Python to crash under earlier releases (not for the faint
18305 of heart: it can also cause Win9x to freeze or reboot!).
18306
18307- New test_pprint.py verifies that pprint.isrecursive() and
18308 pprint.isreadable() return sensible results. Also verifies that simple
18309 cases produce correct output.
18310
18311C API
18312-----
18313
18314- Removed the unused last_is_sticky argument from the internal
18315 _PyTuple_Resize(). If this affects you, you were cheating.
18316
Skip Montanaro4cb22042002-09-17 20:55:31 +000018317What's New in Python 2.1 (final)?
18318=================================
18319
18320We only changed a few things since the last release candidate, all in
18321Python library code:
18322
18323- A bug in the locale module was fixed that affected locales which
18324 define no grouping for numeric formatting.
18325
18326- A few bugs in the weakref module's implementations of weak
18327 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
18328 and the test suite was updated to check for these bugs.
18329
18330- An old bug in the os.path.walk() function (introduced in Python
18331 2.0!) was fixed: a non-existent file would cause an exception
18332 instead of being ignored.
18333
18334- Fixed a few bugs in the new symtable module found by Neil Norwitz's
18335 PyChecker.
18336
18337
18338What's New in Python 2.1c2?
18339===========================
18340
18341A flurry of small changes, and one showstopper fixed in the nick of
18342time made it necessary to release another release candidate. The list
18343here is the *complete* list of patches (except version updates):
18344
18345Core
18346
18347- Tim discovered a nasty bug in the dictionary code, caused by
18348 PyDict_Next() calling dict_resize(), and the GC code's use of
18349 PyDict_Next() violating an assumption in dict_items(). This was
18350 fixed with considerable amounts of band-aid, but the net effect is a
18351 saner and more robust implementation.
18352
18353- Made a bunch of symbols static that were accidentally global.
18354
18355Build and Ports
18356
18357- The setup.py script didn't check for a new enough version of zlib
18358 (1.1.3 is needed). Now it does.
18359
18360- Changed "make clean" target to also remove shared libraries.
18361
18362- Added a more general warning about the SGI Irix optimizer to README.
18363
18364Library
18365
18366- Fix a bug in urllib.basejoin("http://host", "../file.html") which
18367 omitted the slash between host and file.html.
18368
18369- The mailbox module's _Mailbox class contained a completely broken
18370 and undocumented seek() method. Ripped it out.
18371
18372- Fixed a bunch of typos in various library modules (urllib2, smtpd,
18373 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
18374
18375- Fixed a few last-minute bugs in unittest.
18376
18377Extensions
18378
18379- Reverted the patch to the OpenSSL code in socketmodule.c to support
18380 RAND_status() and the EGD, and the subsequent patch that tried to
18381 fix it for pre-0.9.5 versions; the problem with the patch is that on
18382 some systems it issues a warning whenever socket is imported, and
18383 that's unacceptable.
18384
18385Tests
18386
18387- Fixed the pickle tests to work with "import test.test_pickle".
18388
18389- Tweaked test_locale.py to actually run the test Windows.
18390
18391- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
18392 not "wb" (which is not a valid mode at all).
18393
18394- Fix pstats browser crashes. Import readline if it exists to make
18395 the user interface nicer.
18396
18397- Add "import thread" to the top of test modules that import the
18398 threading module (test_asynchat and test_threadedtempfile). This
18399 prevents test failures caused by a broken threading module resulting
18400 from a previously caught failed import.
18401
18402- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
18403 needed on some platforms (e.g. Solaris 8) when the tests are run
18404 twice in succession.
18405
18406- Skip rather than fail test_sunaudiodev if no audio device is found.
18407
18408
18409What's New in Python 2.1c1?
18410===========================
18411
18412This list was significantly updated when 2.1c2 was released; the 2.1c1
18413release didn't mention most changes that were actually part of 2.1c1:
18414
18415Legal
18416
18417- Copyright was assigned to the Python Software Foundation (PSF) and a
18418 PSF license (very similar to the CNRI license) was added.
18419
18420- The CNRI copyright notice was updated to include 2001.
18421
18422Core
18423
18424- After a public outcry, assignment to __debug__ is no longer illegal;
18425 instead, a warning is issued. It will become illegal in 2.2.
18426
18427- Fixed a core dump with "%#x" % 0, and changed the semantics so that
18428 "%#x" now always prepends "0x", even if the value is zero.
18429
18430- Fixed some nits in the bytecode compiler.
18431
18432- Fixed core dumps when calling certain kinds of non-functions.
18433
18434- Fixed various core dumps caused by reference count bugs.
18435
18436Build and Ports
18437
18438- Use INSTALL_SCRIPT to install script files.
18439
18440- New port: SCO Unixware 7, by Billy G. Allie.
18441
18442- Updated RISCOS port.
18443
18444- Updated BeOS port and notes.
18445
18446- Various other porting problems resolved.
18447
18448Library
18449
18450- The TERMIOS and SOCKET modules are now truly obsolete and
18451 unnecessary. Their symbols are incorporated in the termios and
18452 socket modules.
18453
18454- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
18455 better tests for pickling.
18456
18457- threading: make Condition.wait() robust against KeyboardInterrupt.
18458
18459- zipfile: add support to zipfile to support opening an archive
18460 represented by an open file rather than a file name. Fix bug where
18461 the archive was not properly closed. Fixed a bug in this bugfix
18462 where flush() was called for a read-only file.
18463
18464- imputil: added an uninstall() method to the ImportManager.
18465
18466- Canvas: fixed bugs in lower() and tkraise() methods.
18467
18468- SocketServer: API change (added overridable close_request() method)
18469 so that the TCP server can explicitly close the request.
18470
18471- pstats: Eric Raymond added a simple interactive statistics browser,
18472 invoked when the module is run as a script.
18473
18474- locale: fixed a problem in format().
18475
18476- webbrowser: made it work when the BROWSER environment variable has a
18477 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
18478 KDE 2. Fixed some other nits.
18479
18480- unittest: changes to allow using a different exception than
18481 AssertionError, and added a few more function aliases. Some other
18482 small changes.
18483
18484- urllib, urllib2: fixed redirect problems and a coupleof other nits.
18485
18486- asynchat: fixed a critical bug in asynchat that slipped through the
18487 2.1b2 release. Fixed another rare bug.
18488
18489- Fix some unqualified except: clauses (always a bad code example).
18490
18491XML
18492
18493- pyexpat: new API get_version_string().
18494
18495- Fixed some minidom bugs.
18496
18497Extensions
18498
18499- Fixed a core dump in _weakref. Removed the weakref.mapping()
18500 function (it adds nothing to the API).
18501
18502- Rationalized the use of header files in the readline module, to make
18503 it compile (albeit with some warnings) with the very recent readline
18504 4.2, without breaking for earlier versions.
18505
18506- Hopefully fixed a buffering problem in linuxaudiodev.
18507
18508- Attempted a fix to make the OpenSSL support in the socket module
18509 work again with pre-0.9.5 versions of OpenSSL.
18510
18511Tests
18512
18513- Added a test case for asynchat and asyncore.
18514
18515- Removed coupling between tests where one test failing could break
18516 another.
18517
18518Tools
18519
18520- Ping added an interactive help browser to pydoc, fixed some nits
18521 in the rest of the pydoc code, and added some features to his
18522 inspect module.
18523
18524- An updated python-mode.el version 4.1 which integrates Ken
18525 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
18526 much nicer in XEmacs and Emacs. When stepping through your program
18527 with pdb, in either the shell window or the *Python* window, the
18528 source file and line will be tracked by an arrow. Very cool!
18529
18530- IDLE: syntax warnings in interactive mode are changed into errors.
18531
18532- Some improvements to Tools/webchecker (ignore some more URL types,
18533 follow some more links).
18534
18535- Brought the Tools/compiler package up to date.
18536
18537
18538What's New in Python 2.1 beta 2?
18539================================
18540
18541(Unlisted are many fixed bugs, more documentation, etc.)
18542
18543Core language, builtins, and interpreter
18544
18545- The nested scopes work (enabled by "from __future__ import
18546 nested_scopes") is completed; in particular, the future now extends
18547 into code executed through exec, eval() and execfile(), and into the
18548 interactive interpreter.
18549
18550- When calling a base class method (e.g. BaseClass.__init__(self)),
18551 this is now allowed even if self is not strictly spoken a class
18552 instance (e.g. when using metaclasses or the Don Beaudry hook).
18553
18554- Slice objects are now comparable but not hashable; this prevents
18555 dict[:] from being accepted but meaningless.
18556
18557- Complex division is now calculated using less braindead algorithms.
18558 This doesn't change semantics except it's more likely to give useful
18559 results in extreme cases. Complex repr() now uses full precision
18560 like float repr().
18561
18562- sgmllib.py now calls handle_decl() for simple <!...> declarations.
18563
18564- It is illegal to assign to the name __debug__, which is set when the
18565 interpreter starts. It is effectively a compile-time constant.
18566
18567- A warning will be issued if a global statement for a variable
18568 follows a use or assignment of that variable.
18569
18570Standard library
18571
18572- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
18573 inspired by JUnit), is now part of the standard library. You now
18574 have a choice of two testing frameworks: unittest requires you to
18575 write testcases as separate code, doctest gathers them from
18576 docstrings. Both approaches have their advantages and
18577 disadvantages.
18578
18579- A new module Tix was added, which wraps the Tix extension library
18580 for Tk. With that module, it is not necessary to statically link
18581 Tix with _tkinter, since Tix will be loaded with Tcl's "package
18582 require" command. See Demo/tix/.
18583
18584- tzparse.py is now obsolete.
18585
18586- In gzip.py, the seek() and tell() methods are removed -- they were
18587 non-functional anyway, and it's better if callers can test for their
18588 existence with hasattr().
18589
18590Python/C API
18591
18592- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
18593 that's already in the dictionary during a PyDict_Next() iteration.
18594 This used to fail occasionally when a dictionary resize operation
18595 could be triggered that would rehash all the keys. All other
18596 modifications to the dictionary are still off-limits during a
18597 PyDict_Next() iteration!
18598
18599- New extended APIs related to passing compiler variables around.
18600
18601- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
18602 implement isinstance() and issubclass().
18603
18604- Py_BuildValue() now has a "D" conversion to create a Python complex
18605 number from a Py_complex C value.
18606
18607- Extensions types which support weak references must now set the
18608 field allocated for the weak reference machinery to NULL themselves;
18609 this is done to avoid the cost of checking each object for having a
18610 weakly referencable type in PyObject_INIT(), since most types are
18611 not weakly referencable.
18612
18613- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
18614 free variables and cell variables to and from the frame's f_locals.
18615
18616- Variants of several functions defined in pythonrun.h have been added
18617 to support the nested_scopes future statement. The variants all end
18618 in Flags and take an extra argument, a PyCompilerFlags *; examples:
18619 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
18620 variants may be removed in Python 2.2, when nested scopes are
18621 mandatory.
18622
18623Distutils
18624
18625- the sdist command now writes a PKG-INFO file, as described in PEP 241,
18626 into the release tree.
18627
18628- several enhancements to the bdist_wininst command from Thomas Heller
18629 (an uninstaller, more customization of the installer's display)
18630
18631- from Jack Jansen: added Mac-specific code to generate a dialog for
18632 users to specify the command-line (because providing a command-line with
18633 MacPython is awkward). Jack also made various fixes for the Mac
18634 and the Metrowerks compiler.
18635
18636- added 'platforms' and 'keywords' to the set of metadata that can be
18637 specified for a distribution.
18638
18639- applied patches from Jason Tishler to make the compiler class work with
18640 Cygwin.
18641
18642
18643What's New in Python 2.1 beta 1?
18644================================
18645
18646Core language, builtins, and interpreter
18647
18648- Following an outcry from the community about the amount of code
18649 broken by the nested scopes feature introduced in 2.1a2, we decided
18650 to make this feature optional, and to wait until Python 2.2 (or at
18651 least 6 months) to make it standard. The option can be enabled on a
18652 per-module basis by adding "from __future__ import nested_scopes" at
18653 the beginning of a module (before any other statements, but after
18654 comments and an optional docstring). See PEP 236 (Back to the
18655 __future__) for a description of the __future__ statement. PEP 227
18656 (Statically Nested Scopes) has been updated to reflect this change,
18657 and to clarify the semantics in a number of endcases.
18658
18659- The nested scopes code, when enabled, has been hardened, and most
18660 bugs and memory leaks in it have been fixed.
18661
18662- Compile-time warnings are now generated for a number of conditions
18663 that will break or change in meaning when nested scopes are enabled:
18664
18665 - Using "from...import *" or "exec" without in-clause in a function
18666 scope that also defines a lambda or nested function with one or
18667 more free (non-local) variables. The presence of the import* or
18668 bare exec makes it impossible for the compiler to determine the
18669 exact set of local variables in the outer scope, which makes it
18670 impossible to determine the bindings for free variables in the
18671 inner scope. To avoid the warning about import *, change it into
18672 an import of explicitly name object, or move the import* statement
18673 to the global scope; to avoid the warning about bare exec, use
18674 exec...in... (a good idea anyway -- there's a possibility that
18675 bare exec will be deprecated in the future).
18676
18677 - Use of a global variable in a nested scope with the same name as a
18678 local variable in a surrounding scope. This will change in
18679 meaning with nested scopes: the name in the inner scope will
18680 reference the variable in the outer scope rather than the global
18681 of the same name. To avoid the warning, either rename the outer
18682 variable, or use a global statement in the inner function.
18683
18684- An optional object allocator has been included. This allocator is
18685 optimized for Python objects and should be faster and use less memory
18686 than the standard system allocator. It is not enabled by default
18687 because of possible thread safety problems. The allocator is only
18688 protected by the Python interpreter lock and it is possible that some
18689 extension modules require a thread safe allocator. The object
18690 allocator can be enabled by providing the "--with-pymalloc" option to
18691 configure.
18692
18693Standard library
18694
18695- pyexpat now detects the expat version if expat.h defines it. A
18696 number of additional handlers are provided, which are only available
18697 since expat 1.95. In addition, the methods SetParamEntityParsing and
18698 GetInputContext of Parser objects are available with 1.95.x
18699 only. Parser objects now provide the ordered_attributes and
18700 specified_attributes attributes. A new module expat.model was added,
18701 which offers a number of additional constants if 1.95.x is used.
18702
18703- xml.dom offers the new functions registerDOMImplementation and
18704 getDOMImplementation.
18705
18706- xml.dom.minidom offers a toprettyxml method. A number of DOM
18707 conformance issues have been resolved. In particular, Element now
18708 has an hasAttributes method, and the handling of namespaces was
18709 improved.
18710
18711- Ka-Ping Yee contributed two new modules: inspect.py, a module for
18712 getting information about live Python code, and pydoc.py, a module
18713 for interactively converting docstrings to HTML or text.
18714 Tools/scripts/pydoc, which is now automatically installed into
18715 <prefix>/bin, uses pydoc.py to display documentation; try running
18716 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
18717 lets you browse the module docstrings using a web browser.
18718
18719- New library module difflib.py, primarily packaging the SequenceMatcher
18720 class at the heart of the popular ndiff.py file-comparison tool.
18721
18722- doctest.py (a framework for verifying Python code examples in docstrings)
18723 is now part of the std library.
18724
18725Windows changes
18726
18727- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
18728 small GUI that lets you browse the module docstrings using your
18729 default web browser.
18730
18731- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
18732 Platforms) is implemented. See
18733
18734 http://python.sourceforge.net/peps/pep-0235.html
18735
18736 for full details, especially the "Current Lower-Left Semantics" section.
18737 The new Windows import rules are simpler than before:
18738
18739 A. If the PYTHONCASEOK environment variable exists, same as
18740 before: silently accept the first case-insensitive match of any
18741 kind; raise ImportError if none found.
18742
18743 B. Else search sys.path for the first case-sensitive match; raise
18744 ImportError if none found.
18745
18746 The same rules have been implemented on other platforms with case-
18747 insensitive but case-preserving filesystems too (including Cygwin, and
18748 several flavors of Macintosh operating systems).
18749
18750- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
18751 what it's supposed to do (and does do under NT and 2000) via direct
18752 port manipulation. It's unknown whether this will work on all systems,
18753 but it does work on my Win98SE systems now and was known to be useless on
18754 all Win9x systems before.
18755
18756- Build: Subproject _test (effectively) renamed to _testcapi.
18757
18758New platforms
18759
18760- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
18761 Thanks to Steven Majewski!
18762
18763- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
18764 Tishler!
18765
18766- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
18767 Schwertberger! See RISCOS/README for more information -- it seems
18768 that because of the bizarre filename conventions on RISCOS, no port
18769 to that platform is easy.
18770
18771
18772What's New in Python 2.1 alpha 2?
18773=================================
18774
18775Core language, builtins, and interpreter
18776
18777- Scopes nest. If a name is used in a function or class, but is not
18778 local, the definition in the nearest enclosing function scope will
18779 be used. One consequence of this change is that lambda statements
18780 could reference variables in the namespaces where the lambda is
18781 defined. In some unusual cases, this change will break code.
18782
18783 In all previous version of Python, names were resolved in exactly
18784 three namespaces -- the local namespace, the global namespace, and
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018785 the builtins namespace. According to this old definition, if a
Skip Montanaro4cb22042002-09-17 20:55:31 +000018786 function A is defined within a function B, the names bound in B are
18787 not visible in A. The new rules make names bound in B visible in A,
18788 unless A contains a name binding that hides the binding in B.
18789
18790 Section 4.1 of the reference manual describes the new scoping rules
18791 in detail. The test script in Lib/test/test_scope.py demonstrates
18792 some of the effects of the change.
18793
18794 The new rules will cause existing code to break if it defines nested
18795 functions where an outer function has local variables with the same
18796 name as globals or builtins used by the inner function. Example:
18797
18798 def munge(str):
18799 def helper(x):
18800 return str(x)
18801 if type(str) != type(''):
18802 str = helper(str)
18803 return str.strip()
18804
18805 Under the old rules, the name str in helper() is bound to the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018806 built-in function str(). Under the new rules, it will be bound to
Skip Montanaro4cb22042002-09-17 20:55:31 +000018807 the argument named str and an error will occur when helper() is
18808 called.
18809
18810- The compiler will report a SyntaxError if "from ... import *" occurs
18811 in a function or class scope. The language reference has documented
18812 that this case is illegal, but the compiler never checked for it.
18813 The recent introduction of nested scope makes the meaning of this
18814 form of name binding ambiguous. In a future release, the compiler
18815 may allow this form when there is no possibility of ambiguity.
18816
18817- repr(string) is easier to read, now using hex escapes instead of octal,
18818 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
18819
18820 >>> "\texample \r\n" + chr(0) + chr(255)
18821 '\texample \r\n\x00\xff' # in 2.1
18822 '\011example \015\012\000\377' # in 2.0
18823
18824- Functions are now compared and hashed by identity, not by value, since
18825 the func_code attribute is writable.
18826
18827- Weak references (PEP 205) have been added. This involves a few
18828 changes in the core, an extension module (_weakref), and a Python
18829 module (weakref). The weakref module is the public interface. It
18830 includes support for "explicit" weak references, proxy objects, and
18831 mappings with weakly held values.
18832
18833- A 'continue' statement can now appear in a try block within the body
18834 of a loop. It is still not possible to use continue in a finally
18835 clause.
18836
18837Standard library
18838
18839- mailbox.py now has a new class, PortableUnixMailbox which is
18840 identical to UnixMailbox but uses a more portable scheme for
18841 determining From_ separators. Also, the constructors for all the
18842 classes in this module have a new optional `factory' argument, which
18843 is a callable used when new message classes must be instantiated by
18844 the next() method.
18845
18846- random.py is now self-contained, and offers all the functionality of
18847 the now-deprecated whrandom.py. See the docs for details. random.py
18848 also supports new functions getstate() and setstate(), for saving
18849 and restoring the internal state of the generator; and jumpahead(n),
18850 for quickly forcing the internal state to be the same as if n calls to
18851 random() had been made. The latter is particularly useful for multi-
18852 threaded programs, creating one instance of the random.Random() class for
18853 each thread, then using .jumpahead() to force each instance to use a
18854 non-overlapping segment of the full period.
18855
18856- random.py's seed() function is new. For bit-for-bit compatibility with
18857 prior releases, use the whseed function instead. The new seed function
18858 addresses two problems: (1) The old function couldn't produce more than
18859 about 2**24 distinct internal states; the new one about 2**45 (the best
18860 that can be done in the Wichmann-Hill generator). (2) The old function
18861 sometimes produced identical internal states when passed distinct
18862 integers, and there was no simple way to predict when that would happen;
18863 the new one guarantees to produce distinct internal states for all
18864 arguments in [0, 27814431486576L).
18865
18866- The socket module now supports raw packets on Linux. The socket
18867 family is AF_PACKET.
18868
18869- test_capi.py is a start at running tests of the Python C API. The tests
18870 are implemented by the new Modules/_testmodule.c.
18871
18872- A new extension module, _symtable, provides provisional access to the
18873 internal symbol table used by the Python compiler. A higher-level
18874 interface will be added on top of _symtable in a future release.
18875
18876- Removed the obsolete soundex module.
18877
18878- xml.dom.minidom now uses the standard DOM exceptions. Node supports
18879 the isSameNode method; NamedNodeMap the get method.
18880
18881- xml.sax.expatreader supports the lexical handler property; it
18882 generates comment, startCDATA, and endCDATA events.
18883
18884Windows changes
18885
18886- Build procedure: the zlib project is built in a different way that
18887 ensures the zlib header files used can no longer get out of synch with
18888 the zlib binary used. See PCbuild\readme.txt for details. Your old
18889 zlib-related directories can be deleted; you'll need to download fresh
18890 source for zlib and unpack it into a new directory.
18891
18892- Build: New subproject _test for the benefit of test_capi.py (see above).
18893
18894- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
18895 interface to some Python compiler internals).
18896
18897- Build: Subproject ucnhash is gone, since the code was folded into the
18898 unicodedata subproject.
18899
18900What's New in Python 2.1 alpha 1?
18901=================================
18902
18903Core language, builtins, and interpreter
18904
18905- There is a new Unicode companion to the PyObject_Str() API
18906 called PyObject_Unicode(). It behaves in the same way as the
18907 former, but assures that the returned value is an Unicode object
18908 (applying the usual coercion if necessary).
18909
18910- The comparison operators support "rich comparison overloading" (PEP
18911 207). C extension types can provide a rich comparison function in
18912 the new tp_richcompare slot in the type object. The cmp() function
18913 and the C function PyObject_Compare() first try the new rich
18914 comparison operators before trying the old 3-way comparison. There
18915 is also a new C API PyObject_RichCompare() (which also falls back on
18916 the old 3-way comparison, but does not constrain the outcome of the
18917 rich comparison to a Boolean result).
18918
18919 The rich comparison function takes two objects (at least one of
18920 which is guaranteed to have the type that provided the function) and
18921 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
18922 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
18923 object, which may be NotImplemented (in which case the tp_compare
18924 slot function is used as a fallback, if defined).
18925
18926 Classes can overload individual comparison operators by defining one
18927 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
18928 __ge__. There are no explicit "reflected argument" versions of
18929 these; instead, __lt__ and __gt__ are each other's reflection,
18930 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
18931 reflection (similar at the C level). No other implications are
18932 made; in particular, Python does not assume that == is the Boolean
18933 inverse of !=, or that < is the Boolean inverse of >=. This makes
18934 it possible to define types with partial orderings.
18935
18936 Classes or types that want to implement (in)equality tests but not
18937 the ordering operators (i.e. unordered types) should implement ==
18938 and !=, and raise an error for the ordering operators.
18939
18940 It is possible to define types whose rich comparison results are not
18941 Boolean; e.g. a matrix type might want to return a matrix of bits
18942 for A < B, giving elementwise comparisons. Such types should ensure
18943 that any interpretation of their value in a Boolean context raises
18944 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
18945 at the C level) to always raise an exception.
18946
18947- Complex numbers use rich comparisons to define == and != but raise
18948 an exception for <, <=, > and >=. Unfortunately, this also means
18949 that cmp() of two complex numbers raises an exception when the two
18950 numbers differ. Since it is not mathematically meaningful to compare
18951 complex numbers except for equality, I hope that this doesn't break
18952 too much code.
18953
18954- The outcome of comparing non-numeric objects of different types is
18955 not defined by the language, other than that it's arbitrary but
18956 consistent (see the Reference Manual). An implementation detail changed
18957 in 2.1a1 such that None now compares less than any other object. Code
18958 relying on this new behavior (like code that relied on the previous
18959 behavior) does so at its own risk.
18960
18961- Functions and methods now support getting and setting arbitrarily
18962 named attributes (PEP 232). Functions have a new __dict__
18963 (a.k.a. func_dict) which hold the function attributes. Methods get
18964 and set attributes on their underlying im_func. It is a TypeError
18965 to set an attribute on a bound method.
18966
18967- The xrange() object implementation has been improved so that
18968 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
18969 limitation that in this case len(xrange(sys.maxint)) can't be
18970 calculated, but the common idiom "for i in xrange(sys.maxint)" will
18971 work fine as long as the index i doesn't actually reach 2**31.
18972 (Python uses regular ints for sequence and string indices; fixing
18973 that is much more work.)
18974
18975- Two changes to from...import:
18976
18977 1) "from M import X" now works even if (after loading module M)
18978 sys.modules['M'] is not a real module; it's basically a getattr()
18979 operation with AttributeError exceptions changed into ImportError.
18980
18981 2) "from M import *" now looks for M.__all__ to decide which names to
18982 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
18983 filters out names starting with '_' as before. Whether or not
18984 __all__ exists, there's no restriction on the type of M.
18985
18986- File objects have a new method, xreadlines(). This is the fastest
18987 way to iterate over all lines in a file:
18988
18989 for line in file.xreadlines():
18990 ...do something to line...
18991
18992 See the xreadlines module (mentioned below) for how to do this for
18993 other file-like objects.
18994
18995- Even if you don't use file.xreadlines(), you may expect a speedup on
18996 line-by-line input. The file.readline() method has been optimized
18997 quite a bit in platform-specific ways: on systems (like Linux) that
18998 support flockfile(), getc_unlocked(), and funlockfile(), those are
18999 used by default. On systems (like Windows) without getc_unlocked(),
19000 a complicated (but still thread-safe) method using fgets() is used by
19001 default.
19002
19003 You can force use of the fgets() method by #define'ing
19004 USE_FGETS_IN_GETLINE at build time (it may be faster than
19005 getc_unlocked()).
19006
19007 You can force fgets() not to be used by #define'ing
19008 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
19009 test_bufio.py fails -- and let us know if it does!).
19010
19011- In addition, the fileinput module, while still slower than the other
19012 methods on most platforms, has been sped up too, by using
19013 file.readlines(sizehint).
19014
19015- Support for run-time warnings has been added, including a new
19016 command line option (-W) to specify the disposition of warnings.
19017 See the description of the warnings module below.
19018
19019- Extensive changes have been made to the coercion code. This mostly
19020 affects extension modules (which can now implement mixed-type
19021 numerical operators without having to use coercion), but
19022 occasionally, in boundary cases the coercion semantics have changed
19023 subtly. Since this was a terrible gray area of the language, this
19024 is considered an improvement. Also note that __rcmp__ is no longer
19025 supported -- instead of calling __rcmp__, __cmp__ is called with
19026 reflected arguments.
19027
19028- In connection with the coercion changes, a new built-in singleton
19029 object, NotImplemented is defined. This can be returned for
19030 operations that wish to indicate they are not implemented for a
19031 particular combination of arguments. From C, this is
19032 Py_NotImplemented.
19033
19034- The interpreter accepts now bytecode files on the command line even
19035 if they do not have a .pyc or .pyo extension. On Linux, after executing
19036
19037import imp,sys,string
19038magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
19039reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
19040open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
19041
19042 any byte code file can be used as an executable (i.e. as an argument
19043 to execve(2)).
19044
19045- %[xXo] formats of negative Python longs now produce a sign
19046 character. In 1.6 and earlier, they never produced a sign,
19047 and raised an error if the value of the long was too large
19048 to fit in a Python int. In 2.0, they produced a sign if and
19049 only if too large to fit in an int. This was inconsistent
19050 across platforms (because the size of an int varies across
19051 platforms), and inconsistent with hex() and oct(). Example:
19052
19053 >>> "%x" % -0x42L
19054 '-42' # in 2.1
19055 'ffffffbe' # in 2.0 and before, on 32-bit machines
19056 >>> hex(-0x42L)
19057 '-0x42L' # in all versions of Python
19058
19059 The behavior of %d formats for negative Python longs remains
19060 the same as in 2.0 (although in 1.6 and before, they raised
19061 an error if the long didn't fit in a Python int).
19062
19063 %u formats don't make sense for Python longs, but are allowed
19064 and treated the same as %d in 2.1. In 2.0, a negative long
19065 formatted via %u produced a sign if and only if too large to
19066 fit in an int. In 1.6 and earlier, a negative long formatted
19067 via %u raised an error if it was too big to fit in an int.
19068
19069- Dictionary objects have an odd new method, popitem(). This removes
19070 an arbitrary item from the dictionary and returns it (in the form of
19071 a (key, value) pair). This can be useful for algorithms that use a
19072 dictionary as a bag of "to do" items and repeatedly need to pick one
19073 item. Such algorithms normally end up running in quadratic time;
19074 using popitem() they can usually be made to run in linear time.
19075
19076Standard library
19077
19078- In the time module, the time argument to the functions strftime,
19079 localtime, gmtime, asctime and ctime is now optional, defaulting to
19080 the current time (in the local timezone).
19081
19082- The ftplib module now defaults to passive mode, which is deemed a
19083 more useful default given that clients are often inside firewalls
19084 these days. Note that this could break if ftplib is used to connect
19085 to a *server* that is inside a firewall, from outside; this is
19086 expected to be a very rare situation. To fix that, you can call
19087 ftp.set_pasv(0).
19088
19089- The module site now treats .pth files not only for path configuration,
19090 but also supports extensions to the initialization code: Lines starting
19091 with import are executed.
19092
19093- There's a new module, warnings, which implements a mechanism for
19094 issuing and filtering warnings. There are some new built-in
19095 exceptions that serve as warning categories, and a new command line
19096 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
19097 turns warnings into errors). warnings.warn(message[, category])
19098 issues a warning message; this can also be called from C as
19099 PyErr_Warn(category, message).
19100
19101- A new module xreadlines was added. This exports a single factory
19102 function, xreadlines(). The intention is that this code is the
19103 absolutely fastest way to iterate over all lines in an open
19104 file(-like) object:
19105
19106 import xreadlines
19107 for line in xreadlines.xreadlines(file):
19108 ...do something to line...
19109
19110 This is equivalent to the previous the speed record holder using
19111 file.readlines(sizehint). Note that if file is a real file object
19112 (as opposed to a file-like object), this is equivalent:
19113
19114 for line in file.xreadlines():
19115 ...do something to line...
19116
19117- The bisect module has new functions bisect_left, insort_left,
19118 bisect_right and insort_right. The old names bisect and insort
19119 are now aliases for bisect_right and insort_right. XXX_right
19120 and XXX_left methods differ in what happens when the new element
19121 compares equal to one or more elements already in the list: the
19122 XXX_left methods insert to the left, the XXX_right methods to the
19123 right. Code that doesn't care where equal elements end up should
19124 continue to use the old, short names ("bisect" and "insort").
19125
19126- The new curses.panel module wraps the panel library that forms part
19127 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
19128
19129- The SocketServer module now sets the allow_reuse_address flag by
19130 default in the TCPServer class.
19131
19132- A new function, sys._getframe(), returns the stack frame pointer of
19133 the caller. This is intended only as a building block for
19134 higher-level mechanisms such as string interpolation.
19135
19136- The pyexpat module supports a number of new handlers, which are
19137 available only in expat 1.2. If invocation of a callback fails, it
19138 will report an additional frame in the traceback. Parser objects
19139 participate now in garbage collection. If expat reports an unknown
19140 encoding, pyexpat will try to use a Python codec; that works only
19141 for single-byte charsets. The parser type objects is exposed as
19142 XMLParserObject.
19143
19144- xml.dom now offers standard definitions for symbolic node type and
19145 exception code constants, and a hierarchy of DOM exceptions. minidom
19146 was adjusted to use them.
19147
19148- The conformance of xml.dom.minidom to the DOM specification was
19149 improved. It detects a number of additional error cases; the
19150 previous/next relationship works even when the tree is modified;
19151 Node supports the normalize() method; NamedNodeMap, DocumentType and
19152 DOMImplementation classes were added; Element supports the
19153 hasAttribute and hasAttributeNS methods; and Text supports the splitText
19154 method.
19155
19156Build issues
19157
19158- For Unix (and Unix-compatible) builds, configuration and building of
19159 extension modules is now greatly automated. Rather than having to
19160 edit the Modules/Setup file to indicate which modules should be
19161 built and where their include files and libraries are, a
19162 distutils-based setup.py script now takes care of building most
19163 extension modules. All extension modules built this way are built
19164 as shared libraries. Only a few modules that must be linked
19165 statically are still listed in the Setup file; you won't need to
19166 edit their configuration.
19167
19168- Python should now build out of the box on Cygwin. If it doesn't,
19169 mail to Jason Tishler (jlt63 at users.sourceforge.net).
19170
19171- Python now always uses its own (renamed) implementation of getopt()
19172 -- there's too much variation among C library getopt()
19173 implementations.
19174
19175- C++ compilers are better supported; the CXX macro is always set to a
19176 C++ compiler if one is found.
19177
19178Windows changes
19179
19180- select module: By default under Windows, a select() call
19181 can specify no more than 64 sockets. Python now boosts
19182 this Microsoft default to 512. If you need even more than
19183 that, see the MS docs (you'll need to #define FD_SETSIZE
19184 and recompile Python from source).
19185
19186- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
19187 subdirectory is no more!
19188
19189
19190What's New in Python 2.0?
19191=========================
19192
19193Below is a list of all relevant changes since release 1.6. Older
19194changes are in the file HISTORY. If you are making the jump directly
19195from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
19196HISTORY file! Many important changes listed there.
19197
19198Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
19199the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000019200http://www.amk.ca/python/2.0/.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019201
19202--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
19203
19204======================================================================
19205
19206What's new in 2.0 (since release candidate 1)?
19207==============================================
19208
19209Standard library
19210
19211- The copy_reg module was modified to clarify its intended use: to
19212 register pickle support for extension types, not for classes.
19213 pickle() will raise a TypeError if it is passed a class.
19214
19215- Fixed a bug in gettext's "normalize and expand" code that prevented
19216 it from finding an existing .mo file.
19217
19218- Restored support for HTTP/0.9 servers in httplib.
19219
19220- The math module was changed to stop raising OverflowError in case of
19221 underflow, and return 0 instead in underflow cases. Whether Python
19222 used to raise OverflowError in case of underflow was platform-
19223 dependent (it did when the platform math library set errno to ERANGE
19224 on underflow).
19225
19226- Fixed a bug in StringIO that occurred when the file position was not
19227 at the end of the file and write() was called with enough data to
19228 extend past the end of the file.
19229
19230- Fixed a bug that caused Tkinter error messages to get lost on
19231 Windows. The bug was fixed by replacing direct use of
19232 interp->result with Tcl_GetStringResult(interp).
19233
19234- Fixed bug in urllib2 that caused it to fail when it received an HTTP
19235 redirect response.
19236
19237- Several changes were made to distutils: Some debugging code was
19238 removed from util. Fixed the installer used when an external zip
19239 program (like WinZip) is not found; the source code for this
19240 installer is in Misc/distutils. check_lib() was modified to behave
19241 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
19242 test for whether installed modules are on sys.path was changed to
19243 use both normcase() and normpath().
19244
19245- Several minor bugs were fixed in the xml package (the minidom,
19246 pulldom, expatreader, and saxutils modules).
19247
19248- The regression test driver (regrtest.py) behavior when invoked with
19249 -l changed: It now reports a count of objects that are recognized as
19250 garbage but not freed by the garbage collector.
19251
19252- The regression test for the math module was changed to test
19253 exceptional behavior when the test is run in verbose mode. Python
19254 cannot yet guarantee consistent exception behavior across platforms,
19255 so the exception part of test_math is run only in verbose mode, and
19256 may fail on your platform.
19257
19258Internals
19259
19260- PyOS_CheckStack() has been disabled on Win64, where it caused
19261 test_sre to fail.
19262
19263Build issues
19264
19265- Changed compiler flags, so that gcc is always invoked with -Wall and
19266 -Wstrict-prototypes. Users compiling Python with GCC should see
19267 exactly one warning, except if they have passed configure the
19268 --with-pydebug flag. The expected warning is for getopt() in
19269 Modules/main.c. This warning will be fixed for Python 2.1.
19270
19271- Fixed configure to add -threads argument during linking on OSF1.
19272
19273Tools and other miscellany
19274
19275- The compiler in Tools/compiler was updated to support the new
19276 language features introduced in 2.0: extended print statement, list
19277 comprehensions, and augmented assignments. The new compiler should
19278 also be backwards compatible with Python 1.5.2; the compiler will
19279 always generate code for the version of the interpreter it runs
19280 under.
19281
19282What's new in 2.0 release candidate 1 (since beta 2)?
19283=====================================================
19284
19285What is release candidate 1?
19286
19287We believe that release candidate 1 will fix all known bugs that we
19288intend to fix for the 2.0 final release. This release should be a bit
19289more stable than the previous betas. We would like to see even more
19290widespread testing before the final release, so we are producing this
19291release candidate. The final release will be exactly the same unless
19292any show-stopping (or brown bag) bugs are found by testers of the
19293release candidate.
19294
19295All the changes since the last beta release are bug fixes or changes
19296to support building Python for specific platforms.
19297
19298Core language, builtins, and interpreter
19299
19300- A bug that caused crashes when __coerce__ was used with augmented
19301 assignment, e.g. +=, was fixed.
19302
19303- Raise ZeroDivisionError when raising zero to a negative number,
Georg Brandl93dc9eb2010-03-14 10:56:14 +000019304 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the built-in
Skip Montanaro4cb22042002-09-17 20:55:31 +000019305 power operator and the result of math.pow(0.0, -2.0) will vary by
19306 platform. On Linux, it raises a ValueError.
19307
19308- A bug in Unicode string interpolation was fixed that occasionally
19309 caused errors with formats including "%%". For example, the
19310 following expression "%% %s" % u"abc" no longer raises a TypeError.
19311
19312- Compilation of deeply nested expressions raises MemoryError instead
19313 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
19314
19315- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
19316 rendering them useless. They are now written in binary mode again.
19317
19318Standard library
19319
19320- Keyword arguments are now accepted for most pattern and match object
19321 methods in SRE, the standard regular expression engine.
19322
19323- In SRE, fixed error with negative lookahead and lookbehind that
19324 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
19325
19326- Several bugs in the Unicode handling and error handling in _tkinter
19327 were fixed.
19328
19329- Fix memory management errors in Merge() and Tkapp_Call() routines.
19330
19331- Several changes were made to cStringIO to make it compatible with
19332 the file-like object interface and with StringIO. If operations are
19333 performed on a closed object, an exception is raised. The truncate
19334 method now accepts a position argument and readline accepts a size
19335 argument.
19336
19337- There were many changes made to the linuxaudiodev module and its
19338 test suite; as a result, a short, unexpected audio sample should now
19339 play when the regression test is run.
19340
19341 Note that this module is named poorly, because it should work
19342 correctly on any platform that supports the Open Sound System
19343 (OSS).
19344
19345 The module now raises exceptions when errors occur instead of
19346 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
19347 audio) and defines a getptr() method that calls the
19348 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
19349
19350- The library_version attribute, introduced in an earlier beta, was
19351 removed because it can not be supported with early versions of the C
19352 readline library, which provides no way to determine the version at
19353 compile-time.
19354
19355- The binascii module is now enabled on Win64.
19356
19357- tokenize.py no longer suffers "recursion depth" errors when parsing
19358 programs with very long string literals.
19359
19360Internals
19361
19362- Fixed several buffer overflow vulnerabilities in calculate_path(),
19363 which is called when the interpreter starts up to determine where
19364 the standard library is installed. These vulnerabilities affect all
19365 previous versions of Python and can be exploited by setting very
19366 long values for PYTHONHOME or argv[0]. The risk is greatest for a
19367 setuid Python script, although use of the wrapper in
19368 Misc/setuid-prog.c will eliminate the vulnerability.
19369
19370- Fixed garbage collection bugs in instance creation that were
19371 triggered when errors occurred during initialization. The solution,
19372 applied in cPickle and in PyInstance_New(), is to call
19373 PyObject_GC_Init() after the initialization of the object's
19374 container attributes is complete.
19375
19376- pyexpat adds definitions of PyModule_AddStringConstant and
19377 PyModule_AddObject if the Python version is less than 2.0, which
19378 provides compatibility with PyXML on Python 1.5.2.
19379
19380- If the platform has a bogus definition for LONG_BIT (the number of
19381 bits in a long), an error will be reported at compile time.
19382
19383- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
19384 collection crashes and possibly other, unreported crashes.
19385
19386- Fixed a memory leak in _PyUnicode_Fini().
19387
19388Build issues
19389
19390- configure now accepts a --with-suffix option that specifies the
19391 executable suffix. This is useful for builds on Cygwin and Mac OS
19392 X, for example.
19393
19394- The mmap.PAGESIZE constant is now initialized using sysconf when
19395 possible, which eliminates a dependency on -lucb for Reliant UNIX.
19396
19397- The md5 file should now compile on all platforms.
19398
19399- The select module now compiles on platforms that do not define
19400 POLLRDNORM and related constants.
19401
19402- Darwin (Mac OS X): Initial support for static builds on this
19403 platform.
19404
19405- BeOS: A number of changes were made to the build and installation
19406 process. ar-fake now operates on a directory of object files.
19407 dl_export.h is gone, and its macros now appear on the mwcc command
19408 line during build on PPC BeOS.
19409
19410- Platform directory in lib/python2.0 is "plat-beos5" (or
19411 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
19412
19413- Cygwin: Support for shared libraries, Tkinter, and sockets.
19414
19415- SunOS 4.1.4_JL: Fix test for directory existence in configure.
19416
19417Tools and other miscellany
19418
19419- Removed debugging prints from main used with freeze.
19420
19421- IDLE auto-indent no longer crashes when it encounters Unicode
19422 characters.
19423
19424What's new in 2.0 beta 2 (since beta 1)?
19425========================================
19426
19427Core language, builtins, and interpreter
19428
19429- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
19430 "%d" % 2L**64 == "18446744073709551616".
19431
19432- Add -h and -V command line options to print the usage message and
19433 Python version number and exit immediately.
19434
19435- eval() and exec accept Unicode objects as code parameters.
19436
19437- getattr() and setattr() now also accept Unicode objects for the
19438 attribute name, which are converted to strings using the default
19439 encoding before lookup.
19440
19441- Multiplication on string and Unicode now does proper bounds
19442 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
19443 string is too long."
19444
19445- Better error message when continue is found in try statement in a
19446 loop.
19447
19448
19449Standard library and extensions
19450
19451- socket module: the OpenSSL code now adds support for RAND_status()
19452 and EGD (Entropy Gathering Device).
19453
19454- array: reverse() method of array now works. buffer_info() now does
19455 argument checking; it still takes no arguments.
19456
19457- asyncore/asynchat: Included most recent version from Sam Rushing.
19458
19459- cgi: Accept '&' or ';' as separator characters when parsing form data.
19460
19461- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
19462
19463- ConfigParser: When reading the file, options spelled in upper case
19464 letters are now correctly converted to lowercase.
19465
19466- copy: Copy Unicode objects atomically.
19467
19468- cPickle: Fail gracefully when copy_reg can't be imported.
19469
19470- cStringIO: Implemented readlines() method.
19471
19472- dbm: Add get() and setdefault() methods to dbm object. Add constant
19473 `library' to module that names the library used. Added doc strings
19474 and method names to error messages. Uses configure to determine
19475 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
19476 now available options.
19477
19478- distutils: Update to version 0.9.3.
19479
19480- dl: Add several dl.RTLD_ constants.
19481
19482- fpectl: Now supported on FreeBSD.
19483
19484- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
19485 found by the collector will be saved in gc.garbage. This is useful
19486 for debugging a program that creates reference cycles.
19487
19488- httplib: Three changes: Restore support for set_debuglevel feature
19489 of HTTP class. Do not close socket on zero-length response. Do not
19490 crash when server sends invalid content-length header.
19491
19492- mailbox: Mailbox class conforms better to qmail specifications.
19493
19494- marshal: When reading a short, sign-extend on platforms where shorts
19495 are bigger than 16 bits. When reading a long, repair the unportable
19496 sign extension that was being done for 64-bit machines. (It assumed
19497 that signed right shift sign-extends.)
19498
19499- operator: Add contains(), invert(), __invert__() as aliases for
19500 __contains__(), inv(), and __inv__() respectively.
19501
19502- os: Add support for popen2() and popen3() on all platforms where
19503 fork() exists. (popen4() is still in the works.)
19504
19505- os: (Windows only:) Add startfile() function that acts like double-
19506 clicking on a file in Explorer (or passing the file name to the
19507 DOS "start" command).
19508
19509- os.path: (Windows, DOS:) Treat trailing colon correctly in
19510 os.path.join. os.path.join("a:", "b") yields "a:b".
19511
19512- pickle: Now raises ValueError when an invalid pickle that contains
19513 a non-string repr where a string repr was expected. This behavior
19514 matches cPickle.
19515
19516- posixfile: Remove broken __del__() method.
19517
19518- py_compile: support CR+LF line terminators in source file.
19519
19520- readline: Does not immediately exit when ^C is hit when readline and
19521 threads are configured. Adds definition of rl_library_version. (The
19522 latter addition requires GNU readline 2.2 or later.)
19523
19524- rfc822: Domain literals returned by AddrlistClass method
19525 getdomainliteral() are now properly wrapped in brackets.
19526
19527- site: sys.setdefaultencoding() should only be called in case the
19528 standard default encoding ("ascii") is changed. This saves quite a
19529 few cycles during startup since the first call to
19530 setdefaultencoding() will initialize the codec registry and the
19531 encodings package.
19532
19533- socket: Support for size hint in readlines() method of object returned
19534 by makefile().
19535
19536- sre: Added experimental expand() method to match objects. Does not
19537 use buffer interface on Unicode strings. Does not hang if group id
19538 is followed by whitespace.
19539
19540- StringIO: Size hint in readlines() is now supported as documented.
19541
19542- struct: Check ranges for bytes and shorts.
19543
19544- urllib: Improved handling of win32 proxy settings. Fixed quote and
19545 quote_plus functions so that the always encode a comma.
19546
19547- Tkinter: Image objects are now guaranteed to have unique ids. Set
19548 event.delta to zero if Tk version doesn't support mousewheel.
19549 Removed some debugging prints.
19550
19551- UserList: now implements __contains__().
19552
19553- webbrowser: On Windows, use os.startfile() instead of os.popen(),
19554 which works around a bug in Norton AntiVirus 2000 that leads directly
19555 to a Blue Screen freeze.
19556
19557- xml: New version detection code allows PyXML to override standard
19558 XML package if PyXML version is greater than 0.6.1.
19559
19560- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
19561 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
19562 tree only for nodes which are sufficiently interesting to a specific
19563 application. Does not provide the HTML-specific extensions. Still
19564 undocumented.
19565
19566- xml.sax: SAX 2 support for Python, including all the handler
19567 interfaces needed to process XML 1.0 compliant XML. Some
19568 documentation is already available.
19569
19570- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
19571 packagized XML support.
19572
19573
19574C API
19575
19576- Add three new convenience functions for module initialization --
19577 PyModule_AddObject(), PyModule_AddIntConstant(), and
19578 PyModule_AddStringConstant().
19579
19580- Cleaned up definition of NULL in C source code; all definitions were
19581 removed and add #error to Python.h if NULL isn't defined after
19582 #include of stdio.h.
19583
19584- Py_PROTO() macros that were removed in 2.0b1 have been restored for
19585 backwards compatibility (at the source level) with old extensions.
19586
19587- A wrapper API was added for signal() and sigaction(). Instead of
19588 either function, always use PyOS_getsig() to get a signal handler
19589 and PyOS_setsig() to set one. A new convenience typedef
19590 PyOS_sighandler_t is defined for the type of signal handlers.
19591
19592- Add PyString_AsStringAndSize() function that provides access to the
19593 internal data buffer and size of a string object -- or the default
19594 encoded version of a Unicode object.
19595
19596- PyString_Size() and PyString_AsString() accept Unicode objects.
19597
19598- The standard header <limits.h> is now included by Python.h (if it
19599 exists). INT_MAX and LONG_MAX will always be defined, even if
19600 <limits.h> is not available.
19601
19602- PyFloat_FromString takes a second argument, pend, that was
19603 effectively useless. It is now officially useless but preserved for
19604 backwards compatibility. If the pend argument is not NULL, *pend is
19605 set to NULL.
19606
19607- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
19608 for the attribute name. See note on getattr() above.
19609
19610- A few bug fixes to argument processing for Unicode.
19611 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
19612 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
19613 pointer to the default encoded string data instead of to the raw
19614 UTF-16.
19615
19616- Py_BuildValue accepts B format (for bgen-generated code).
19617
19618
19619Internals
19620
19621- On Unix, fix code for finding Python installation directory so that
19622 it works when argv[0] is a relative path.
19623
19624- Added a true unicode_internal_encode() function and fixed the
19625 unicode_internal_decode function() to support Unicode objects directly
19626 rather than by generating a copy of the object.
19627
19628- Several of the internal Unicode tables are much smaller now, and
19629 the source code should be much friendlier to weaker compilers.
19630
19631- In the garbage collector: Fixed bug in collection of tuples. Fixed
19632 bug that caused some instances to be removed from the container set
19633 while they were still live. Fixed parsing in gc.set_debug() for
19634 platforms where sizeof(long) > sizeof(int).
19635
19636- Fixed refcount problem in instance deallocation that only occurred
19637 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
19638
19639- On Windows, getpythonregpath is now protected against null data in
19640 registry key.
19641
19642- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
19643 condition.
19644
19645
19646Build and platform-specific issues
19647
19648- Better support of GNU Pth via --with-pth configure option.
19649
19650- Python/C API now properly exposed to dynamically-loaded extension
19651 modules on Reliant UNIX.
19652
19653- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
19654 Don't define MS_SYNC to be zero when it is undefined. Added missing
19655 prototypes in posixmodule.c.
19656
19657- Improved support for HP-UX build. Threads should now be correctly
19658 configured (on HP-UX 10.20 and 11.00).
19659
19660- Fix largefile support on older NetBSD systems and OpenBSD by adding
19661 define for TELL64.
19662
19663
19664Tools and other miscellany
19665
19666- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
19667
19668- freeze: The modulefinder now works with 2.0 opcodes.
19669
19670- IDLE:
19671 Move hackery of sys.argv until after the Tk instance has been
19672 created, which allows the application-specific Tkinter
19673 initialization to be executed if present; also pass an explicit
19674 className parameter to the Tk() constructor.
19675
19676
19677What's new in 2.0 beta 1?
19678=========================
19679
19680Source Incompatibilities
19681------------------------
19682
19683None. Note that 1.6 introduced several incompatibilities with 1.5.2,
19684such as single-argument append(), connect() and bind(), and changes to
19685str(long) and repr(float).
19686
19687
19688Binary Incompatibilities
19689------------------------
19690
19691- Third party extensions built for Python 1.5.x or 1.6 cannot be used
19692with Python 2.0; these extensions will have to be rebuilt for Python
196932.0.
19694
19695- On Windows, attempting to import a third party extension built for
19696Python 1.5.x or 1.6 results in an immediate crash; there's not much we
19697can do about this. Check your PYTHONPATH environment variable!
19698
19699- Python bytecode files (*.pyc and *.pyo) are not compatible between
19700releases.
19701
19702
19703Overview of Changes Since 1.6
19704-----------------------------
19705
19706There are many new modules (including brand new XML support through
19707the xml package, and i18n support through the gettext module); a list
19708of all new modules is included below. Lots of bugs have been fixed.
19709
19710The process for making major new changes to the language has changed
19711since Python 1.6. Enhancements must now be documented by a Python
19712Enhancement Proposal (PEP) before they can be accepted.
19713
19714There are several important syntax enhancements, described in more
19715detail below:
19716
19717 - Augmented assignment, e.g. x += 1
19718
19719 - List comprehensions, e.g. [x**2 for x in range(10)]
19720
19721 - Extended import statement, e.g. import Module as Name
19722
19723 - Extended print statement, e.g. print >> file, "Hello"
19724
19725Other important changes:
19726
19727 - Optional collection of cyclical garbage
19728
19729Python Enhancement Proposal (PEP)
19730---------------------------------
19731
19732PEP stands for Python Enhancement Proposal. A PEP is a design
19733document providing information to the Python community, or describing
19734a new feature for Python. The PEP should provide a concise technical
19735specification of the feature and a rationale for the feature.
19736
19737We intend PEPs to be the primary mechanisms for proposing new
19738features, for collecting community input on an issue, and for
19739documenting the design decisions that have gone into Python. The PEP
19740author is responsible for building consensus within the community and
19741documenting dissenting opinions.
19742
19743The PEPs are available at http://python.sourceforge.net/peps/.
19744
19745Augmented Assignment
19746--------------------
19747
19748This must have been the most-requested feature of the past years!
19749Eleven new assignment operators were added:
19750
19751 += -= *= /= %= **= <<= >>= &= ^= |=
19752
19753For example,
19754
19755 A += B
19756
19757is similar to
19758
19759 A = A + B
19760
19761except that A is evaluated only once (relevant when A is something
19762like dict[index].attr).
19763
19764However, if A is a mutable object, A may be modified in place. Thus,
19765if A is a number or a string, A += B has the same effect as A = A+B
19766(except A is only evaluated once); but if a is a list, A += B has the
19767same effect as A.extend(B)!
19768
19769Classes and built-in object types can override the new operators in
19770order to implement the in-place behavior; the not-in-place behavior is
19771used automatically as a fallback when an object doesn't implement the
19772in-place behavior. For classes, the method name is derived from the
19773method name for the corresponding not-in-place operator by inserting
19774an 'i' in front of the name, e.g. __iadd__ implements in-place
19775__add__.
19776
19777Augmented assignment was implemented by Thomas Wouters.
19778
19779
19780List Comprehensions
19781-------------------
19782
19783This is a flexible new notation for lists whose elements are computed
19784from another list (or lists). The simplest form is:
19785
19786 [<expression> for <variable> in <sequence>]
19787
19788For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
19789This is more efficient than a for loop with a list.append() call.
19790
19791You can also add a condition:
19792
19793 [<expression> for <variable> in <sequence> if <condition>]
19794
19795For example, [w for w in words if w == w.lower()] would yield the list
19796of words that contain no uppercase characters. This is more efficient
19797than a for loop with an if statement and a list.append() call.
19798
19799You can also have nested for loops and more than one 'if' clause. For
19800example, here's a function that flattens a sequence of sequences::
19801
19802 def flatten(seq):
19803 return [x for subseq in seq for x in subseq]
19804
19805 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
19806
19807This prints
19808
19809 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
19810
19811List comprehensions originated as a patch set from Greg Ewing; Skip
19812Montanaro and Thomas Wouters also contributed. Described by PEP 202.
19813
19814
19815Extended Import Statement
19816-------------------------
19817
19818Many people have asked for a way to import a module under a different
19819name. This can be accomplished like this:
19820
19821 import foo
19822 bar = foo
19823 del foo
19824
19825but this common idiom gets old quickly. A simple extension of the
19826import statement now allows this to be written as follows:
19827
19828 import foo as bar
19829
19830There's also a variant for 'from ... import':
19831
19832 from foo import bar as spam
19833
19834This also works with packages; e.g. you can write this:
19835
19836 import test.regrtest as regrtest
19837
19838Note that 'as' is not a new keyword -- it is recognized only in this
19839context (this is only possible because the syntax for the import
19840statement doesn't involve expressions).
19841
19842Implemented by Thomas Wouters. Described by PEP 221.
19843
19844
19845Extended Print Statement
19846------------------------
19847
19848Easily the most controversial new feature, this extension to the print
19849statement adds an option to make the output go to a different file
19850than the default sys.stdout.
19851
19852For example, to write an error message to sys.stderr, you can now
19853write:
19854
19855 print >> sys.stderr, "Error: bad dog!"
19856
19857As a special feature, if the expression used to indicate the file
19858evaluates to None, the current value of sys.stdout is used. Thus:
19859
19860 print >> None, "Hello world"
19861
19862is equivalent to
19863
19864 print "Hello world"
19865
19866Design and implementation by Barry Warsaw. Described by PEP 214.
19867
19868
19869Optional Collection of Cyclical Garbage
19870---------------------------------------
19871
19872Python is now equipped with a garbage collector that can hunt down
19873cyclical references between Python objects. It's no replacement for
19874reference counting; in fact, it depends on the reference counts being
19875correct, and decides that a set of objects belong to a cycle if all
19876their reference counts can be accounted for from their references to
19877each other. This devious scheme was first proposed by Eric Tiedemann,
19878and brought to implementation by Neil Schemenauer.
19879
19880There's a module "gc" that lets you control some parameters of the
19881garbage collection. There's also an option to the configure script
19882that lets you enable or disable the garbage collection. In 2.0b1,
19883it's on by default, so that we (hopefully) can collect decent user
19884experience with this new feature. There are some questions about its
19885performance. If it proves to be too much of a problem, we'll turn it
19886off by default in the final 2.0 release.
19887
19888
19889Smaller Changes
19890---------------
19891
19892A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
19893map(None, seq1, seq2, ...) when the sequences have the same length;
19894i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
19895the lists are not all the same length, the shortest list wins:
19896zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
19897
19898sys.version_info is a tuple (major, minor, micro, level, serial).
19899
19900Dictionaries have an odd new method, setdefault(key, default).
19901dict.setdefault(key, default) returns dict[key] if it exists; if not,
19902it sets dict[key] to default and returns that value. Thus:
19903
19904 dict.setdefault(key, []).append(item)
19905
19906does the same work as this common idiom:
19907
19908 if not dict.has_key(key):
19909 dict[key] = []
19910 dict[key].append(item)
19911
19912There are two new variants of SyntaxError that are raised for
19913indentation-related errors: IndentationError and TabError.
19914
19915Changed \x to consume exactly two hex digits; see PEP 223. Added \U
19916escape that consumes exactly eight hex digits.
19917
19918The limits on the size of expressions and file in Python source code
19919have been raised from 2**16 to 2**32. Previous versions of Python
19920were limited because the maximum argument size the Python VM accepted
19921was 2**16. This limited the size of object constructor expressions,
19922e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
19923limit was raised thanks to a patch by Charles Waldman that effectively
19924fixes the problem. It is now much more likely that you will be
19925limited by available memory than by an arbitrary limit in Python.
19926
19927The interpreter's maximum recursion depth can be modified by Python
19928programs using sys.getrecursionlimit and sys.setrecursionlimit. This
19929limit is the maximum number of recursive calls that can be made by
19930Python code. The limit exists to prevent infinite recursion from
19931overflowing the C stack and causing a core dump. The default value is
199321000. The maximum safe value for a particular platform can be found
Georg Brandl93d15cd2009-10-11 21:24:34 +000019933by running Tools/scripts/find_recursionlimit.py.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019934
19935New Modules and Packages
19936------------------------
19937
19938atexit - for registering functions to be called when Python exits.
19939
19940imputil - Greg Stein's alternative API for writing custom import
19941hooks.
19942
19943pyexpat - an interface to the Expat XML parser, contributed by Paul
19944Prescod.
19945
19946xml - a new package with XML support code organized (so far) in three
19947subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
19948would fill a volume. There's a special feature whereby a
19949user-installed package named _xmlplus overrides the standard
19950xmlpackage; this is intended to give the XML SIG a hook to distribute
19951backwards-compatible updates to the standard xml package.
19952
19953webbrowser - a platform-independent API to launch a web browser.
19954
19955
19956Changed Modules
19957---------------
19958
19959array -- new methods for array objects: count, extend, index, pop, and
19960remove
19961
19962binascii -- new functions b2a_hex and a2b_hex that convert between
19963binary data and its hex representation
19964
19965calendar -- Many new functions that support features including control
19966over which day of the week is the first day, returning strings instead
19967of printing them. Also new symbolic constants for days of week,
19968e.g. MONDAY, ..., SUNDAY.
19969
19970cgi -- FieldStorage objects have a getvalue method that works like a
19971dictionary's get method and returns the value attribute of the object.
19972
19973ConfigParser -- The parser object has new methods has_option,
19974remove_section, remove_option, set, and write. They allow the module
19975to be used for writing config files as well as reading them.
19976
19977ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
19978optionally support the RFC 959 REST command.
19979
19980gzip -- readline and readlines now accept optional size arguments
19981
19982httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
19983the module doc strings for details.
19984
19985locale -- implement getdefaultlocale for Win32 and Macintosh
19986
19987marshal -- no longer dumps core when marshaling deeply nested or
19988recursive data structures
19989
19990os -- new functions isatty, seteuid, setegid, setreuid, setregid
19991
19992os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
19993support under Unix.
19994
19995os/pty -- support for openpty and forkpty
19996
19997os.path -- fix semantics of os.path.commonprefix
19998
19999smtplib -- support for sending very long messages
20000
20001socket -- new function getfqdn()
20002
20003readline -- new functions to read, write and truncate history files.
20004The readline section of the library reference manual contains an
20005example.
20006
20007select -- add interface to poll system call
20008
20009shutil -- new copyfileobj function
20010
20011SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
20012HTTP server.
20013
20014Tkinter -- optimization of function flatten
20015
20016urllib -- scans environment variables for proxy configuration,
20017e.g. http_proxy.
20018
20019whichdb -- recognizes dumbdbm format
20020
20021
20022Obsolete Modules
20023----------------
20024
20025None. However note that 1.6 made a whole slew of modules obsolete:
20026stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
20027poly, zmod, strop, util, whatsound.
20028
20029
20030Changed, New, Obsolete Tools
20031----------------------------
20032
20033None.
20034
20035
20036C-level Changes
20037---------------
20038
20039Several cleanup jobs were carried out throughout the source code.
20040
20041All C code was converted to ANSI C; we got rid of all uses of the
20042Py_PROTO() macro, which makes the header files a lot more readable.
20043
20044Most of the portability hacks were moved to a new header file,
20045pyport.h; several other new header files were added and some old
20046header files were removed, in an attempt to create a more rational set
20047of header files. (Few of these ever need to be included explicitly;
20048they are all included by Python.h.)
20049
20050Trent Mick ensured portability to 64-bit platforms, under both Linux
20051and Win64, especially for the new Intel Itanium processor. Mick also
20052added large file support for Linux64 and Win64.
20053
20054The C APIs to return an object's size have been update to consistently
20055use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
20056previous versions, the abstract interfaces used PyXXX_Length and the
20057concrete interfaces used PyXXX_Size. The old names,
20058e.g. PyObject_Length, are still available for backwards compatibility
20059at the API level, but are deprecated.
20060
20061The PyOS_CheckStack function has been implemented on Windows by
20062Fredrik Lundh. It prevents Python from failing with a stack overflow
20063on Windows.
20064
20065The GC changes resulted in creation of two new slots on object,
20066tp_traverse and tp_clear. The augmented assignment changes result in
20067the creation of a new slot for each in-place operator.
20068
20069The GC API creates new requirements for container types implemented in
20070C extension modules. See Include/objimpl.h for details.
20071
20072PyErr_Format has been updated to automatically calculate the size of
20073the buffer needed to hold the formatted result string. This change
20074prevents crashes caused by programmer error.
20075
20076New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
20077
20078PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
20079that are the same as their non-Ex counterparts except they take an
20080extra flag argument that tells them to close the file when done.
20081
20082XXX There were other API changes that should be fleshed out here.
20083
20084
20085Windows Changes
20086---------------
20087
20088New popen2/popen3/peopen4 in os module (see Changed Modules above).
20089
20090os.popen is much more usable on Windows 95 and 98. See Microsoft
20091Knowledge Base article Q150956. The Win9x workaround described there
20092is implemented by the new w9xpopen.exe helper in the root of your
20093Python installation. Note that Python uses this internally; it is not
20094a standalone program.
20095
20096Administrator privileges are no longer required to install Python
20097on Windows NT or Windows 2000. If you have administrator privileges,
20098Python's registry info will be written under HKEY_LOCAL_MACHINE.
20099Otherwise the installer backs off to writing Python's registry info
20100under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
20101uses of Python, but will prevent some advanced uses from working
20102(for example, running a Python script as an NT service, or possibly
20103from CGI).
20104
20105[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
20106installer; instead, it installs the needed Tcl/Tk files directly in the
20107Python directory. If you already have a Tcl/Tk installation, this
20108wastes some disk space (about 4 Megs) but avoids problems with
20109conflicting Tcl/Tk installations, and makes it much easier for Python
20110to ensure that Tcl/Tk can find all its files.
20111
20112[This was new in 1.6] The Windows installer now installs by default in
20113\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
20114
20115
20116Updates to the changes between 1.5.2 and 1.6
20117--------------------------------------------
20118
20119The 1.6 NEWS file can't be changed after the release is done, so here
20120is some late-breaking news:
20121
20122New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
20123and changes to getlocale() and setlocale().
20124
20125The new module is now enabled per default.
20126
20127It is not true that the encodings codecs cannot be used for normal
20128strings: the string.encode() (which is also present on 8-bit strings
20129!) allows using them for 8-bit strings too, e.g. to convert files from
20130cp1252 (Windows) to latin-1 or vice-versa.
20131
20132Japanese codecs are available from Tamito KAJIYAMA:
20133http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
20134
20135
20136======================================================================
20137
20138
Guido van Rossumf2eac992000-09-04 17:24:24 +000020139=======================================
20140==> Release 1.6 (September 5, 2000) <==
20141=======================================
20142
Guido van Rossuma598c932000-09-04 16:26:03 +000020143What's new in release 1.6?
20144==========================
20145
20146Below is a list of all relevant changes since release 1.5.2.
20147
20148
20149Source Incompatibilities
20150------------------------
20151
20152Several small incompatible library changes may trip you up:
20153
20154 - The append() method for lists can no longer be invoked with more
20155 than one argument. This used to append a single tuple made out of
20156 all arguments, but was undocumented. To append a tuple, use
20157 e.g. l.append((a, b, c)).
20158
20159 - The connect(), connect_ex() and bind() methods for sockets require
20160 exactly one argument. Previously, you could call s.connect(host,
20161 port), but this was undocumented. You must now write
20162 s.connect((host, port)).
20163
20164 - The str() and repr() functions are now different more often. For
20165 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
20166 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
20167 For floats, repr() now gives 17 digits of precision, to ensure no
20168 precision is lost (on all current hardware).
20169
20170 - The -X option is gone. Built-in exceptions are now always
20171 classes. Many more library modules also have been converted to
20172 class-based exceptions.
20173
20174
20175Binary Incompatibilities
20176------------------------
20177
20178- Third party extensions built for Python 1.5.x cannot be used with
20179Python 1.6; these extensions will have to be rebuilt for Python 1.6.
20180
20181- On Windows, attempting to import a third party extension built for
20182Python 1.5.x results in an immediate crash; there's not much we can do
20183about this. Check your PYTHONPATH environment variable!
20184
20185
20186Overview of Changes since 1.5.2
20187-------------------------------
20188
20189For this overview, I have borrowed from the document "What's New in
20190Python 2.0" by Andrew Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000020191http://www.amk.ca/python/2.0/ .
Guido van Rossuma598c932000-09-04 16:26:03 +000020192
20193There are lots of new modules and lots of bugs have been fixed. A
20194list of all new modules is included below.
20195
20196Probably the most pervasive change is the addition of Unicode support.
20197We've added a new fundamental datatype, the Unicode string, a new
20198build-in function unicode(), an numerous C APIs to deal with Unicode
20199and encodings. See the file Misc/unicode.txt for details, or
20200http://starship.python.net/crew/lemburg/unicode-proposal.txt.
20201
20202Two other big changes, related to the Unicode support, are the
20203addition of string methods and (yet another) new regular expression
20204engine.
20205
20206 - String methods mean that you can now say s.lower() etc. instead of
20207 importing the string module and saying string.lower(s) etc. One
20208 peculiarity is that the equivalent of string.join(sequence,
20209 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
20210 the effect of string.join(sequence); to make this more readable, try
20211 space=" " first. Note that the maxsplit argument defaults in
20212 split() and replace() have changed from 0 to -1.
20213
20214 - The new regular expression engine, SRE by Fredrik Lundh, is fully
20215 backwards compatible with the old engine, and is in fact invoked
20216 using the same interface (the "re" module). You can explicitly
20217 invoke the old engine by import pre, or the SRE engine by importing
20218 sre. SRE is faster than pre, and supports Unicode (which was the
20219 main reason to put effort in yet another new regular expression
20220 engine -- this is at least the fourth!).
20221
20222
20223Other Changes
20224-------------
20225
20226Other changes that won't break code but are nice to know about:
20227
20228Deleting objects is now safe even for deeply nested data structures.
20229
20230Long/int unifications: long integers can be used in seek() calls, as
20231slice indexes.
20232
20233String formatting (s % args) has a new formatting option, '%r', which
20234acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
20235alpha 1.)
20236
20237Greg Ward's "distutils" package is included: this will make
20238installing, building and distributing third party packages much
20239simpler.
20240
20241There's now special syntax that you can use instead of the apply()
20242function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
20243You can also use variations f(a1, a2, *args, **kwds) and you can leave
20244one or the other out: f(*args), f(**kwds).
20245
20246The built-ins int() and long() take an optional second argument to
20247indicate the conversion base -- of course only if the first argument
20248is a string. This makes string.atoi() and string.atol() obsolete.
20249(string.atof() was already obsolete).
20250
20251When a local variable is known to the compiler but undefined when
20252used, a new exception UnboundLocalError is raised. This is a class
20253derived from NameError so code catching NameError should still work.
20254The purpose is to provide better diagnostics in the following example:
20255 x = 1
20256 def f():
20257 print x
20258 x = x+1
20259This used to raise a NameError on the print statement, which confused
20260even experienced Python programmers (especially if there are several
20261hundreds of lines of code between the reference and the assignment to
20262x :-).
20263
20264You can now override the 'in' operator by defining a __contains__
20265method. Note that it has its arguments backwards: x in a causes
20266a.__contains__(x) to be called. That's why the name isn't __in__.
20267
20268The exception AttributeError will have a more friendly error message,
20269e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
20270<b>break code</b> that expects the message to be exactly the attribute
20271name.
20272
20273
20274New Modules in 1.6
20275------------------
20276
20277UserString - base class for deriving from the string type.
20278
20279distutils - tools for distributing Python modules.
20280
20281robotparser - parse a robots.txt file, for writing web spiders.
20282(Moved from Tools/webchecker/.)
20283
20284linuxaudiodev - audio for Linux.
20285
20286mmap - treat a file as a memory buffer. (Windows and Unix.)
20287
20288sre - regular expressions (fast, supports unicode). Currently, this
20289code is very rough. Eventually, the re module will be reimplemented
20290using sre (without changes to the re API).
20291
20292filecmp - supersedes the old cmp.py and dircmp.py modules.
20293
20294tabnanny - check Python sources for tab-width dependance. (Moved from
20295Tools/scripts/.)
20296
20297urllib2 - new and improved but incompatible version of urllib (still
20298experimental).
20299
20300zipfile - read and write zip archives.
20301
20302codecs - support for Unicode encoders/decoders.
20303
20304unicodedata - provides access to the Unicode 3.0 database.
20305
20306_winreg - Windows registry access.
20307
20308encodings - package which provides a large set of standard codecs --
20309currently only for the new Unicode support. It has a drop-in extension
20310mechanism which allows you to add new codecs by simply copying them
20311into the encodings package directory. Asian codec support will
20312probably be made available as separate distribution package built upon
20313this technique and the new distutils package.
20314
20315
20316Changed Modules
20317---------------
20318
20319readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
20320chunk, wave, random, shelve, nntplib - minor enhancements.
20321
20322socket, httplib, urllib - optional OpenSSL support (Unix only).
20323
20324_tkinter - support for 8.0 up to 8.3. Support for versions older than
203258.0 has been dropped.
20326
20327string - most of this module is deprecated now that strings have
20328methods. This no longer uses the built-in strop module, but takes
20329advantage of the new string methods to provide transparent support for
20330both Unicode and ordinary strings.
20331
20332
20333Changes on Windows
20334------------------
20335
20336The installer no longer runs a separate Tcl/Tk installer; instead, it
20337installs the needed Tcl/Tk files directly in the Python directory. If
20338you already have a Tcl/Tk installation, this wastes some disk space
20339(about 4 Megs) but avoids problems with conflincting Tcl/Tk
20340installations, and makes it much easier for Python to ensure that
20341Tcl/Tk can find all its files. Note: the alpha installers don't
20342include the documentation.
20343
20344The Windows installer now installs by default in \Python16\ on the
20345default volume, instead of \Program Files\Python-1.6\.
20346
20347
20348Changed Tools
20349-------------
20350
20351IDLE - complete overhaul. See the <a href="../idle/">IDLE home
20352page</a> for more information. (Python 1.6 alpha 1 will come with
20353IDLE 0.6.)
20354
20355Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
20356text extraction tool used for internationalizing applications written
20357in Python.
20358
20359
20360Obsolete Modules
20361----------------
20362
20363stdwin and everything that uses it. (Get Python 1.5.2 if you need
20364it. :-)
20365
20366soundex. (Skip Montanaro has a version in Python but it won't be
20367included in the Python release.)
20368
20369cmp, cmpcache, dircmp. (Replaced by filecmp.)
20370
20371dump. (Use pickle.)
20372
20373find. (Easily coded using os.walk().)
20374
20375grep. (Not very useful as a library module.)
20376
20377packmail. (No longer has any use.)
20378
20379poly, zmod. (These were poor examples at best.)
20380
20381strop. (No longer needed by the string module.)
20382
20383util. (This functionality was long ago built in elsewhere).
20384
20385whatsound. (Use sndhdr.)
20386
20387
20388Detailed Changes from 1.6b1 to 1.6
20389----------------------------------
20390
20391- Slight changes to the CNRI license. A copyright notice has been
20392added; the requirement to indicate the nature of modifications now
20393applies when making a derivative work available "to others" instead of
20394just "to the public"; the version and date are updated. The new
20395license has a new handle.
20396
20397- Added the Tools/compiler package. This is a project led by Jeremy
20398Hylton to write the Python bytecode generator in Python.
20399
20400- The function math.rint() is removed.
20401
20402- In Python.h, "#define _GNU_SOURCE 1" was added.
20403
20404- Version 0.9.1 of Greg Ward's distutils is included (instead of
20405version 0.9).
20406
20407- A new version of SRE is included. It is more stable, and more
20408compatible with the old RE module. Non-matching ranges are indicated
20409by -1, not None. (The documentation said None, but the PRE
20410implementation used -1; changing to None would break existing code.)
20411
20412- The winreg module has been renamed to _winreg. (There are plans for
20413a higher-level API called winreg, but this has not yet materialized in
20414a form that is acceptable to the experts.)
20415
20416- The _locale module is enabled by default.
20417
20418- Fixed the configuration line for the _curses module.
20419
20420- A few crashes have been fixed, notably <file>.writelines() with a
20421list containing non-string objects would crash, and there were
20422situations where a lost SyntaxError could dump core.
20423
20424- The <list>.extend() method now accepts an arbitrary sequence
20425argument.
20426
20427- If __str__() or __repr__() returns a Unicode object, this is
20428converted to an 8-bit string.
20429
20430- Unicode string comparisons is no longer aware of UTF-16
20431encoding peculiarities; it's a straight 16-bit compare.
20432
20433- The Windows installer now installs the LICENSE file and no longer
20434registers the Python DLL version in the registry (this is no longer
20435needed). It now uses Tcl/Tk 8.3.2.
20436
20437- A few portability problems have been fixed, in particular a
20438compilation error involving socklen_t.
20439
20440- The PC configuration is slightly friendlier to non-Microsoft
20441compilers.
20442
20443
20444======================================================================
20445
20446
Guido van Rossumf2eac992000-09-04 17:24:24 +000020447======================================
20448==> Release 1.5.2 (April 13, 1999) <==
20449======================================
20450
Guido van Rossum2001da42000-09-01 22:26:44 +000020451From 1.5.2c1 to 1.5.2 (final)
20452=============================
20453
20454Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20455
20456 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
20457
20458 * PCbuild/python15.dsp: Added shamodule.c
20459
20460 * PC/config.c: Added sha module!
20461
20462 * README, Include/patchlevel.h: Prepare for final release.
20463
20464 * Misc/ACKS:
20465 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
20466
20467 * Python/thread_solaris.h:
20468 While I can't really test this thoroughly, Pat Knight and the Solaris
20469 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
20470 the flags on thr_create(), and that there really isn't a downside, so
20471 I'll do that.
20472
20473 * Misc/ACKS:
20474 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
20475
20476 * PC/python_nt.rc:
20477 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
20478 (I can't even display this on NT, maybe Win/98 can?)
20479
20480 * Lib/pstats.py:
20481 Fix mysterious references to jprofile that were in the source since
20482 its creation. I'm assuming these were once valid references to "Jim
20483 Roskind's profile"...
20484
20485 * Lib/Attic/threading_api.py:
20486 Removed; since long subsumed in Doc/lib/libthreading.tex
20487
20488 * Modules/socketmodule.c:
20489 Put back __osf__ support for gethostbyname_r(); the real bug was that
20490 it was being used even without threads. This of course might be an
20491 all-platform problem so now we only use the _r variant when we are
20492 using threads.
20493
20494Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20495
20496 * Modules/cPickle.c:
20497 Fix accidentally reversed NULL test in load_mark(). Suggested by
20498 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
20499 returns NULL.)
20500
20501 * README:
20502 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
20503
20504 * README: Add note about -D_REENTRANT for HP-UX 10.20.
20505
20506 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
20507
20508 * PC/Attic/vc40.mak, PC/readme.txt:
20509 Remove all VC++ info (except VC 1.5) from readme.txt;
20510 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
20511
20512 * README: Clarify PC build instructions (point to PCbuild).
20513
20514 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
20515
20516 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
20517 Forgot to add this file. CDROM device parameters.
20518
20519 * Lib/gzip.py: Two different changes.
20520
20521 1. Jack Jansen reports that on the Mac, the time may be negative, and
20522 solves this by adding a write32u() function that writes an unsigned
20523 long.
20524
20525 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
20526 casting both values to be compared to "unsigned long" i.e. modulo
20527 0x100000000L.
20528
20529Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20530
20531 * PC/Attic/_tkinter.def: No longer needed.
20532
20533 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
20534
20535 * README: Add DEC Ultrix notes (from Donn Cave's email).
20536
20537 * configure: The usual
20538
20539 * configure.in:
20540 Quote a bunch of shell variables used in test, related to long-long.
20541
20542 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
20543 casts for picky compilers.
20544
20545 * Modules/socketmodule.c:
20546 3-arg gethostbyname_r doesn't really work on OSF/1.
20547
20548 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
20549 Avoid totally empty files.
20550
20551Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20552
20553 * Tools/scripts/fixps.py: Use re instead of regex.
20554 Don't rewrite the file in place.
20555 (Reported by Andy Dustman.)
20556
20557 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
20558
20559Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20560
20561 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
20562 Add a variable %_TCL_% that makes it easier to switch to a different version.
20563
20564
20565======================================================================
20566
20567
20568From 1.5.2b2 to 1.5.2c1
20569=======================
20570
20571Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20572
20573 * PCbuild/python15.wse:
20574 Release 1.5.2c1. Add IDLE and Uninstall to program group.
20575 Don't distribute zlib.dll. Tweak some comments.
20576
20577 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
20578
20579 * 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:
20580 The usual
20581
20582 * Include/patchlevel.h: Release 1.5.2c1
20583
20584 * README: Release 1.5.2c1.
20585
20586 * Misc/NEWS: News for the 1.5.2c1 release.
20587
20588 * Lib/test/test_strftime.py:
20589 On Windows, we suddenly find, strftime() may return "" for an
20590 unsupported format string. (I guess this is because the logic for
20591 deciding whether to reallocate the buffer or not has been improved.)
20592 This caused the test code to crash on result[0]. Fix this by assuming
20593 an empty result also means the format is not supported.
20594
20595 * Demo/tkinter/matt/window-creation-w-location.py:
20596 This demo imported some private code from Matt. Make it cripple along.
20597
20598 * Lib/lib-tk/Tkinter.py:
20599 Delete an accidentally checked-in feature that actually broke more
20600 than was worth it: when deleting a canvas item, it would try to
20601 automatically delete the bindings for that item. Since there's
20602 nothing that says you can't reuse the tag and still have the bindings,
20603 this is not correct. Also, it broke at least one demo
20604 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
20605
20606 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
20607
20608Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20609
20610 * Modules/zlibmodule.c:
20611 Patch by Andrew Kuchling to unflush() (flush() for deflating).
20612 Without this, if inflate() returned Z_BUF_ERROR asking for more output
20613 space, we would report the error; now, we increase the buffer size and
20614 try again, just as for Z_OK.
20615
20616 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
20617
20618 * Tools/idle/ChangeLog: New change log.
20619
20620 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
20621
20622 * Python/pythonrun.c:
20623 Alas, get rid of the Win specific hack to ask the user to press Return
20624 before exiting when an error happened. This didn't work right when
20625 Python is invoked from a daemon.
20626
20627 * Tools/idle/idlever.py: Version bump awaiting impending new release.
20628 (Not much has changed :-( )
20629
20630 * Lib/lib-tk/Tkinter.py:
20631 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
20632 so the preferred name for them is tag_lower, tag_raise
20633 (similar to tag_bind, and similar to the Text widget);
20634 unfortunately can't delete the old ones yet (maybe in 1.6)
20635
20636 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
20637 Changes by Mark Hammond for Windows CE. Mostly of the form
20638 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
20639
20640 * Python/bltinmodule.c:
20641 Remove unused variable from complex_from_string() code.
20642
20643 * Include/patchlevel.h:
20644 Add the possibility of a gamma release (release candidate).
20645 Add '+' to string version number to indicate we're beyond b2 now.
20646
20647 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
20648
20649 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
20650
20651 Per writes:
20652
20653 """
20654 The application where Signum Support uses smtplib needs to be able to
20655 report good error messages to the user when sending email fails. To
20656 help in diagnosing problems it is useful to be able to report the
20657 entire message sent by the server, not only the SMTP error code of the
20658 offending command.
20659
20660 A lot of the functions in sendmail.py unfortunately discards the
20661 message, leaving only the code. The enclosed patch fixes that
20662 problem.
20663
20664 The enclosed patch also introduces a base class for exceptions that
20665 include an SMTP error code and error message, and make the code and
20666 message available on separate attributes, so that surrounding code can
20667 deal with them in whatever way it sees fit. I've also added some
20668 documentation to the exception classes.
20669
20670 The constructor will now raise an exception if it cannot connect to
20671 the SMTP server.
20672
20673 The data() method will raise an SMTPDataError if it doesn't receive
20674 the expected 354 code in the middle of the exchange.
20675
20676 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
20677 text, including no text at all" after the error code. If the response
20678 of a HELO command contains no text self.helo_resp will be set to the
20679 empty string (""). The patch fixes the test in the sendmail() method
20680 so that helo_resp is tested against None; if it has the empty string
20681 as value the sendmail() method would invoke the helo() method again.
20682
20683 The code no longer accepts a -1 reply from the ehlo() method in
20684 sendmail().
20685
20686 [Text about removing SMTPRecipientsRefused deleted --GvR]
20687 """
20688
20689 and also:
20690
20691 """
20692 smtplib.py appends an extra blank line to the outgoing mail if the
20693 `msg' argument to the sendmail method already contains a trailing
20694 newline. This patch should fix the problem.
20695 """
20696
20697 The Dragon writes:
20698
20699 """
20700 Mostly I just re-added the SMTPRecipientsRefused exception
20701 (the exeption object now has the appropriate info in it ) [Per had
20702 removed this in his patch --GvR] and tweaked the behavior of the
20703 sendmail method whence it throws the newly added SMTPHeloException (it
20704 was closing the connection, which it shouldn't. whatever catches the
20705 exception should do that. )
20706
20707 I pondered the change of the return values to tuples all around,
20708 and after some thinking I decided that regularizing the return values was
20709 too much of the Right Thing (tm) to not do.
20710
20711 My one concern is that code expecting an integer & getting a tuple
20712 may fail silently.
20713
20714 (i.e. if it's doing :
20715
20716 x.somemethod() >= 400:
20717 expecting an integer, the expression will always be true if it gets a
20718 tuple instead. )
20719
20720 However, most smtplib code I've seen only really uses the
20721 sendmail() method, so this wouldn't bother it. Usually code I've seen
20722 that calls the other methods usually only calls helo() and ehlo() for
20723 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
20724 and thus I would think not much code uses it yet.
20725 """
20726
20727Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20728
20729 * Lib/test/test_ntpath.py:
20730 Fix the tests now that splitdrive() no longer treats UNC paths special.
20731 (Some tests converted to splitunc() tests.)
20732
20733 * Lib/ntpath.py:
20734 Withdraw the UNC support from splitdrive(). Instead, a new function
20735 splitunc() parses UNC paths. The contributor of the UNC parsing in
20736 splitdrive() doesn't like it, but I haven't heard a good reason to
20737 keep it, and it causes some problems. (I think there's a
20738 philosophical problem -- to me, the split*() functions are purely
20739 syntactical, and the fact that \\foo is not a valid path doesn't mean
20740 that it shouldn't be considered an absolute path.)
20741
20742 Also (quite separately, but strangely related to the philosophical
20743 issue above) fix abspath() so that if win32api exists, it doesn't fail
20744 when the path doesn't actually exist -- if GetFullPathName() fails,
Mark Dickinson934896d2009-02-21 20:59:32 +000020745 fall back on the old strategy (join with getcwd() if necessary, and
Guido van Rossum2001da42000-09-01 22:26:44 +000020746 then use normpath()).
20747
20748 * configure.in, configure, config.h.in, acconfig.h:
20749 For BeOS PowerPC. Chris Herborth.
20750
20751Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20752
20753 * Modules/timemodule.c:
20754 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
20755 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
20756
20757 * Misc/ACKS:
20758 Bunch of new contributors, including 9 who contributed to the Docs,
20759 reported by Fred.
20760
20761Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20762
20763 * Lib/gzip.py:
20764 Oops, missed mode parameter to open().
20765
20766 * Lib/gzip.py:
20767 Made the default mode 'rb' instead of 'r', for better cross-platform
20768 support. (Based on comment on the documentation by Bernhard Reiter
20769 <bernhard@csd.uwm.edu>).
20770
20771Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20772
20773 * Tools/scripts/dutree.py:
20774 For reasons I dare not explain, this script should always execute
20775 main() when imported (in other words, it is not usable as a module).
20776
20777Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20778
20779 * Lib/test/test_cpickle.py: Jonathan Giddy write:
20780
20781 In test_cpickle.py, the module os got imported, but the line to remove
20782 the temp file has gone missing.
20783
20784Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20785
20786 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
20787
20788 If you send something like "PUT / HTTP/1.0" to something derived from
20789 BaseHTTPServer that doesn't define do_PUT, you will get a response
20790 that begins like this:
20791
20792 HTTP/1.0 501 Unsupported method ('do_PUT')
20793 Server: SimpleHTTP/0.3 Python/1.5
20794 Date: Tue, 30 Mar 1999 18:53:53 GMT
20795
20796 The server should complain about 'PUT' instead of 'do_PUT'. This
20797 patch should fix the problem.
20798
20799Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20800
20801 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
20802
20803 """
20804 - It needlessly used the makefile() method for each response that is
20805 read from the SMTP server.
20806
20807 - If the remote SMTP server closes the connection unexpectedly the
20808 code raised an IndexError. It now raises an SMTPServerDisconnected
20809 exception instead.
20810
20811 - The code now checks that all lines in a multiline response actually
20812 contains an error code.
20813 """
20814
20815 The Dragon approves.
20816
20817Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20818
20819 * Lib/compileall.py:
20820 When run as a script, report failures in the exit code as well.
20821 Patch largely based on changes by Andrew Dalke, as discussed in the
20822 distutils-sig.
20823
20824Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20825
20826 * Lib/urllib.py:
20827 Hack so that if a 302 or 301 redirect contains a relative URL, the
20828 right thing "just happens" (basejoin() with old URL).
20829
20830 * Modules/cPickle.c:
20831 Protection against picling to/from closed (real) file.
20832 The problem was reported by Moshe Zadka.
20833
20834 * Lib/test/test_cpickle.py:
20835 Test protection against picling to/from closed (real) file.
20836
20837 * Modules/timemodule.c: Chris Lawrence writes:
20838
20839 """
20840 The GNU folks, in their infinite wisdom, have decided not to implement
20841 altzone in libc6; this would not be horrible, except that timezone
20842 (which is implemented) includes the current DST setting (i.e. timezone
20843 for Central is 18000 in summer and 21600 in winter). So Python's
20844 timezone and altzone variables aren't set correctly during DST.
20845
20846 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
20847 show the "right" thing on Linux (by using the tm_gmtoff stuff
20848 available in BSD, which is how the GLIBC manual claims things should
20849 be done) and (b) should cope with the southern hemisphere. In pursuit
20850 of (b), I also took the liberty of renaming the "summer" and "winter"
20851 variables to "july" and "jan". This patch should also make certain
20852 time calculations on Linux actually work right (like the tz-aware
20853 functions in the rfc822 module).
20854
20855 (It's hard to find DST that's currently being used in the southern
20856 hemisphere; I tested using Africa/Windhoek.)
20857 """
20858
20859 * Lib/test/output/test_gzip:
20860 Jonathan Giddy discovered this file was missing.
20861
20862 * Modules/shamodule.c:
20863 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
20864 middlename) Marangozov, patch coded by Greg Stein.
20865
20866 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
20867 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
20868
20869Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20870
20871 * Tools/scripts/ndiff.py: Tim Peters writes:
20872
20873 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
20874 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
20875 for recreating the original files from ndiff's output. That's attached, if
20876 you're game! Us Windows guys don't usually have a sed sitting around
20877 <wink>.
20878
20879Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20880
20881 * Tools/scripts/ndiff.py: Tim Peters writes:
20882
20883 Attached is a cleaned-up version of ndiff (added useful module
20884 docstring, now echo'ed in case of cmd line mistake); added -q option
20885 to suppress initial file identification lines; + other minor cleanups,
20886 & a slightly faster match engine.
20887
20888Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20889
20890 * Tools/scripts/dutree.py:
20891 During display, if EPIPE is raised, it's probably because a pager was
20892 killed. Discard the error in that case, but propogate it otherwise.
20893
20894Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20895
20896 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
20897 Test suite for UserList.
20898
20899 * Lib/UserList.py: Use isinstance() where appropriate.
20900 Reformatted with 4-space indent.
20901
20902Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
20903
20904 * Tools/pynche/PyncheWidget.py:
20905 Helpwin.__init__(): The text widget should get focus.
20906
20907 * Tools/pynche/pyColorChooser.py:
20908 Removed unnecessary import `from PyncheWidget import PyncheWidget'
20909
20910Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20911
20912 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
20913 Test suite for UserDict
20914
20915 * Lib/UserDict.py: Improved a bunch of things.
20916 The constructor now takes an optional dictionary.
20917 Use isinstance() where appropriate.
20918
20919Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20920
20921 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
20922 Basic regr tests for pickle/cPickle
20923
20924 * Lib/pickle.py:
20925 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
20926 points out) it doesn't work in JPython Applets.
20927
20928Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20929
20930 * Lib/test/test_gzip.py:
20931 Added a simple test suite for gzip. It simply opens a temp file,
20932 writes a chunk of compressed data, closes it, writes another chunk, and
20933 reads the contents back to verify that they are the same.
20934
20935 * Lib/gzip.py:
20936 Based on a suggestion from bruce@hams.com, make a trivial change to
20937 allow using the 'a' flag as a mode for opening a GzipFile. gzip
20938 files, surprisingly enough, can be concatenated and then decompressed;
20939 the effect is to concatenate the two chunks of data.
20940
20941 If we support it on writing, it should also be supported on reading.
20942 This *wasn't* trivial, and required rearranging the code in the
20943 reading path, particularly the _read() method.
20944
20945 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
20946 and 'Unknown compression method'
20947
20948Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20949
20950 * Lib/test/test_b1.py:
20951 Add tests for float() and complex() with string args (Nick/Stephanie
20952 Lockwood).
20953
20954Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20955
20956 * Modules/zlibmodule.c:
20957 Add an .unused_data attribute to decompressor objects. If .unused_data
20958 is not an empty string, this means that you have arrived at the
20959 end of the stream of compressed data, and the contents of .unused_data are
20960 whatever follows the compressed stream.
20961
20962Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20963
20964 * Python/bltinmodule.c:
20965 Patch by Nick and Stephanie Lockwood to implement complex() with a string
20966 argument. This closes TODO item 2.19.
20967
20968Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20969
20970 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
20971 Unfortunately his code breaks wcgui.py in a way that's not easy
20972 to fix. I expect that this is a temporary situation --
20973 eventually Sam's changes will be merged back in.
20974 (The changes add a -t option to specify exceptions to the -x
20975 option, and explicit checking for #foo style fragment ids.)
20976
20977 * Objects/dictobject.c:
20978 Vladimir Marangozov contributed updated comments.
20979
20980 * Objects/bufferobject.c: Folded long lines.
20981
20982 * Lib/test/output/test_sha, Lib/test/test_sha.py:
20983 Added Jeremy's test code for the sha module.
20984
20985 * Modules/shamodule.c, Modules/Setup.in:
20986 Added Greg Stein and Andrew Kuchling's sha module.
20987 Fix comments about zlib version and URL.
20988
20989 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
20990
20991 * Include/pythread.h: Conform to standard boilerplate.
20992
20993 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
20994 Chris Herborth: the new compiler in R4.1 needs some new options to work...
20995
20996 * Modules/socketmodule.c:
20997 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
20998 data struct before calling gethostby{name,addr}_r(); (2) ignore the
20999 3/5/6 args determinations made by the configure script and switch on
21000 platform identifiers instead:
21001
21002 AIX, OSF have 3 args
21003 Sun, SGI have 5 args
21004 Linux has 6 args
21005
21006 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
21007
21008 * Modules/socketmodule.c:
21009 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
21010
21011 * Lib/mailbox.py:
21012 Add readlines() to _Subfile class. Not clear who would need it, but
21013 Chris Lawrence sent me a broken version; this one is a tad simpler and
21014 more conforming to the standard.
21015
21016Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21017
21018 * Lib/gzip.py: use struct instead of bit-manipulate in Python
21019
21020Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21021
21022 * Modules/Makefile.pre.in:
21023 Add $(EXE) to various occurrences of python so it will work on Cygwin
21024 with egcs (after setting EXE=.exe). Patch by Norman Vine.
21025
21026 * configure, configure.in:
21027 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
21028
21029Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21030
21031 * Include/thread.h:
21032 Adding thread.h -- unused but for b/w compatibility.
21033 As requested by Bill Janssen.
21034
21035 * configure.in, configure:
21036 Add code to test for all sorts of gethostbyname_r variants,
21037 donated by David Arnold.
21038
21039 * config.h.in, acconfig.h:
21040 Add symbols for gethostbyname_r variants (sigh).
21041
21042 * Modules/socketmodule.c: Clean up pass for the previous patches.
21043
21044 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
21045 glibc2.
21046
21047 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
21048 don't know what code should be used.
21049
21050 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
21051
21052 - Modify the gethostbyaddr() code to also hold on to the lock until
21053 after it is safe to release, overlapping with the Python lock.
21054
21055 (Note: I think that it could in theory be possible that Python code
21056 executed while gethostbyname_lock is held could attempt to reacquire
21057 the lock -- e.g. in a signal handler or destructor. I will simply say
21058 "don't do that then.")
21059
21060 * Modules/socketmodule.c: Jonathan Giddy writes:
21061
21062 Here's a patch to fix the race condition, which wasn't fixed by Rob's
21063 patch. It holds the gethostbyname lock until the results are copied out,
21064 which means that this lock and the Python global lock are held at the same
21065 time. This shouldn't be a problem as long as the gethostbyname lock is
21066 always acquired when the global lock is not held.
21067
21068Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
21069
21070 * Modules/zlibmodule.c:
21071 Fixed the flush() method of compression objects; the test for
21072 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
21073 Logic cleaned up and commented.
21074
21075 * Lib/test/test_zlib.py:
21076 Added simple test for the flush() method of compression objects, trying the
21077 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
21078
21079Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21080
21081 * Lib/shlex.py:
21082 Bug reported by Tobias Thelen: missing "self." in assignment target.
21083
21084Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21085
21086 * Modules/arraymodule.c:
21087 Use an unsigned cast to avoid a warning in VC++.
21088
21089 * Lib/dospath.py, Lib/ntpath.py:
21090 New code for split() by Tim Peters, behaves more like posixpath.split().
21091
21092 * Objects/floatobject.c:
21093 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
21094 a block cannot be freed, add its free items back to the free list.
21095 This is necessary to avoid leaking when Python is reinitialized later.
21096
21097 * Objects/intobject.c:
21098 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
21099 a block cannot be freed, add its free items back to the free list, and
21100 add its valid ints back to the small_ints array if they are in range.
21101 This is necessary to avoid leaking when Python is reinitialized later.
21102
21103 * Lib/types.py:
21104 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
21105
21106 * Python/bltinmodule.c:
21107 New builtin buffer() creates a derived read-only buffer from any
21108 object that supports the buffer interface (e.g. strings, arrays).
21109
21110 * Objects/bufferobject.c:
21111 Added check for negative offset for PyBuffer_FromObject and check for
21112 negative size for PyBuffer_FromMemory. Greg Stein.
21113
21114Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21115
21116 * Lib/urlparse.py: Sjoerd Mullender writes:
21117
21118 If a filename on Windows starts with \\, it is converted to a URL
21119 which starts with ////. If this URL is passed to urlparse.urlparse
21120 you get a path that starts with // (and an empty netloc). If you pass
21121 the result back to urlparse.urlunparse, you get a URL that starts with
21122 //, which is parsed differently by urlparse.urlparse. The fix is to
21123 add the (empty) netloc with accompanying slashes if the path in
21124 urlunparse starts with //. Do this for all schemes that use a netloc.
21125
21126 * Lib/nturl2path.py: Sjoerd Mullender writes:
21127
21128 Pathnames of files on other hosts in the same domain
21129 (\\host\path\to\file) are not translated correctly to URLs and back.
21130 The URL should be something like file:////host/path/to/file.
21131 Note that a combination of drive letter and remote host is not
21132 possible.
21133
21134Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21135
21136 * Lib/urlparse.py:
21137 Delete non-standard-conforming code in urljoin() that would use the
21138 netloc from the base url as the default netloc for the resulting url
21139 even if the schemes differ.
21140
21141 Once upon a time, when the web was wild, this was a valuable hack
21142 because some people had a URL referencing an ftp server colocated with
21143 an http server without having the host in the ftp URL (so they could
21144 replicate it or change the hostname easily).
21145
21146 More recently, after the file: scheme got added back to the list of
21147 schemes that accept a netloc, it turns out that this caused weirdness
21148 when joining an http: URL with a file: URL -- the resulting file: URL
21149 would always inherit the host from the http: URL because the file:
21150 scheme supports a netloc but in practice never has one.
21151
21152 There are two reasons to get rid of the old, once-valuable hack,
21153 instead of removing the file: scheme from the uses_netloc list. One,
21154 the RFC says that file: uses the netloc syntax, and does not endorse
21155 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
21156 hack.
21157
21158 * Include/ceval.h, Include/abstract.h:
21159 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
21160
21161Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21162
21163 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
21164
21165 An attempt to execute grid_slaves with arguments (0,0) results in
21166 *all* of the slaves being returned, not just the slave associated with
21167 row 0, column 0. This is because the test for arguments in the method
21168 does not test to see if row (and column) does not equal None, but
21169 rather just whether is evaluates to non-false. A value of 0 fails
21170 this test.
21171
21172Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21173
21174 * Modules/cmathmodule.c:
21175 Docstring fix: acosh() returns the hyperbolic arccosine, not the
21176 hyperbolic cosine. Problem report via David Ascher by one of his
21177 students.
21178
21179Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21180
21181 * configure.in:
21182 Should test for gethost*by*name_r, not for gethostname_r (which
21183 doesn't exist and doesn't make sense).
21184
21185 * Modules/socketmodule.c:
21186 Patch by Rob Riggs for Linux -- glibc2 has a different argument
21187 converntion for gethostbyname_r() etc. than Solaris!
21188
21189 * Python/thread_pthread.h: Rob Riggs wrote:
21190
21191 """
21192 Spec says that on success pthread_create returns 0. It does not say
21193 that an error code will be < 0. Linux glibc2 pthread_create() returns
21194 ENOMEM (12) when one exceed process limits. (It looks like it should
21195 return EAGAIN, but that's another story.)
21196
21197 For reference, see:
21198 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
21199 """
21200
21201 [I have a feeling that similar bugs were fixed before; perhaps someone
21202 could check that all error checks no check for != 0?]
21203
21204 * Tools/bgen/bgen/bgenObjectDefinition.py:
21205 New mixin class that defines cmp and hash that use
21206 the ob_itself pointer. This allows (when using the mixin)
21207 different Python objects pointing to the same C object and
21208 behaving well as dictionary keys.
21209
21210 Or so sez Jack Jansen...
21211
21212 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
21213
21214 Don't convert URLs to URLs using pathname2url.
21215
21216Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21217
21218 * Lib/cmd.py: Patch by Michael Scharf. He writes:
21219
21220 The module cmd requires for each do_xxx command a help_xxx
21221 function. I think this is a little old fashioned.
21222
21223 Here is a patch: use the docstring as help if no help_xxx
21224 function can be found.
21225
21226 [I'm tempted to rip out all the help_* functions from pdb, but I'll
21227 resist it. Any takers? --Guido]
21228
21229 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
21230
21231 Under Windows, python freeze.py -o hello hello.py
21232 creates all the correct files in the hello subdirectory, but the
21233 Makefile has the directory prefix in it for frozen_extensions.c
21234 nmake fails because it tries to locate hello/frozen_extensions.c
21235
21236 (His fix adds a call to os.path.basename() in the appropriate place.)
21237
21238 * Objects/floatobject.c, Objects/intobject.c:
21239 Vladimir has restructured his code somewhat so that the blocks are now
21240 represented by an explicit structure. (There are still too many casts
21241 in the code, but that may be unavoidable.)
21242
21243 Also added code so that with -vv it is very chatty about what it does.
21244
21245 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
21246 Change #! line to modern usage; also chmod +x
21247
21248 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
21249 Change #! line to modern usage
21250
21251 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
21252
21253 The filename to URL conversion didn't properly quote special
21254 characters.
21255 The URL to filename didn't properly unquote special chatacters.
21256
21257 * Objects/floatobject.c:
21258 OK, try again. Vladimir gave me a fix for the alignment bus error,
21259 so here's his patch again. This time it works (at least on Solaris,
21260 Linux and Irix).
21261
21262Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21263
21264 * Tools/idle/PathBrowser.py:
21265 Don't crash when sys.path contains an empty string.
21266
21267 * Tools/idle/PathBrowser.py:
21268 - Don't crash in the case where a superclass is a string instead of a
21269 pyclbr.Class object; this can happen when the superclass is
21270 unrecognizable (to pyclbr), e.g. when module renaming is used.
21271
21272 - Show a watch cursor when calling pyclbr (since it may take a while
21273 recursively parsing imported modules!).
21274
21275Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21276
21277 * Lib/mimetypes.py:
21278 Added .rdf and .xsl as application/xml types. (.rdf is for the
21279 Resource Description Framework, a metadata encoding, and .xsl is for
21280 the Extensible Stylesheet Language.)
21281
21282Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21283
21284 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
21285 Test for popen2 module, by Chris Tismer.
21286
21287 * Objects/floatobject.c:
21288 Alas, Vladimir's patch caused a bus error (probably double
21289 alignment?), and I didn't test it. Withdrawing it for now.
21290
21291Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21292
21293 * Objects/floatobject.c:
21294 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21295 floats on finalization.
21296
21297 * Objects/intobject.c:
21298 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21299 integers on finalization.
21300
21301 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
21302 Add PathBrowser to File module
21303
21304 * Tools/idle/PathBrowser.py:
21305 "Path browser" - 4 scrolled lists displaying:
21306 directories on sys.path
21307 modules in selected directory
21308 classes in selected module
21309 methods of selected class
21310
21311 Sinlge clicking in a directory, module or class item updates the next
21312 column with info about the selected item. Double clicking in a
21313 module, class or method item opens the file (and selects the clicked
21314 item if it is a class or method).
21315
21316 I guess eventually I should be using a tree widget for this, but the
21317 ones I've seen don't work well enough, so for now I use the old
21318 Smalltalk or NeXT style multi-column hierarchical browser.
21319
21320 * Tools/idle/MultiScrolledLists.py:
21321 New utility: multiple scrolled lists in parallel
21322
21323 * Tools/idle/ScrolledList.py: - White background.
21324 - Display "(None)" (or text of your choosing) when empty.
21325 - Don't set the focus.
21326
21327Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21328
21329 * Lib/urllib.py:
21330 open_http also had the 'data is None' test backwards. don't call with the
21331 extra argument if data is None.
21332
21333 * Demo/embed/demo.c:
21334 Call Py_SetProgramName() instead of redefining getprogramname(),
21335 reflecting changes in the runtime around 1.5 or earlier.
21336
21337 * Python/ceval.c:
21338 Always test for an error return (usually NULL or -1) without setting
21339 an exception.
21340
21341 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
21342 He writes:
21343
21344 I had an off-by-1000 error in floatsleep(),
21345 and the problem with time.clock() is that it's not implemented properly
21346 on QNX... ANSI says it's supposed to return _CPU_ time used by the
21347 process, but on QNX it returns the amount of real time used... so I was
21348 confused.
21349
21350 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
21351 Test for self.returntype behaving like OSErr rather than being it.
21352
21353Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21354
21355 * Lib/urllib.py:
21356 http_error had the 'data is None' test backwards. don't call with the
21357 extra argument if data is None.
21358
21359 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
21360
21361 * Lib/urllib.py: pleasing the tabnanny
21362
21363Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21364
21365 * Lib/colorsys.py:
21366 Oops, one more "x, y, z" to convert...
21367
21368 * Lib/colorsys.py:
21369 Adjusted comment at the top to be less confusing, following Fredrik
21370 Lundh's example.
21371
21372 Converted comment to docstring.
21373
21374Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21375
21376 * Lib/toaiff.py:
21377 Use sndhdr instead of the obsolete whatsound module.
21378
21379Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21380
21381 * Lib/urllib.py:
21382 When performing a POST request, i.e. when the second argument to
21383 urlopen is used to specify form data, make sure the second argument is
21384 threaded through all of the http_error_NNN calls. This allows error
21385 handlers like the redirect and authorization handlers to properly
21386 re-start the connection.
21387
21388Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21389
21390 * Lib/mhlib.py: Patch by Lars Wirzenius:
21391
21392 o the initial comment is wrong: creating messages is already
21393 implemented
21394
21395 o Message.getbodytext: if the mail or it's part contains an
21396 empty content-transfer-encoding header, the code used to
21397 break; the change below treats an empty encoding value the same
21398 as the other types that do not need decoding
21399
21400 o SubMessage.getbodytext was missing the decode argument; the
21401 change below adds it; I also made it unconditionally return
21402 the raw text if decoding was not desired, because my own
21403 routines needed that (and it was easier than rewriting my
21404 own routines ;-)
21405
21406Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
21407
21408 * Python/bltinmodule.c (initerrors):
21409 Make sure that the exception tuples ("base-classes" when
21410 string-based exceptions are used) reflect the real class hierarchy,
21411 i.e. that SystemExit derives from Exception not StandardError.
21412
21413 * Lib/exceptions.py:
21414 Document the correct class hierarchy for SystemExit. It is not an
21415 error and so it derives from Exception and not SystemError. The
21416 docstring was incorrect but the implementation was fine.
21417
21418Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21419
21420 * Lib/shutil.py:
21421 Add import sys, needed by reference to sys.exc_info() in rmtree().
21422 Discovered by Mitch Chapman.
21423
21424 * config.h.in:
21425 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
21426 disappears. It wasn't used anywhere anyway...
21427
21428 * Modules/arraymodule.c:
21429 Carefully check for overflow when allocating the memory for fromfile
21430 -- someone tried to pass in sys.maxint and got bitten by the bogus
21431 calculations.
21432
21433 * configure.in:
21434 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
21435 LIBM (from --with-libm=...); this actually broke the customizability
21436 offered by the latter option. Thanks go to Clay Spence for reporting
21437 this.
21438
21439 * Lib/test/test_dl.py:
21440 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
21441 2. When no test case worked, raise ImportError instead of failing.
21442
21443 * Python/bltinmodule.c:
21444 Patch by Tim Peters to improve the range checks for range() and
21445 xrange(), especially for platforms where int and long are different
21446 sizes (so sys.maxint isn't actually the theoretical limit for the
21447 length of a list, but the largest C int is -- sys.maxint is the
21448 largest Python int, which is actually a C long).
21449
21450 * Makefile.in:
21451 1. Augment the DG/UX rule so it doesn't break the BeOS build.
21452 2. Add $(EXE) to various occurrences of python so it will work on
21453 Cygwin with egcs (after setting EXE=.exe). These patches by
21454 Norman Vine.
21455
21456 * Lib/posixfile.py:
21457 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
21458 list (of bsd variants that have a different lock structure).
21459
21460 * Lib/test/test_fcntl.py:
21461 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
21462
21463 * Modules/timemodule.c:
21464 Patch by Tadayoshi Funaba (with some changes) to be smarter about
21465 guessing what happened when strftime() returns 0. Is it buffer
21466 overflow or was the result simply 0 bytes long? (This happens for an
21467 empty format string, or when the format string is a single %Z and the
21468 timezone is unknown.) if the buffer is at least 256 times as long as
21469 the format, assume the latter.
21470
21471Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21472
21473 * Lib/urllib.py:
21474 As Des Barry points out, we need to call pathname2url(file) in two
21475 calls to addinfourl() in open_file().
21476
21477 * Modules/Setup.in: Document *static* -- in two places!
21478
21479 * Modules/timemodule.c:
21480 We don't support leap seconds, so the seconds field of a time 9-tuple
21481 should be in the range [0-59]. Noted by Tadayoshi Funaba.
21482
21483 * Modules/stropmodule.c:
21484 In atoi(), don't use isxdigit() to test whether the last character
21485 converted was a "digit" -- use isalnum(). This test is there only to
21486 guard against "+" or "-" being interpreted as a valid int literal.
21487 Reported by Takahiro Nakayama.
21488
21489 * Lib/os.py:
21490 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
21491 so they don't need to be treated specially here.
21492
21493Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21494
21495 * Misc/NEWS:
21496 Typo: "apparentlt" --> "apparently"
21497
21498Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21499
21500 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
21501
21502 * Modules/posixmodule.c:
21503 The docstring for ttyname(..) claims a second "mode" argument. The
21504 actual code does not allow such an argument. (Finn Bock.)
21505
21506 * Lib/lib-old/poly.py:
21507 Dang. Even though this is obsolete code, somebody found a bug, and I
21508 fix it. Oh well.
21509
21510Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21511
21512 * Lib/pyclbr.py:
21513 Bow to font-lock at the end of the docstring, since it throws stuff
21514 off.
21515
21516 Make sure the path paramter to readmodule() is a list before adding it
21517 with sys.path, or the addition could fail.
21518
21519
21520======================================================================
21521
21522
21523From 1.5.2b1 to 1.5.2b2
21524=======================
21525
21526General
21527-------
21528
21529- Many memory leaks fixed.
21530
21531- Many small bugs fixed.
21532
21533- Command line option -OO (or -O -O) suppresses inclusion of doc
21534strings in resulting bytecode.
21535
21536Windows-specific changes
21537------------------------
21538
21539- New built-in module winsound provides an interface to the Win32
21540PlaySound() call.
21541
21542- Re-enable the audioop module in the config.c file.
21543
21544- On Windows, support spawnv() and associated P_* symbols.
21545
21546- Fixed the conversion of times() return values on Windows.
21547
21548- Removed freeze from the installer -- it doesn't work without the
21549source tree. (See FAQ 8.11.)
21550
21551- On Windows 95/98, the Tkinter module now is smart enough to find
21552Tcl/Tk even when the PATH environment variable hasn't been set -- when
21553the import of _tkinter fails, it searches in a standard locations,
21554patches os.environ["PATH"], and tries again. When it still fails, a
21555clearer error message is produced. This should avoid most
21556installation problems with Tkinter use (e.g. in IDLE).
21557
21558- The -i option doesn't make any calls to set[v]buf() for stdin --
21559this apparently screwed up _kbhit() and the _tkinter main loop.
21560
21561- The ntpath module (and hence, os.path on Windows) now parses out UNC
21562paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
21563splitdrive() will \\host\mountpoint as the drive and \dir\file as the
21564path. ** EXPERIMENTAL **
21565
21566- Added a hack to the exit code so that if (1) the exit status is
21567nonzero and (2) we think we have our own DOS box (i.e. we're not
21568started from a command line shell), we print a message and wait for
21569the user to hit a key before the DOS box is closed.
21570
21571- Updated the installer to WISE 5.0g. Added a dialog warning about
21572the imminent Tcl installation. Added a dialog to specify the program
21573group name in the start menu. Upgraded the Tcl installer to Tcl
215748.0.4.
21575
21576Changes to intrinsics
21577---------------------
21578
21579- The repr() or str() of a module object now shows the __file__
21580attribute (i.e., the file which it was loaded), or the string
21581"(built-in)" if there is no __file__ attribute.
21582
21583- The range() function now avoids overflow during its calculations (if
21584at all possible).
21585
21586- New info string sys.hexversion, which is an integer encoding the
21587version in hexadecimal. In other words, hex(sys.hexversion) ==
215880x010502b2 for Python 1.5.2b2.
21589
21590New or improved ports
21591---------------------
21592
21593- Support for Nextstep descendants (future Mac systems).
21594
21595- Improved BeOS support.
21596
21597- Support dynamic loading of shared libraries on NetBSD platforms that
21598use ELF (i.e., MIPS and Alpha systems).
21599
21600Configuration/build changes
21601---------------------------
21602
21603- The Lib/test directory is no longer included in the default module
21604search path (sys.path) -- "test" has been a package ever since 1.5.
21605
21606- Now using autoconf 2.13.
21607
21608New library modules
21609-------------------
21610
21611- New library modules asyncore and asynchat: these form Sam Rushing's
21612famous asynchronous socket library. Sam has gracefully allowed me to
21613incorporate these in the standard Python library.
21614
21615- New module statvfs contains indexing constants for [f]statvfs()
21616return tuple.
21617
21618Changes to the library
21619----------------------
21620
21621- The wave module (platform-independent support for Windows sound
21622files) has been fixed to actually make it work.
21623
21624- The sunau module (platform-independent support for Sun/NeXT sound
21625files) has been fixed to work across platforms. Also, a weird
21626encoding bug in the header of the audio test data file has been
21627corrected.
21628
21629- Fix a bug in the urllib module that occasionally tripped up
21630webchecker and other ftp retrieves.
21631
21632- ConfigParser's get() method now accepts an optional keyword argument
21633(vars) that is substituted on top of the defaults that were setup in
21634__init__. You can now also have recusive references in your
21635configuration file.
21636
21637- Some improvements to the Queue module, including a put_nowait()
21638module and an optional "block" second argument, to get() and put(),
21639defaulting to 1.
21640
21641- The updated xmllib module is once again compatible with the version
21642present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
21643
21644- The bdb module (base class for the debugger) now supports
21645canonicalizing pathnames used in breakpoints. The derived class must
21646override the new canonical() method for this to work. Also changed
21647clear_break() to the backwards compatible old signature, and added
21648clear_bpbynumber() for the new functionality.
21649
21650- In sgmllib (and hence htmllib), recognize attributes even if they
21651don't have space in front of them. I.e. '<a
21652name="foo"href="bar.html">' will now have two attributes recognized.
21653
21654- In the debugger (pdb), change clear syntax to support three
21655alternatives: clear; clear file:line; clear bpno bpno ...
21656
21657- The os.path module now pretends to be a submodule within the os
21658"package", so you can do things like "from os.path import exists".
21659
21660- The standard exceptions now have doc strings.
21661
21662- In the smtplib module, exceptions are now classes. Also avoid
21663inserting a non-standard space after "TO" in rcpt() command.
21664
21665- The rfc822 module's getaddrlist() method now uses all occurrences of
21666the specified header instead of just the first. Some other bugfixes
21667too (to handle more weird addresses found in a very large test set,
21668and to avoid crashes on certain invalid dates), and a small test
21669module has been added.
21670
21671- Fixed bug in urlparse in the common-case code for HTTP URLs; it
21672would lose the query, fragment, and/or parameter information.
21673
21674- The sndhdr module no longer supports whatraw() -- it depended on a
21675rare extenral program.
21676
21677- The UserList module/class now supports the extend() method, like
21678real list objects.
21679
21680- The uu module now deals better with trailing garbage generated by
21681some broke uuencoders.
21682
21683- The telnet module now has an my_interact() method which uses threads
21684instead of select. The interact() method uses this by default on
21685Windows (where the single-threaded version doesn't work).
21686
21687- Add a class to mailbox.py for dealing with qmail directory
21688mailboxes. The test code was extended to notice these being used as
21689well.
21690
21691Changes to extension modules
21692----------------------------
21693
21694- Support for the [f]statvfs() system call, where it exists.
21695
21696- Fixed some bugs in cPickle where bad input could cause it to dump
21697core.
21698
21699- Fixed cStringIO to make the writelines() function actually work.
21700
21701- Added strop.expandtabs() so string.expandtabs() is now much faster.
21702
21703- Added fsync() and fdatasync(), if they appear to exist.
21704
21705- Support for "long files" (64-bit seek pointers).
21706
21707- Fixed a bug in the zlib module's flush() function.
21708
21709- Added access() system call. It returns 1 if access granted, 0 if
21710not.
21711
21712- The curses module implements an optional nlines argument to
21713w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
21714
21715Changes to tools
21716----------------
21717
21718- Some changes to IDLE; see Tools/idle/NEWS.txt.
21719
21720- Latest version of Misc/python-mode.el included.
21721
21722Changes to Tkinter
21723------------------
21724
21725- Avoid tracebacks when an image is deleted after its root has been
21726destroyed.
21727
21728Changes to the Python/C API
21729---------------------------
21730
21731- When parentheses are used in a PyArg_Parse[Tuple]() call, any
21732sequence is now accepted, instead of requiring a tuple. This is in
21733line with the general trend towards accepting arbitrary sequences.
21734
21735- Added PyModule_GetFilename().
21736
21737- In PyNumber_Power(), remove unneeded and even harmful test for float
21738to the negative power (which is already and better done in
21739floatobject.c).
21740
21741- New version identification symbols; read patchlevel.h for info. The
21742version numbers are now exported by Python.h.
21743
21744- Rolled back the API version change -- it's back to 1007!
21745
21746- The frozenmain.c function calls PyInitFrozenExtensions().
21747
21748- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
21749INCREF.
21750
21751
21752======================================================================
21753
21754
21755From 1.5.2a2 to 1.5.2b1
21756=======================
21757
21758Changes to intrinsics
21759---------------------
21760
21761- New extension NotImplementedError, derived from RuntimeError. Not
21762used, but recommended use is for "abstract" methods to raise this.
21763
21764- The parser will now spit out a warning or error when -t or -tt is
21765used for parser input coming from a string, too.
21766
21767- The code generator now inserts extra SET_LINENO opcodes when
21768compiling multi-line argument lists.
21769
21770- When comparing bound methods, use identity test on the objects, not
21771equality test.
21772
21773New or improved ports
21774---------------------
21775
21776- Chris Herborth has redone his BeOS port; it now works on PowerPC
21777(R3/R4) and x86 (R4 only). Threads work too in this port.
21778
21779Renaming
21780--------
21781
21782- Thanks to Chris Herborth, the thread primitives now have proper Py*
21783names in the source code (they already had those for the linker,
21784through some smart macros; but the source still had the old, un-Py
21785names).
21786
21787Configuration/build changes
21788---------------------------
21789
21790- Improved support for FreeBSD/3.
21791
21792- Check for pthread_detach instead of pthread_create in libc.
21793
21794- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
21795
21796- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
21797Otherwise modules such as thread didn't get incorporated in extensions.
21798
21799New library modules
21800-------------------
21801
21802- shlex.py by Eric Raymond provides a lexical analyzer class for
21803simple shell-like syntaxes.
21804
21805- netrc.py by Eric Raymond provides a parser for .netrc files. (The
21806undocumented Netrc class in ftplib.py is now obsolete.)
21807
21808- codeop.py is a new module that contains the compile_command()
21809function that was previously in code.py. This is so that JPython can
21810provide its own version of this function, while still sharing the
21811higher-level classes in code.py.
21812
21813- turtle.py is a new module for simple turtle graphics. I'm still
21814working on it; let me know if you use this to teach Python to children
21815or other novices without prior programming experience.
21816
21817Obsoleted library modules
21818-------------------------
21819
21820- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
21821their status of obsoleteness. They don't do a particularly good job
21822and don't seem particularly relevant to the Python core.
21823
21824New tools
21825---------
21826
21827- I've added IDLE: my Integrated DeveLopment Environment for Python.
21828Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
21829work on Macintosh, but I haven't been able to test it there; it does
21830depend on new features in 1.5.2 and perhaps even new features in
218311.5.2b1, especially the new code module). This is very much a work in
21832progress. I'd like to hear how people like it compared to PTUI (or
21833any other IDE they are familiar with).
21834
21835- New tools by Barry Warsaw:
21836
21837 = audiopy: controls the Solaris Audio device
21838 = pynche: The PYthonically Natural Color and Hue Editor
21839 = world: Print mappings between country names and DNS country codes
21840
21841New demos
21842---------
21843
21844- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
21845song.
21846
21847- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
21848Tkinter. (By Fredrik Lundh -- not by me!)
21849
21850Changes to the library
21851----------------------
21852
21853- compileall.py now avoids recompiling .py files that haven't changed;
21854it adds a -f option to force recompilation.
21855
21856- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
21857patches).
21858
21859- nntplib.py: statparse() no longer lowercases the message-id.
21860
21861- types.py: use type(__stdin__) for FileType.
21862
21863- urllib.py: fix translations for filenames with "funny" characters.
21864Patch by Sjoerd Mullender. Note that if you subclass one of the
21865URLopener classes, and you have copied code from the old urllib.py,
21866your subclass may stop working. A long-term solution is to provide
21867more methods so that you don't have to copy code.
21868
21869- cgi.py: In read_multi, allow a subclass to override the class we
21870instantiate when we create a recursive instance, by setting the class
21871variable 'FieldStorageClass' to the desired class. By default, this
21872is set to None, in which case we use self.__class__ (as before).
21873Also, a patch by Jim Fulton to pass additional arguments to recursive
21874calls to the FieldStorage constructor from its read_multi method.
21875
21876- UserList.py: In __getslice__, use self.__class__ instead of
21877UserList.
21878
21879- In SimpleHTTPServer.py, the server specified in test() should be
21880BaseHTTPServer.HTTPServer, in case the request handler should want to
21881reference the two attributes added by BaseHTTPServer.server_bind. (By
21882Jeff Rush, for Bobo). Also open the file in binary mode, so serving
21883images from a Windows box might actually work.
21884
21885- In CGIHTTPServer.py, the list of acceptable formats is -split-
21886on spaces but -joined- on commas, resulting in double commas
21887in the joined text. (By Jeff Rush.)
21888
21889- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
21890new threaded versions of Unix Server classes, using the ThreadingMixIn
21891class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
21892
21893- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
21894method do_delete(); do_clear() was meant. By Greg Ward.
21895
21896- getopt.py: accept a non-list sequence for the long options (request
21897by Jack Jansen). Because it might be a common mistake to pass a
21898single string, this situation is treated separately. Also added
21899docstrings (copied from the library manual) and removed the (now
21900redundant) module comments.
21901
21902- tempfile.py: improvements to avoid security leaks.
21903
21904- code.py: moved compile_command() to new module codeop.py.
21905
21906- pickle.py: support pickle format 1.3 (binary float added). By Jim
21907Fulton. Also get rid of the undocumented obsolete Pickler dump_special
21908method.
21909
21910- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
21911
21912- imaplib.py: fix problem with some versions of IMAP4 servers that
21913choose to mix the case in their CAPABILITIES response.
21914
21915- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
21916by Fredrik Lundh.
21917
21918Changes to extension modules
21919----------------------------
21920
21921- More doc strings for several modules were contributed by Chris
21922Petrilli: math, cmath, fcntl.
21923
21924- Fixed a bug in zlibmodule.c that could cause core dumps on
21925decompression of rarely occurring input.
21926
21927- cPickle.c: new version from Jim Fulton, with Open Source copyright
21928notice. Also, initialize self->safe_constructors early on to prevent
21929crash in early dealloc.
21930
21931- cStringIO.c: new version from Jim Fulton, with Open Source copyright
21932notice. Also fixed a core dump in cStringIO.c when doing seeks.
21933
21934- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
21935
21936- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
21937modifies its argument string (bad function!), so we make a temporary
21938copy.
21939
21940- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
21941control pseudo-device, per audio(7I).
21942
21943Changes to tools
21944----------------
21945
21946- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
21947support for Emacs).
21948
21949- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
21950only the names of offending files to be printed.
21951
21952- freeze: when printing missing modules, also print the module they
21953were imported from.
21954
21955- untabify.py: patch by Detlef Lannert to implement -t option
21956(set tab size).
21957
21958Changes to Tkinter
21959------------------
21960
21961- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
21962row2?
21963
21964- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
21965doesn't work when running in a non-threaded environment. He added
21966some #ifdefs that fix this.
21967
21968Changes to the Python/C API
21969---------------------------
21970
21971- Bumped API version number to 1008 -- enough things have changed!
21972
21973- There's a new macro, PyThreadState_GET(), which does the same work
21974as PyThreadState_Get() without the overhead of a function call (it
21975also avoids the error check). The two top calling locations of
21976PyThreadState_Get() have been changed to use this macro.
21977
21978- All symbols intended for export from a DLL or shared library are now
21979marked as such (with the DL_IMPORT() macro) in the header file that
21980declares them. This was needed for the BeOS port, and should also
21981make some other ports easier. The PC port no longer needs the file
21982with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
21983macro which is only used for init methods in extension modules, and
21984for Py_Main().
21985
21986Invisible changes to internals
21987------------------------------
21988
21989- Fixed a bug in new_buffersize() in fileobject.c which could
21990return a buffer size that was way too large.
21991
21992- Use PySys_WriteStderr instead of fprintf in most places.
21993
21994- dictobject.c: remove dead code discovered by Vladimir Marangozov.
21995
21996- tupleobject.c: make tuples less hungry -- an extra item was
21997allocated but never used. Tip by Vladimir Marangozov.
21998
21999- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
22000Jansen)
22001
22002- import.c: Jim Fulton fixes a reference count bug in
22003PyEval_GetGlobals.
22004
22005- glmodule.c: check in the changed version after running the stubber
22006again -- this solves the conflict with curses over the 'clear' entry
22007point much nicer. (Jack Jansen had checked in the changes to cstubs
22008eons ago, but I never regenrated glmodule.c :-( )
22009
22010- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
22011Marangozov.
22012
22013- stropmodule.c: add a missing DECREF in an error exit. Submitted by
22014Jonathan Giddy.
22015
22016
22017======================================================================
22018
22019
22020From 1.5.2a1 to 1.5.2a2
22021=======================
22022
22023General
22024-------
22025
22026- It is now a syntax error to have a function argument without a
22027default following one with a default.
22028
22029- __file__ is now set to the .py file if it was parsed (it used to
22030always be the .pyc/.pyo file).
22031
22032- Don't exit with a fatal error during initialization when there's a
22033problem with the exceptions.py module.
22034
22035- New environment variable PYTHONOPTIMIZE can be used to set -O.
22036
22037- New version of python-mode.el for Emacs.
22038
22039Miscellaneous fixed bugs
22040------------------------
22041
22042- No longer print the (confusing) error message about stack underflow
22043while compiling.
22044
22045- Some threading and locking bugs fixed.
22046
22047- When errno is zero, report "Error", not "Success".
22048
22049Documentation
22050-------------
22051
22052- Documentation will be released separately.
22053
22054- Doc strings added to array and md5 modules by Chris Petrilli.
22055
22056Ports and build procedure
22057-------------------------
22058
22059- Stop installing when a move or copy fails.
22060
22061- New version of the OS/2 port code by Jeff Rush.
22062
22063- The makesetup script handles absolute filenames better.
22064
22065- The 'new' module is now enabled by default in the Setup file.
22066
22067- I *think* I've solved the problem with the Linux build blowing up
22068sometimes due to a conflict between sigcheck/intrcheck and
22069signalmodule.
22070
22071Built-in functions
22072------------------
22073
22074- The second argument to apply() can now be any sequence, not just a
22075tuple.
22076
22077Built-in types
22078--------------
22079
22080- Lists have a new method: L1.extend(L2) is equivalent to the common
22081idiom L1[len(L1):] = L2.
22082
22083- Better error messages when a sequence is indexed with a non-integer.
22084
22085- Bettter error message when calling a non-callable object (include
22086the type in the message).
22087
22088Python services
22089---------------
22090
22091- New version of cPickle.c fixes some bugs.
22092
22093- pickle.py: improved instantiation error handling.
22094
22095- code.py: reworked quite a bit. New base class
22096InteractiveInterpreter and derived class InteractiveConsole. Fixed
22097several problems in compile_command().
22098
22099- py_compile.py: print error message and continue on syntax errors.
22100Also fixed an old bug with the fstat code (it was never used).
22101
22102- pyclbr.py: support submodules of packages.
22103
22104String Services
22105---------------
22106
22107- StringIO.py: raise the right exception (ValueError) for attempted
22108I/O on closed StringIO objects.
22109
22110- re.py: fixed a bug in subn(), which caused .groups() to fail inside
22111the replacement function called by sub().
22112
22113- The struct module has a new format 'P': void * in native mode.
22114
22115Generic OS Services
22116-------------------
22117
22118- Module time: Y2K robustness. 2-digit year acceptance depends on
22119value of time.accept2dyear, initialized from env var PYTHONY2K,
22120default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
22121(POSIX or X/Open recommendation).
22122
22123- os.path: normpath(".//x") should return "x", not "/x".
22124
22125- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
22126doesn't work.
22127
22128- tempfile.py: regenerate the template after a fork() call.
22129
22130Optional OS Services
22131--------------------
22132
22133- In the signal module, disable restarting interrupted system calls
22134when we have siginterrupt().
22135
22136Debugger
22137--------
22138
22139- No longer set __args__; this feature is no longer supported and can
22140affect the debugged code.
22141
22142- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
22143added aliases and some other useful new features, e.g. much better
22144breakpoint support: temporary breakpoint, disabled breakpoints,
22145breakpoints with ignore counts, and conditions; breakpoints can be set
22146on a file before it is loaded.
22147
22148Profiler
22149--------
22150
22151- Changes so that JPython can use it. Also fix the calibration code
22152so it actually works again
22153.
22154Internet Protocols and Support
22155------------------------------
22156
22157- imaplib.py: new version from Piers Lauder.
22158
22159- smtplib.py: change sendmail() method to accept a single string or a
22160list or strings as the destination (commom newbie mistake).
22161
22162- poplib.py: LIST with a msg argument fixed.
22163
22164- urlparse.py: some optimizations for common case (http).
22165
22166- urllib.py: support content-length in info() for ftp protocol;
22167support for a progress meter through a third argument to
22168urlretrieve(); commented out gopher test (the test site is dead).
22169
22170Internet Data handling
22171----------------------
22172
22173- sgmllib.py: support tags with - or . in their name.
22174
22175- mimetypes.py: guess_type() understands 'data' URLs.
22176
22177Restricted Execution
22178--------------------
22179
22180- The classes rexec.RModuleLoader and rexec.RModuleImporter no
22181longer exist.
22182
22183Tkinter
22184-------
22185
22186- When reporting an exception, store its info in sys.last_*. Also,
22187write all of it to stderr.
22188
22189- Added NS, EW, and NSEW constants, for grid's sticky option.
22190
22191- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
22192
22193- Make bind variants without a sequence return a tuple of sequences
22194(formerly it returned a string, which wasn't very convenient).
22195
22196- Add image commands to the Text widget (these are new in Tk 8.0).
22197
22198- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
22199
22200- Improved the thread code (but you still can't call update() from
22201another thread on Windows).
22202
22203- Fixed unnecessary references to _default_root in the new dialog
22204modules.
22205
22206- Miscellaneous problems fixed.
22207
22208
22209Windows General
22210---------------
22211
22212- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
22213search for dependent dlls in the directory containing the .pyd.
22214
22215- In debugging mode, call DebugBreak() in Py_FatalError().
22216
22217Windows Installer
22218-----------------
22219
22220- Install zlib.dll in the DLLs directory instead of in the win32
22221system directory, to avoid conflicts with other applications that have
22222their own zlib.dll.
22223
22224Test Suite
22225----------
22226
22227- test_long.py: new test for long integers, by Tim Peters.
22228
22229- regrtest.py: improved so it can be used for other test suites as
22230well.
22231
22232- test_strftime.py: use re to compare test results, to support legal
22233variants (e.g. on Linux).
22234
22235Tools and Demos
22236---------------
22237
22238- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
22239remove/add Windows style '\r\n' line endings), untabify.py (to remove
22240tabs), and rgrep.yp (reverse grep).
22241
22242- Improvements to Tools/freeze/. Each Python module is now written to
22243its own C file. This prevents some compilers or assemblers from
22244blowing up on large frozen programs, and saves recompilation time if
22245only a few modules are changed. Other changes too, e.g. new command
22246line options -x and -i.
22247
22248- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
22249
22250Python/C API
22251------------
22252
22253- New mechanism to support extensions of the type object while
22254remaining backward compatible with extensions compiled for previous
22255versions of Python 1.5. A flags field indicates presence of certain
22256fields.
22257
22258- Addition to the buffer API to differentiate access to bytes and
222598-bit characters (in anticipation of Unicode characters).
22260
22261- New argument parsing format t# ("text") to indicate 8-bit
22262characters; s# simply means 8-bit bytes, for backwards compatibility.
22263
22264- New object type, bufferobject.c is an example and can be used to
22265create buffers from memory.
22266
22267- Some support for 64-bit longs, including some MS platforms.
22268
22269- Many calls to fprintf(stderr, ...) have been replaced with calls to
22270PySys_WriteStderr(...).
22271
22272- The calling context for PyOS_Readline() has changed: it must now be
22273called with the interpreter lock held! It releases the lock around
22274the call to the function pointed to by PyOS_ReadlineFunctionPointer
22275(default PyOS_StdioReadline()).
22276
22277- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
22278
22279- Renamed header file "thread.h" to "pythread.h".
22280
22281- The code string of code objects may now be anything that supports the
22282buffer API.
22283
22284
22285======================================================================
22286
22287
22288From 1.5.1 to 1.5.2a1
22289=====================
22290
22291General
22292-------
22293
22294- When searching for the library, a landmark that is a compiled module
22295(string.pyc or string.pyo) is also accepted.
22296
22297- When following symbolic links to the python executable, use a loop
22298so that a symlink to a symlink can work.
22299
22300- Added a hack so that when you type 'quit' or 'exit' at the
22301interpreter, you get a friendly explanation of how to press Ctrl-D (or
22302Ctrl-Z) to exit.
22303
22304- New and improved Misc/python-mode.el (Python mode for Emacs).
22305
22306- Revert a new feature in Unix dynamic loading: for one or two
22307revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
22308out to be a bad idea.
22309
22310Miscellaneous fixed bugs
22311------------------------
22312
22313- All patches on the patch page have been integrated. (But much more
22314has been done!)
22315
22316- Several memory leaks plugged (e.g. the one for classes with a
22317__getattr__ method).
22318
22319- Removed the only use of calloc(). This triggered an obscure bug on
22320multiprocessor Sparc Solaris 2.6.
22321
22322- Fix a peculiar bug that would allow "import sys.time" to succeed
22323(believing the built-in time module to be a part of the sys package).
22324
22325- Fix a bug in the overflow checking when converting a Python long to
22326a C long (failed to convert -2147483648L, and some other cases).
22327
22328Documentation
22329-------------
22330
22331- Doc strings have been added to many extension modules: __builtin__,
22332errno, select, signal, socket, sys, thread, time. Also to methods of
22333list objects (try [].append.__doc__). A doc string on a type will now
22334automatically be propagated to an instance if the instance has methods
22335that are accessed in the usual way.
22336
22337- The documentation has been expanded and the formatting improved.
22338(Remember that the documentation is now unbundled and has its own
22339release cycle though; see http://www.python.org/doc/.)
22340
22341- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
22342
22343Ports and build procedure
22344-------------------------
22345
22346- The BeOS port is now integrated. Courtesy Chris Herborth.
22347
22348- Symbol files for FreeBSD 2.x and 3.x have been contributed
22349(Lib/plat-freebsd[23]/*).
22350
22351- Support HPUX 10.20 DCE threads.
22352
22353- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
22354works, it won't also use -Olimit 1500 (which gives a warning for every
22355file). Also support the SGI_ABI environment variable better.
22356
22357- The makesetup script now understands absolute pathnames ending in .o
22358in the module -- it assumes it's a file for which we have no source.
22359
22360- Other miscellaneous improvements to the configure script and
22361Makefiles.
22362
22363- The test suite now uses a different sound sample.
22364
22365Built-in functions
22366------------------
22367
22368- Better checks for invalid input to int(), long(), string.atoi(),
22369string.atol(). (Formerly, a sign without digits would be accepted as
22370a legal ways to spell zero.)
22371
22372- Changes to map() and filter() to use the length of a sequence only
22373as a hint -- if an IndexError happens earlier, take that. (Formerly,
22374this was considered an error.)
22375
22376- Experimental feature in getattr(): a third argument can specify a
22377default (instead of raising AttributeError).
22378
22379- Implement round() slightly different, so that for negative ndigits
22380no additional errors happen in the last step.
22381
22382- The open() function now adds the filename to the exception when it
22383fails.
22384
22385Built-in exceptions
22386-------------------
22387
22388- New standard exceptions EnvironmentError and PosixError.
22389EnvironmentError is the base class for IOError and PosixError;
22390PosixError is the same as os.error. All this so that either exception
22391class can be instantiated with a third argument indicating a filename.
22392The built-in function open() and most os/posix functions that take a
22393filename argument now use this.
22394
22395Built-in types
22396--------------
22397
22398- List objects now have an experimental pop() method; l.pop() returns
22399and removes the last item; l.pop(i) returns and removes the item at
22400i. Also, the sort() method is faster again. Sorting is now also
22401safer: it is impossible for the sorting function to modify the list
22402while the sort is going on (which could cause core dumps).
22403
22404- Changes to comparisons: numbers are now smaller than any other type.
22405This is done to prevent the circularity where [] < 0L < 1 < [] is
22406true. As a side effect, cmp(None, 0) is now positive instead of
22407negative. This *shouldn't* affect any working code, but I've found
22408that the change caused several "sleeping" bugs to become active, so
22409beware!
22410
22411- Instance methods may now have other callable objects than just
22412Python functions as their im_func. Use new.instancemethod() or write
22413your own C code to create them; new.instancemethod() may be called
22414with None for the instance to create an unbound method.
22415
22416- Assignment to __name__, __dict__ or __bases__ of a class object is
22417now allowed (with stringent type checks); also allow assignment to
22418__getattr__ etc. The cached values for __getattr__ etc. are
22419recomputed after such assignments (but not for derived classes :-( ).
22420
22421- Allow assignment to some attributes of function objects: func_code,
22422func_defaults and func_doc / __doc__. (With type checks except for
22423__doc__ / func_doc .)
22424
22425Python services
22426---------------
22427
22428- New tests (in Lib/test): reperf.py (regular expression benchmark),
22429sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
22430for the MimeWriter module).
22431
22432- Generalized test/regrtest.py so that it is useful for testing other
22433packages.
22434
22435- The ihooks.py module now understands package imports.
22436
22437- In code.py, add a class that subsumes Fredrik Lundh's
22438PythonInterpreter class. The interact() function now uses this.
22439
22440- In rlcompleter.py, in completer(), return None instead of raising an
22441IndexError when there are no more completions left.
22442
22443- Fixed the marshal module to test for certain common kinds of invalid
22444input. (It's still not foolproof!)
22445
22446- In the operator module, add an alias (now the preferred name)
22447"contains" for "sequenceincludes".
22448
22449String Services
22450---------------
22451
22452- In the string and strop modules, in the replace() function, treat an
22453empty pattern as an error (since it's not clear what was meant!).
22454
22455- Some speedups to re.py, especially the string substitution and split
22456functions. Also added new function/method findall(), to find all
22457occurrences of a given substring.
22458
22459- In cStringIO, add better argument type checking and support the
22460readonly 'closed' attribute (like regular files).
22461
22462- In the struct module, unsigned 1-2 byte sized formats no longer
22463result in long integer values.
22464
22465Miscellaneous services
22466----------------------
22467
22468- In whrandom.py, added new method and function randrange(), same as
22469choice(range(start, stop, step)) but faster. This addresses the
22470problem that randint() was accidentally defined as taking an inclusive
22471range. Also, randint(a, b) is now redefined as randrange(a, b+1),
22472adding extra range and type checking to its arguments!
22473
22474- Add some semi-thread-safety to random.gauss() (it used to be able to
22475crash when invoked from separate threads; now the worst it can do is
22476give a duplicate result occasionally).
22477
22478- Some restructuring and generalization done to cmd.py.
22479
22480- Major upgrade to ConfigParser.py; converted to using 're', added new
22481exceptions, support underscore in section header and option name. No
22482longer add 'name' option to every section; instead, add '__name__'.
22483
22484- In getpass.py, don't use raw_input() to ask for the password -- we
22485don't want it to show up in the readline history! Also don't catch
22486interrupts (the try-finally already does all necessary cleanup).
22487
22488Generic OS Services
22489-------------------
22490
22491- New functions in os.py: makedirs(), removedirs(), renames(). New
22492variable: linesep (the line separator as found in binary files,
22493i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
22494this with files opened in (default) text mode; the line separator used
22495will always be '\n'!
22496
22497- Changes to the 'os.path' submodule of os.py: added getsize(),
22498getmtime(), getatime() -- these fetch the most popular items from the
22499stat return tuple.
22500
22501- In the time module, add strptime(), if it exists. (This parses a
22502time according to a format -- the inverse of strftime().) Also,
22503remove the call to mktime() from strftime() -- it messed up the
22504formatting of some non-local times.
22505
22506- In the socket module, added a new function gethostbyname_ex().
22507Also, don't use #ifdef to test for some symbols that are enums on some
22508platforms (and should exist everywhere).
22509
22510Optional OS Services
22511--------------------
22512
22513- Some fixes to gzip.py. In particular, the readlines() method now
22514returns the lines *with* trailing newline characters, like readlines()
22515of regular file objects. Also, it didn't work together with cPickle;
22516fixed that.
22517
22518- In whichdb.py, support byte-swapped dbhash (bsddb) files.
22519
22520- In anydbm.py, look at the type of an existing database to determine
22521which module to use to open it. (The anydbm.error exception is now a
22522tuple.)
22523
22524Unix Services
22525-------------
22526
22527- In the termios module, in tcsetattr(), initialize the structure vy
22528calling tcgetattr().
22529
22530- Added some of the "wait status inspection" macros as functions to
22531the posix module (and thus to the os module): WEXITSTATUS(),
22532WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
22533
22534- In the syslog module, make the default facility more intuitive
22535(matching the docs).
22536
22537Debugger
22538--------
22539
22540- In pdb.py, support for setting breaks on files/modules that haven't
22541been loaded yet.
22542
22543Internet Protocols and Support
22544------------------------------
22545
22546- Changes in urllib.py; sped up unquote() and quote(). Fixed an
22547obscure bug in quote_plus(). Added urlencode(dict) -- convenience
22548function for sending a POST request with urlopen(). Use the getpass
22549module to ask for a password. Rewrote the (test) main program so that
22550when used as a script, it can retrieve one or more URLs to stdout.
22551Use -t to run the self-test. Made the proxy code work again.
22552
22553- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
22554fail when someone asks for their HEAD. Also, for POST, set the
22555default content-type to application/x-www-form-urlencoded. Also, in
22556FieldStorage.__init__(), when method='GET', always get the query
22557string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
22558explicitly passed in fp.
22559
22560- The smtplib.py module now supports ESMTP and has improved standard
22561compliance, for picky servers.
22562
22563- Improved imaplib.py.
22564
22565- Fixed UDP support in SocketServer.py (it never worked).
22566
22567- Fixed a small bug in CGIHTTPServer.py.
22568
22569Internet Data handling
22570----------------------
22571
22572- In rfc822.py, add a new class AddressList. Also support a new
22573overridable method, isheader(). Also add a get() method similar to
22574dictionaries (and make getheader() an alias for it). Also, be smarter
22575about seekable (test whether fp.tell() works) and test for presence of
22576unread() method before trying seeks.
22577
22578- In sgmllib.py, restore the call to report_unbalanced() that was lost
22579long ago. Also some other improvements: handle <? processing
22580instructions >, allow . and - in entity names, and allow \r\n as line
22581separator.
22582
22583- Some restructuring and generalization done to multifile.py; support
22584a 'seekable' flag.
22585
22586Restricted Execution
22587--------------------
22588
22589- Improvements to rexec.py: package support; support a (minimal)
22590sys.exc_info(). Also made the (test) main program a bit fancier (you
22591can now use it to run arbitrary Python scripts in restricted mode).
22592
22593Tkinter
22594-------
22595
22596- On Unix, Tkinter can now safely be used from a multi-threaded
22597application. (Formerly, no threads would make progress while
22598Tkinter's mainloop() was active, because it didn't release the Python
22599interpreter lock.) Unfortunately, on Windows, threads other than the
22600main thread should not call update() or update_idletasks() because
22601this will deadlock the application.
22602
22603- An interactive interpreter that uses readline and Tkinter no longer
22604uses up all available CPU time.
22605
22606- Even if readline is not used, Tk windows created in an interactive
22607interpreter now get continuously updated. (This even works in Windows
22608as long as you don't hit a key.)
22609
22610- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
22611
22612- No longer register Tcl_finalize() as a low-level exit handler. It
22613may call back into Python, and that's a bad idea.
22614
22615- Allow binding of Tcl commands (given as a string).
22616
22617- Some minor speedups; replace explicitly coded getint() with int() in
22618most places.
22619
22620- In FileDialog.py, remember the directory of the selected file, if
22621given.
22622
22623- Change the names of all methods in the Wm class: they are now
22624wm_title(), etc. The old names (title() etc.) are still defined as
22625aliases.
22626
22627- Add a new method of interpreter objects, interpaddr(). This returns
22628the address of the Tcl interpreter object, as an integer. Not very
22629useful for the Python programmer, but this can be called by another C
22630extension that needs to make calls into the Tcl/Tk C API and needs to
22631get the address of the Tcl interpreter object. A simple cast of the
22632return value to (Tcl_Interp *) will do the trick.
22633
22634Windows General
22635---------------
22636
22637- Don't insist on proper case for module source files if the filename
22638is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
22639doesn't). This should address problems with this feature on
22640oldfashioned filesystems (Novell servers?).
22641
22642Windows Library
22643---------------
22644
22645- os.environ is now all uppercase, but accesses are case insensitive,
22646and the putenv() calls made as a side effect of changing os.environ
22647are case preserving.
22648
22649- Removed samefile(), sameopenfile(), samestat() from os.path (aka
22650ntpath.py) -- these cannot be made to work reliably (at least I
22651wouldn't know how).
22652
22653- Fixed os.pipe() so that it returns file descriptors acceptable to
22654os.read() and os.write() (like it does on Unix), rather than Windows
22655file handles.
22656
22657- Added a table of WSA error codes to socket.py.
22658
22659- In the select module, put the (huge) file descriptor arrays on the
22660heap.
22661
22662- The getpass module now raises KeyboardInterrupt when it sees ^C.
22663
22664- In mailbox.py, fix tell/seek when using files opened in text mode.
22665
22666- In rfc822.py, fix tell/seek when using files opened in text mode.
22667
22668- In the msvcrt extension module, release the interpreter lock for
22669calls that may block: _locking(), _getch(), _getche(). Also fix a
22670bogus error return when open_osfhandle() doesn't have the right
22671argument list.
22672
22673Windows Installer
22674-----------------
22675
22676- The registry key used is now "1.5" instead of "1.5.x" -- so future
22677versions of 1.5 and Mark Hammond's win32all installer don't need to be
22678resynchronized.
22679
22680Windows Tools
22681-------------
22682
22683- Several improvements to freeze specifically for Windows.
22684
22685Windows Build Procedure
22686-----------------------
22687
22688- The VC++ project files and the WISE installer have been moved to the
22689PCbuild subdirectory, so they are distributed in the same subdirectory
22690where they must be used. This avoids confusion.
22691
22692- New project files for Windows 3.1 port by Jim Ahlstrom.
22693
22694- Got rid of the obsolete subdirectory PC/setup_nt/.
22695
22696- The projects now use distinct filenames for the .exe, .dll, .lib and
22697.pyd files built in debug mode (by appending "_d" to the base name,
22698before the extension). This makes it easier to switch between the two
22699and get the right versions. There's a pragma in config.h that directs
22700the linker to include the appropriate .lib file (so python15.lib no
22701longer needs to be explicit in your project).
22702
22703- The installer now installs more files (e.g. config.h). The idea is
22704that you shouldn't need the source distribution if you want build your
22705own extensions in C or C++.
22706
22707Tools and Demos
22708---------------
22709
22710- New script nm2def.py by Marc-Andre Lemburg, to construct
22711PC/python_nt.def automatically (some hand editing still required).
22712
22713- New tool ndiff.py: Tim Peters' text diffing tool.
22714
22715- Various and sundry improvements to the freeze script.
22716
22717- The script texi2html.py (which was part of the Doc tree but is no
22718longer used there) has been moved to the Tools/scripts subdirectory.
22719
22720- Some generalizations in the webchecker code. There's now a
22721primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
22722
22723- The ftpmirror.py script now handles symbolic links properly, and
22724also files with multiple spaces in their names.
22725
22726- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
22727last line is both indented and lacks a newline. This is now fixed.
22728
22729Python/C API
22730------------
22731
22732- Added missing prototypes for PyEval_CallFunction() and
22733PyEval_CallMethod().
22734
22735- New macro PyList_SET_ITEM().
22736
22737- New macros to access object members for PyFunction, PyCFunction
22738objects.
22739
22740- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
22741dynamically add one or many entries to the table of built-in modules.
22742
22743- New macro Py_InitModule3(name, methods, doc) which calls
22744Py_InitModule4() with appropriate arguments. (The -4 variant requires
22745you to pass an obscure version number constant which is always the same.)
22746
22747- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
22748sys.stdout or sys.stderr using a printf-like interface. (Used in
22749_tkinter.c, for example.)
22750
22751- New APIs for conversion between Python longs and C 'long long' if
22752your compiler supports it.
22753
22754- PySequence_In() is now called PySequence_Contains().
22755(PySequence_In() is still supported for b/w compatibility; it is
22756declared obsolete because its argument order is confusing.)
22757
22758- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
22759*never* raise an exception -- (even if the hash() fails, simply clear
22760the error). This was necessary because there is lots of code out
22761there that already assumes this.
22762
22763- Changes to PySequence_Tuple() and PySequence_List() to use the
22764length of a sequence only as a hint -- if an IndexError happens
22765earlier, take that. (Formerly, this was considered an error.)
22766
22767- Reformatted abstract.c to give it a more familiar "look" and fixed
22768many error checking bugs.
22769
22770- Add NULL pointer checks to all calls of a C function through a type
22771object and extensions (e.g. nb_add).
22772
22773- The code that initializes sys.path now calls Py_GetPythonHome()
22774instead of getenv("PYTHONHOME"). This, together with the new API
22775Py_SetPythonHome(), makes it easier for embedding applications to
22776change the notion of Python's "home" directory (where the libraries
22777etc. are sought).
22778
22779- Fixed a very old bug in the parsing of "O?" format specifiers.
22780
22781
22782======================================================================
22783
22784
Guido van Rossumf2eac992000-09-04 17:24:24 +000022785========================================
22786==> Release 1.5.1 (October 31, 1998) <==
22787========================================
22788
Guido van Rossum439d1fa1998-12-21 21:41:14 +000022789From 1.5 to 1.5.1
22790=================
22791
22792General
22793-------
22794
22795- The documentation is now unbundled. It has also been extensively
22796modified (mostly to implement a new and more uniform formatting
22797style). We figure that most people will prefer to download one of the
22798preformatted documentation sets (HTML, PostScript or PDF) and that
22799only a minority have a need for the LaTeX or FrameMaker sources. Of
22800course, the unbundled documentation sources still released -- just not
22801in the same archive file, and perhaps not on the same date.
22802
22803- All bugs noted on the errors page (and many unnoted) are fixed. All
22804new bugs take their places.
22805
22806- No longer a core dump when attempting to print (or repr(), or str())
22807a list or dictionary that contains an instance of itself; instead, the
22808recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
22809Py_ReprLeave() below. Comparisons of such objects still go beserk,
22810since this requires a different kind of fix; fortunately, this is a
22811less common scenario in practice.
22812
22813Syntax change
22814-------------
22815
22816- The raise statement can now be used without arguments, to re-raise
22817a previously set exception. This should be used after catching an
22818exception with an except clause only, either in the except clause or
22819later in the same function.
22820
22821Import and module handling
22822--------------------------
22823
22824- The implementation of import has changed to use a mutex (when
22825threading is supported). This means that when two threads
22826simultaneously import the same module, the import statements are
22827serialized. Recursive imports are not affected.
22828
22829- Rewrote the finalization code almost completely, to be much more
22830careful with the order in which modules are destroyed. Destructors
22831will now generally be able to reference built-in names such as None
22832without trouble.
22833
22834- Case-insensitive platforms such as Mac and Windows require the case
22835of a module's filename to match the case of the module name as
22836specified in the import statement (see below).
22837
22838- The code for figuring out the default path now distinguishes between
22839files, modules, executable files, and directories. When expecting a
22840module, we also look for the .pyc or .pyo file.
22841
22842Parser/tokenizer changes
22843------------------------
22844
22845- The tokenizer can now warn you when your source code mixes tabs and
22846spaces for indentation in a manner that depends on how much a tab is
22847worth in spaces. Use "python -t" or "python -v" to enable this
22848option. Use "python -tt" to turn the warnings into errors. (See also
22849tabnanny.py and tabpolice.py below.)
22850
22851- Return unsigned characters from tok_nextc(), so '\377' isn't
22852mistaken for an EOF character.
22853
22854- Fixed two pernicious bugs in the tokenizer that only affected AIX.
22855One was actually a general bug that was triggered by AIX's smaller I/O
22856buffer size. The other was a bug in the AIX optimizer's loop
22857unrolling code; swapping two statements made the problem go away.
22858
22859Tools, demos and miscellaneous files
22860------------------------------------
22861
22862- There's a new version of Misc/python-mode.el (the Emacs mode for
22863Python) which is much smarter about guessing the indentation style
22864used in a particular file. Lots of other cool features too!
22865
22866- There are two new tools in Tools/scripts: tabnanny.py and
22867tabpolice.py, implementing two different ways of checking whether a
22868file uses indentation in a way that is sensitive to the interpretation
22869of a tab. The preferred module is tabnanny.py (by Tim Peters).
22870
22871- Some new demo programs:
22872
22873 Demo/tkinter/guido/paint.py -- Dave Mitchell
22874 Demo/sockets/unixserver.py -- Piet van Oostrum
22875
22876
22877- Much better freeze support. The freeze script can now freeze
22878hierarchical module names (with a corresponding change to import.c),
22879and has a few extra options (e.g. to suppress freezing specific
22880modules). It also does much more on Windows NT.
22881
22882- Version 1.0 of the faq wizard is included (only very small changes
22883since version 0.9.0).
22884
22885- New feature for the ftpmirror script: when removing local files
22886(i.e., only when -r is used), do a recursive delete.
22887
22888Configuring and building Python
22889-------------------------------
22890
22891- Get rid of the check for -linet -- recent Sequent Dynix systems don't
22892need this any more and apparently it screws up their configuration.
22893
22894- Some changes because gcc on SGI doesn't support '-all'.
22895
22896- Changed the build rules to use $(LIBRARY) instead of
22897 -L.. -lpython$(VERSION)
22898since the latter trips up the SunOS 4.1.x linker (sigh).
22899
22900- Fix the bug where the '# dgux is broken' comment in the Makefile
22901tripped over Make on some platforms.
22902
22903- Changes for AIX: install the python.exp file; properly use
22904$(srcdir); the makexp_aix script now removes C++ entries of the form
22905Class::method.
22906
22907- Deleted some Makefile targets only used by the (long obsolete)
22908gMakefile hacks.
22909
22910Extension modules
22911-----------------
22912
22913- Performance and threading improvements to the socket and bsddb
22914modules, by Christopher Lindblad of Infoseek.
22915
22916- Added operator.__not__ and operator.not_.
22917
22918- In the thread module, when a thread exits due to an unhandled
22919exception, don't store the exception information in sys.last_*; it
22920prevents proper calling of destructors of local variables.
22921
22922- Fixed a number of small bugs in the cPickle module.
22923
22924- Changed find() and rfind() in the strop module so that
22925find("x","",2) returns -1, matching the implementation in string.py.
22926
22927- In the time module, be more careful with the result of ctime(), and
22928test for HAVE_MKTIME before usinmg mktime().
22929
22930- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
22931modules.
22932
22933- Added the LOG_SYSLOG constant to the syslog module, if defined.
22934
22935Standard library modules
22936------------------------
22937
22938- All standard library modules have been converted to an indentation
22939style using either only tabs or only spaces -- never a mixture -- if
22940they weren't already consistent according to tabnanny. This means
22941that the new -t option (see above) won't complain about standard
22942library modules.
22943
22944- New standard library modules:
22945
22946 threading -- GvR and the thread-sig
22947 Java style thread objects -- USE THIS!!!
22948
22949 getpass -- Piers Lauder
22950 simple utilities to prompt for a password and to
22951 retrieve the current username
22952
22953 imaplib -- Piers Lauder
22954 interface for the IMAP4 protocol
22955
22956 poplib -- David Ascher, Piers Lauder
22957 interface for the POP3 protocol
22958
22959 smtplib -- Dragon De Monsyne
22960 interface for the SMTP protocol
22961
22962- Some obsolete modules moved to a separate directory (Lib/lib-old)
22963which is *not* in the default module search path:
22964
22965 Para
22966 addpack
22967 codehack
22968 fmt
22969 lockfile
22970 newdir
22971 ni
22972 rand
22973 tb
22974
22975- New version of the PCRE code (Perl Compatible Regular Expressions --
22976the re module and the supporting pcre extension) by Andrew Kuchling.
22977Incompatible new feature in re.sub(): the handling of escapes in the
22978replacement string has changed.
22979
22980- Interface change in the copy module: a __deepcopy__ method is now
22981called with the memo dictionary as an argument.
22982
22983- Feature change in the tokenize module: differentiate between NEWLINE
22984token (an official newline) and NL token (a newline that the grammar
22985ignores).
22986
22987- Several bugfixes to the urllib module. It is now truly thread-safe,
22988and several bugs and a portability problem have been fixed. New
22989features, all due to Sjoerd Mullender: When creating a temporary file,
22990it gives it an appropriate suffix. Support the "data:" URL scheme.
22991The open() method uses the tempcache.
22992
22993- New version of the xmllib module (this time with a test suite!) by
22994Sjoerd Mullender.
22995
22996- Added debugging code to the telnetlib module, to be able to trace
22997the actual traffic.
22998
22999- In the rfc822 module, added support for deleting a header (still no
23000support for adding headers, though). Also fixed a bug where an
23001illegal address would cause a crash in getrouteaddr(), fixed a
23002sign reversal in mktime_tz(), and use the local timezone by default
23003(the latter two due to Bill van Melle).
23004
23005- The normpath() function in the dospath and ntpath modules no longer
23006does case normalization -- for that, use the separate function
23007normcase() (which always existed); normcase() has been sped up and
23008fixed (it was the cause of a crash in Mark Hammond's installer in
23009certain locales).
23010
23011- New command supported by the ftplib module: rmd(); also fixed some
23012minor bugs.
23013
23014- The profile module now uses a different timer function by default --
23015time.clock() is generally better than os.times(). This makes it work
23016better on Windows NT, too.
23017
23018- The tempfile module now recovers when os.getcwd() raises an
23019exception.
23020
23021- Fixed some bugs in the random module; gauss() was subtly wrong, and
23022vonmisesvariate() should return a full circle. Courtesy Mike Miller,
23023Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
23024
23025- Better default seed in the whrandom module, courtesy Andrew Kuchling.
23026
23027- Fix slow close() in shelve module.
23028
23029- The Unix mailbox class in the mailbox module is now more robust when
23030a line begins with the string "From " but is definitely not the start
23031of a new message. The pattern used can be changed by overriding a
23032method or class variable.
23033
23034- Added a rmtree() function to the copy module.
23035
23036- Fixed several typos in the pickle module. Also fixed problems when
23037unpickling in restricted execution environments.
23038
23039- Added docstrings and fixed a typo in the py_compile and compileall
23040modules. At Mark Hammond's repeated request, py_compile now append a
23041newline to the source if it needs one. Both modules support an extra
23042parameter to specify the purported source filename (to be used in
23043error messages).
23044
23045- Some performance tweaks by Jeremy Hylton to the gzip module.
23046
23047- Fixed a bug in the merge order of dictionaries in the ConfigParser
23048module. Courtesy Barry Warsaw.
23049
23050- In the multifile module, support the optional second parameter to
23051seek() when possible.
23052
23053- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
23054urlparse now correctly handles Gopher URLs with query strings.
23055
23056- Fixed a tiny bug in format_exception() in the traceback module.
23057Also rewrite tb_lineno() to be compatible with JPython (and not
23058disturb the current exception!); by Jim Hugunin.
23059
23060- The httplib module is more robust when servers send a short response
23061-- courtesy Tim O'Malley.
23062
23063Tkinter and friends
23064-------------------
23065
23066- Various typos and bugs fixed.
23067
23068- New module Tkdnd implements a drag-and-drop protocol (within one
23069application only).
23070
23071- The event_*() widget methods have been restructured slightly -- they
23072no longer use the default root.
23073
23074- The interfaces for the bind*() and unbind() widget methods have been
23075redesigned; the bind*() methods now return the name of the Tcl command
23076created for the callback, and this can be passed as a optional
23077argument to unbind() in order to delete the command (normally, such
23078commands are automatically unbound when the widget is destroyed, but
23079for some applications this isn't enough).
23080
23081- Variable objects now have trace methods to interface to Tcl's
23082variable tracing facilities.
23083
23084- Image objects now have an optional keyword argument, 'master', to
23085specify a widget (tree) to which they belong. The image_names() and
23086image_types() calls are now also widget methods.
23087
23088- There's a new global call, Tkinter.NoDefaultRoot(), which disables
23089all use of the default root by the Tkinter library. This is useful to
23090debug applications that are in the process of being converted from
23091relying on the default root to explicit specification of the root
23092widget.
23093
23094- The 'exit' command is deleted from the Tcl interpreter, since it
23095provided a loophole by which one could (accidentally) exit the Python
23096interpreter without invoking any cleanup code.
23097
23098- Tcl_Finalize() is now registered as a Python low-level exit handle,
23099so Tcl will be finalized when Python exits.
23100
23101The Python/C API
23102----------------
23103
23104- New function PyThreadState_GetDict() returns a per-thread dictionary
23105intended for storing thread-local global variables.
23106
23107- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
23108dictionary to allow recursive container types to detect recursion in
23109their repr(), str() and print implementations.
23110
23111- New function PyObject_Not(x) calculates (not x) according to Python's
23112standard rules (basically, it negates the outcome PyObject_IsTrue(x).
23113
23114- New function _PyModule_Clear(), which clears a module's dictionary
23115carefully without removing the __builtins__ entry. This is implied
23116when a module object is deallocated (this used to clear the dictionary
23117completely).
23118
23119- New function PyImport_ExecCodeModuleEx(), which extends
23120PyImport_ExecCodeModule() by adding an extra parameter to pass it the
23121true file.
23122
23123- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
23124allow embedded applications to force a different value for PYTHONHOME.
23125
23126- New global flag Py_FrozenFlag is set when this is a "frozen" Python
23127binary; it suppresses warnings about not being able to find the
23128standard library directories.
23129
23130- New global flag Py_TabcheckFlag is incremented by the -t option and
23131causes the tokenizer to issue warnings or errors about inconsistent
23132mixing of tabs and spaces for indentation.
23133
23134Miscellaneous minor changes and bug fixes
23135-----------------------------------------
23136
23137- Improved the error message when an attribute of an attribute-less
23138object is requested -- include the name of the attribute and the type
23139of the object in the message.
23140
23141- Sped up int(), long(), float() a bit.
23142
23143- Fixed a bug in list.sort() that would occasionally dump core.
23144
23145- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
23146when taken tothe real power.
23147
23148- Fixed a number of bugs in the file reading code, at least one of
23149which could cause a core dump on NT, and one of which would
23150occasionally cause file.read() to return less than the full contents
23151of the file.
23152
23153- Performance hack by Vladimir Marangozov for stack frame creation.
23154
23155- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
23156
23157Windows 95/NT
23158-------------
23159
23160- The .lib files are now part of the distribution; they are collected
23161in the subdirectory "libs" of the installation directory.
23162
23163- The extension modules (.pyd files) are now collected in a separate
23164subdirectory of the installation directory named "DLLs".
23165
23166- The case of a module's filename must now match the case of the
23167module name as specified in the import statement. This is an
23168experimental feature -- if it turns out to break in too many
23169situations, it will be removed (or disabled by default) in the future.
23170It can be disabled on a per-case basis by setting the environment
23171variable PYTHONCASEOK (to any value).
23172
23173
23174======================================================================
23175
23176
Guido van Rossumf2eac992000-09-04 17:24:24 +000023177=====================================
23178==> Release 1.5 (January 3, 1998) <==
23179=====================================
23180
23181
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023182From 1.5b2 to 1.5
23183=================
23184
23185- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
23186
23187- Added doc strings to string.py, stropmodule.c, structmodule.c,
23188thanks to Charles Waldman.
23189
23190- Many nits fixed in the manuals, thanks to Fred Drake and many others
23191(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
23192HTML markup instead of inline GIF images for tables; only two images
23193are left (for obsure bits of math). The index of the HTML version has
23194also been much improved. Finally, it is once again possible to
23195generate an Emacs info file from the library manual (but I don't
23196commit to supporting this in future versions).
23197
23198- New module: telnetlib.py (a simple telnet client library).
23199
23200- New tool: Tools/versioncheck/, by Jack Jansen.
23201
23202- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
23203DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
23204extension modules.
23205
23206- Many small changes again to Tkinter.py -- mostly bugfixes and adding
23207missing routines. Thanks to Greg McFarlane for reporting a bunch of
23208problems and proofreading my fixes.
23209
23210- The re module and its documentation are up to date with the latest
23211version released to the string-sig (Dec. 22).
23212
23213- Stop test_grp.py from failing when the /etc/group file is empty
23214(yes, this happens!).
23215
23216- Fix bug in integer conversion (mystrtoul.c) that caused
232174294967296==0 to be true!
23218
23219- The VC++ 4.2 project file should be complete again.
23220
23221- In tempfile.py, use a better template on NT, and add a new optional
23222argument "suffix" with default "" to specify a specific extension for
23223the temporary filename (needed sometimes on NT but perhaps also handy
23224elsewhere).
23225
23226- Fixed some bugs in the FAQ wizard, and converted it to use re
23227instead of regex.
23228
23229- Fixed a mysteriously undetected error in dlmodule.c (it was using a
23230totally bogus routine name to raise an exception).
23231
23232- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
23233
23234- Hopefully harmless changes to the build process to support shared
23235libraries on DG/UX. This adds a target to create
23236libpython$(VERSION).so; however this target is *only* for DG/UX.
23237
23238- Fixed a bug in the new format string error checking in getargs.c.
23239
23240- A simple fix for infinite recursion when printing __builtins__:
23241reset '_' to None before printing and set it to the printed variable
23242*after* printing (and only when printing is successful).
23243
23244- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
23245parent window is not (Skip Montanaro).
23246
23247- Fixed the two most annoying problems with ftp URLs in
23248urllib.urlopen(); an empty file now correctly raises an error, and it
23249is no longer required to explicitly close the returned "file" object
23250before opening another ftp URL to the same host and directory.
23251
23252
23253======================================================================
23254
23255
23256From 1.5b1 to 1.5b2
23257===================
23258
23259- Fixed a bug in cPickle.c that caused it to crash right away because
23260the version string had a different format.
23261
23262- Changes in pickle.py and cPickle.c: when unpickling an instance of a
23263class that doesn't define the __getinitargs__() method, the __init__()
23264constructor is no longer called. This makes a much larger group of
23265classes picklable by default, but may occasionally change semantics.
23266To force calling __init__() on unpickling, define a __getinitargs__()
23267method. Other changes too, in particular cPickle now handles classes
23268defined in packages correctly. The same change applies to copying
23269instances with copy.py. The cPickle.c changes and some pickle.py
23270changes are courtesy Jim Fulton.
23271
23272- Locale support in he "re" (Perl regular expressions) module. Use
23273the flag re.L (or re.LOCALE) to enable locale-specific matching
23274rules for \w and \b. The in-line syntax for this flag is (?L).
23275
23276- The built-in function isinstance(x, y) now also succeeds when y is
23277a type object and type(x) is y.
23278
23279- repr() and str() of class and instance objects now reflect the
23280package/module in which the class is defined.
23281
23282- Module "ni" has been removed. (If you really need it, it's been
23283renamed to "ni1". Let me know if this causes any problems for you.
23284Package authors are encouraged to write __init__.py files that
23285support both ni and 1.5 package support, so the same version can be
23286used with Python 1.4 as well as 1.5.)
23287
23288- The thread module is now automatically included when threads are
23289configured. (You must remove it from your existing Setup file,
23290since it is now in its own Setup.thread file.)
23291
23292- New command line option "-x" to skip the first line of the script;
23293handy to make executable scripts on non-Unix platforms.
23294
23295- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
23296haven't checked how this affects things, but it should make symbols
23297in one shared library available to the next one.
23298
23299- The Windows installer now installs in the "Program Files" folder on
23300the proper volume by default.
23301
23302- The Windows configuration adds a new main program, "pythonw", and
23303registers a new extension, ".pyw" that invokes this. This is a
23304pstandard Python interpreter that does not pop up a console window;
23305handy for pure Tkinter applications. All output to the original
23306stdout and stderr is lost; reading from the original stdin yields
23307EOF. Also, both python.exe and pythonw.exe now have a pretty icon
23308(a green snake in a box, courtesy Mark Hammond).
23309
23310- Lots of improvements to emacs-mode.el again. See Barry's web page:
23311http://www.python.org/ftp/emacs/pmdetails.html.
23312
23313- Lots of improvements and additions to the library reference manual;
23314many by Fred Drake.
23315
23316- Doc strings for the following modules: rfc822.py, posixpath.py,
23317ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
23318
23319- Some more regression testing.
23320
23321- An optional 4th (maxsplit) argument to strop.replace().
23322
23323- Fixed handling of maxsplit in string.splitfields().
23324
23325- Tweaked os.environ so it can be pickled and copied.
23326
23327- The portability problems caused by indented preprocessor commands
23328and C++ style comments should be gone now.
23329
23330- In random.py, added Pareto and Weibull distributions.
23331
23332- The crypt module is now disabled in Modules/Setup.in by default; it
23333is rarely needed and causes errors on some systems where users often
23334don't know how to deal with those.
23335
23336- Some improvements to the _tkinter build line suggested by Case Roole.
23337
23338- A full suite of platform specific files for NetBSD 1.x, submitted by
23339Anders Andersen.
23340
23341- New Solaris specific header STROPTS.py.
23342
23343- Moved a confusing occurrence of *shared* from the comments in
23344Modules/Setup.in (people would enable this one instead of the real
23345one, and get disappointing results).
23346
23347- Changed the default mode for directories to be group-writable when
23348the installation process creates them.
23349
23350- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
23351shared libraries for both.
23352
23353- Support FreeBSD and NetBSD in posixfile.py.
23354
23355- Support for the "event" command, new in Tk 4.2. By Case Roole.
23356
23357- Add Tix_SafeInit() support to tkappinit.c.
23358
23359- Various bugs fixed in "re.py" and "pcre.c".
23360
23361- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
23362
23363- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
23364is set.
23365
23366- Provide default blocksize for retrbinary in ftplib.py (Skip
23367Montanaro).
23368
23369- In NT, pick the username up from different places in user.py (Jeff
23370Bauer).
23371
23372- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
23373
23374- Many small improvements to Jeff Rush' OS/2 support.
23375
23376- ospath.py is gone; it's been obsolete for so many years now...
23377
23378- The reference manual is now set up to prepare better HTML (still
23379using webmaker, alas).
23380
23381- Add special handling to /Tools/freeze for Python modules that are
23382imported implicitly by the Python runtime: 'site' and 'exceptions'.
23383
23384- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
23385inside <PRE>, by "Scott".
23386
23387- Added ConfigParser.py, a generic parser for sectioned configuration
23388files.
23389
23390- In _localemodule.c, LC_MESSAGES is not always defined; put it
23391between #ifdefs.
23392
23393- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
23394
23395- Demo/scripts/newslist.py: Fix the way the version number is gotten
23396out of the RCS revision.
23397
23398- PyArg_Parse[Tuple] now explicitly check for bad characters at the
23399end of the format string.
23400
23401- Revamped PC/example_nt to support VC++ 5.x.
23402
23403- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
23404after studying the GNU libg++ quicksort. This should be much faster
23405if there are lots of duplicates, and otherwise at least as good.
23406
23407- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
23408uudecode bug where it complaints about trailing garbage is still there
23409:-( ).
23410
23411- pickle.py requires integers in text mode to be in decimal notation
23412(it used to accept octal and hex, even though it would only generate
23413decimal numbers).
23414
23415- In string.atof(), don't fail when the "re" module is unavailable.
23416Plug the ensueing security leak by supplying an empty __builtins__
23417directory to eval().
23418
23419- A bunch of small fixes and improvements to Tkinter.py.
23420
23421- Fixed a buffer overrun in PC/getpathp.c.
23422
23423
23424======================================================================
23425
23426
23427From 1.5a4 to 1.5b1
23428===================
23429
23430- The Windows NT/95 installer now includes full HTML of all manuals.
23431It also has a checkbox that lets you decide whether to install the
23432interpreter and library. The WISE installer script for the installer
23433is included in the source tree as PC/python15.wse, and so are the
23434icons used for Python files. The config.c file for the Windows build
23435is now complete with the pcre module.
23436
23437- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
23438evaluated for the prompt.
23439
23440- The reference manual is brought up to date (more or less -- it still
23441needs work, e.g. in the area of package import).
23442
23443- The icons used by latex2html are now included in the Doc
23444subdirectory (mostly so that tarring up the HTML files can be fully
23445automated). A simple index.html is also added to Doc (it only works
23446after you have successfully run latex2html).
23447
23448- For all you would-be proselytizers out there: a new version of
23449Misc/BLURB describes Python more concisely, and Misc/comparisons
23450compares Python to several other languages. Misc/BLURB.WINDOWS
23451contains a blurb specifically aimed at Windows programmers (by Mark
23452Hammond).
23453
23454- A new version of the Python mode for Emacs is included as
23455Misc/python-mode.el. There are too many new features to list here.
23456See http://www.python.org/ftp/emacs/pmdetails.html for more info.
23457
23458- New module fileinput makes iterating over the lines of a list of
23459files easier. (This still needs some more thinking to make it more
23460extensible.)
23461
23462- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
23463version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
23464Age C++ compiler. I expect that Jeff will also provide a binary
23465release for this platform.
23466
23467- On Linux, the configure script now uses '-Xlinker -export-dynamic'
23468instead of '-rdynamic' to link the main program so that it exports its
23469symbols to shared libraries it loads dynamically. I hope this doesn't
23470break on older Linux versions; it is needed for mklinux and appears to
23471work on Linux 2.0.30.
23472
23473- Some Tkinter resstructuring: the geometry methods that apply to a
23474master are now properly usable on toplevel master widgets. There's a
23475new (internal) widget class, BaseWidget. New, longer "official" names
23476for the geometry manager methods have been added,
23477e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
23478shorter names still work, and where there's ambiguity, pack wins over
23479place wins over grid. Also, the bind_class method now returns its
23480value.
23481
23482- New, RFC-822 conformant parsing of email addresses and address lists
23483in the rfc822 module, courtesy Ben Escoto.
23484
23485- New, revamped tkappinit.c with support for popular packages (PIL,
23486TIX, BLT, TOGL). For the last three, you need to execute the Tcl
23487command "load {} Tix" (or Blt, or Togl) to gain access to them.
23488The Modules/Setup line for the _tkinter module has been rewritten
23489using the cool line-breaking feature of most Bourne shells.
23490
23491- New socket method connect_ex() returns the error code from connect()
23492instead of raising an exception on errors; this makes the logic
23493required for asynchronous connects simpler and more efficient.
23494
23495- New "locale" module with (still experimental) interface to the
Antoine Pitroufbd4f802012-08-11 16:51:50 +020023496standard C library locale interface, courtesy Martin von Löwis. This
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023497does not repeat my mistake in 1.5a4 of always calling
23498setlocale(LC_ALL, ""). In fact, we've pretty much decided that
23499Python's standard numerical formatting operations should always use
23500the conventions for the C locale; the locale module contains utility
23501functions to format numbers according to the user specified locale.
23502(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
23503"C") after locale-changing calls.) See the library manual. (Alas, the
23504promised changes to the "re" module for locale support have not been
23505materialized yet. If you care, volunteer!)
23506
23507- Memory leak plugged in Py_BuildValue when building a dictionary.
23508
23509- Shared modules can now live inside packages (hierarchical module
23510namespaces). No changes to the shared module itself are needed.
23511
23512- Improved policy for __builtins__: this is a module in __main__ and a
23513dictionary everywhere else.
23514
23515- Python no longer catches SIGHUP and SIGTERM by default. This was
23516impossible to get right in the light of thread contexts. If you want
23517your program to clean up when a signal happens, use the signal module
23518to set up your own signal handler.
23519
23520- New Python/C API PyNumber_CoerceEx() does not return an exception
23521when no coercion is possible. This is used to fix a problem where
23522comparing incompatible numbers for equality would raise an exception
23523rather than return false as in Python 1.4 -- it once again will return
23524false.
23525
23526- The errno module is changed again -- the table of error messages
23527(errorstr) is removed. Instead, you can use os.strerror(). This
23528removes redundance and a potential locale dependency.
23529
23530- New module xmllib, to parse XML files. By Sjoerd Mullender.
23531
23532- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
23533It resets the signal module's notion of what the current process ID
23534and thread are, so that signal handlers will work after (and across)
23535calls to os.fork().
23536
23537- Fixed most occurrences of fatal errors due to missing thread state.
23538
23539- For vgrind (a flexible source pretty printer) fans, there's a simple
23540Python definition in Misc/vgrindefs, courtesy Neale Pickett.
23541
23542- Fixed memory leak in exec statement.
23543
23544- The test.pystone module has a new function, pystones(loops=LOOPS),
23545which returns a (benchtime, stones) tuple. The main() function now
23546calls this and prints the report.
23547
23548- Package directories now *require* the presence of an __init__.py (or
23549__init__.pyc) file before they are considered as packages. This is
23550done to prevent accidental subdirectories with common names from
23551overriding modules with the same name.
23552
23553- Fixed some strange exceptions in __del__ methods in library modules
Georg Brandl93dc9eb2010-03-14 10:56:14 +000023554(e.g. urllib). This happens because the built-in names are already
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023555deleted by the time __del__ is called. The solution (a hack, but it
23556works) is to set some instance variables to 0 instead of None.
23557
23558- The table of built-in module initializers is replaced by a pointer
23559variable. This makes it possible to switch to a different table at
23560run time, e.g. when a collection of modules is loaded from a shared
23561library. (No example code of how to do this is given, but it is
23562possible.) The table is still there of course, its name prefixed with
23563an underscore and used to initialize the pointer.
23564
23565- The warning about a thread still having a frame now only happens in
23566verbose mode.
23567
23568- Change the signal finialization so that it also resets the signal
23569handlers. After this has been called, our signal handlers are no
23570longer active!
23571
23572- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
23573literals. There's now also a test fort this module.
23574
23575- The copy module now also uses __dict__.update(state) instead of
23576going through individual attribute assignments, for class instances
23577without a __setstate__ method.
23578
23579- New module reconvert translates old-style (regex module) regular
23580expressions to new-style (re module, Perl-style) regular expressions.
23581
23582- Most modules that used to use the regex module now use the re
23583module. The grep module has a new pgrep() function which uses
23584Perl-style regular expressions.
23585
23586- The (very old, backwards compatibility) regexp.py module has been
23587deleted.
23588
23589- Restricted execution (rexec): added the pcre module (support for the
23590re module) to the list of trusted extension modules.
23591
23592- New version of Jim Fulton's CObject object type, adds
23593PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
23594
23595- Some patches to Lee Busby's fpectl mods that accidentally didn't
23596make it into 1.5a4.
23597
23598- In the string module, add an optional 4th argument to count(),
23599matching find() etc.
23600
23601- Patch for the nntplib module by Charles Waldman to add optional user
23602and password arguments to NNTP.__init__(), for nntp servers that need
23603them.
23604
23605- The str() function for class objects now returns
23606"modulename.classname" instead of returning the same as repr().
23607
23608- The parsing of \xXX escapes no longer relies on sscanf().
23609
23610- The "sharedmodules" subdirectory of the installation is renamed to
23611"lib-dynload". (You may have to edit your Modules/Setup file to fix
23612this in an existing installation!)
23613
23614- Fixed Don Beaudry's mess-up with the OPT test in the configure
23615script. Certain SGI platforms will still issue a warning for each
23616compile; there's not much I can do about this since the compiler's
23617exit status doesn't indicate that I was using an obsolete option.
23618
23619- Fixed Barry's mess-up with {}.get(), and added test cases for it.
23620
23621- Shared libraries didn't quite work under AIX because of the change
23622in status of the GNU readline interface. Fix due to by Vladimir
23623Marangozov.
23624
23625
23626======================================================================
23627
23628
23629From 1.5a3 to 1.5a4
23630===================
23631
23632- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
23633feature; better install instructions; removed faqmain.py (which was an
23634older version).
23635
23636- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
23637about the treatment of lines starting with '.'. Added a minimal test
23638function.
23639
23640- struct module: ignore most whitespace in format strings.
23641
23642- urllib.py: close the socket and temp file in URLopener.retrieve() so
23643that multiple retrievals using the same connection work.
23644
23645- All standard exceptions are now classes by default; use -X to make
23646them strings (for backward compatibility only).
23647
23648- There's a new standard exception hierarchy, defined in the standard
23649library module exceptions.py (which you never need to import
23650explicitly). See
23651http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
23652more info.
23653
23654- Three new C API functions:
23655
23656 - int PyErr_GivenExceptionMatches(obj1, obj2)
23657
23658 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
23659 instance of type obj2, or of a class derived from obj2
23660
23661 - int PyErr_ExceptionMatches(obj)
23662
23663 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
23664 PyErr_Occurred() as obj1. This will be the more commonly called
23665 function.
23666
23667 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
23668
23669 Normalizes exceptions, and places the normalized values in the
23670 arguments. If type is not a class, this does nothing. If type is a
23671 class, then it makes sure that value is an instance of the class by:
23672
23673 1. if instance is of the type, or a class derived from type, it does
23674 nothing.
23675
23676 2. otherwise it instantiates the class, using the value as an
23677 argument. If value is None, it uses an empty arg tuple, and if
23678 the value is a tuple, it uses just that.
23679
23680- Another new C API function: PyErr_NewException() creates a new
23681exception class derived from Exception; when -X is given, it creates a
23682new string exception.
23683
23684- core interpreter: remove the distinction between tuple and list
23685unpacking; allow an arbitrary sequence on the right hand side of any
23686unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
23687thing, which should really be called UNPACK_SEQUENCE.)
23688
23689- classes: Allow assignments to an instance's __dict__ or __class__,
23690so you can change ivars (including shared ivars -- shock horror) and
23691change classes dynamically. Also make the check on read-only
23692attributes of classes less draconic -- only the specials names
23693__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
23694assigned.
23695
23696- Two new built-in functions: issubclass() and isinstance(). Both
23697take classes as their second arguments. The former takes a class as
23698the first argument and returns true iff first is second, or is a
23699subclass of second. The latter takes any object as the first argument
23700and returns true iff first is an instance of the second, or any
23701subclass of second.
23702
23703- configure: Added configuration tests for presence of alarm(),
23704pause(), and getpwent().
23705
23706- Doc/Makefile: changed latex2html targets.
23707
23708- classes: Reverse the search order for the Don Beaudry hook so that
23709the first class with an applicable hook wins. Makes more sense.
23710
23711- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
23712now legal to call these more than once. The first call to
23713Py_Initialize() initializes, the first call to Py_Finalize()
23714finalizes. There's also a new API, Py_IsInitalized() which checks
23715whether we are already initialized (in case you want to leave things
23716as they were).
23717
23718- Completely disable the declarations for malloc(), realloc() and
23719free(). Any 90's C compiler has these in header files, and the tests
23720to decide whether to suppress the declarations kept failing on some
23721platforms.
23722
23723- *Before* (instead of after) signalmodule.o is added, remove both
23724intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
23725ld on various systems.
23726
23727- Added reop to PC/config.c
23728
23729- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
23730Removed outdated HP-UX comments from README. Added Cray T3E comments.
23731
23732- Various renames of statically defined functions that had name
23733conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
23734roundup (sys/types.h).
23735
23736- urllib.py: Interpret three slashes in file: URL as local file (for
23737Netscape on Windows/Mac).
23738
23739- copy.py: Make sure the objects returned by __getinitargs__() are
23740kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
23741easily reproducable because it requires a later call to
23742__getinitargs__() to return a tuple that happens to be allocated at
23743the same address.)
23744
23745- Added definition of AR to toplevel Makefile. Renamed @buildno temp
23746file to buildno1.
23747
23748- Moved Include/assert.h to Parser/assert.h, which seems to be the
23749only place where it's needed.
23750
23751- Tweaked the dictionary lookup code again for some more speed
23752(Vladimir Marangozov).
23753
23754- NT build: Changed the way python15.lib is included in the other
23755projects. Per Mark Hammond's suggestion, add it to the extra libs in
23756Settings instead of to the project's source files.
23757
23758- regrtest.py: Change default verbosity so that there are only three
23759levels left: -q, default and -v. In default mode, the name of each
23760test is now printed. -v is the same as the old -vv. -q is more quiet
23761than the old default mode.
23762
23763- Removed the old FAQ from the distribution. You now have to get it
23764from the web!
23765
23766- Removed the PC/make_nt.in file from the distribution; it is no
23767longer needed.
23768
23769- Changed the build sequence so that shared modules are built last.
23770This fixes things for AIX and doesn't hurt elsewhere.
23771
23772- Improved test for GNU MP v1 in mpzmodule.c
23773
23774- fileobject.c: ftell() on Linux discards all buffered data; changed
23775read() code to use lseek() instead to get the same effect
23776
23777- configure.in, configure, importdl.c: NeXT sharedlib fixes
23778
23779- tupleobject.c: PyTuple_SetItem asserts refcnt==1
23780
23781- resource.c: Different strategy regarding whether to declare
23782getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
23783conflicting decls in its headers. Choice: only declare the return
23784type, not the argument prototype, and not on Linux.
23785
23786- importdl.c, configure*: set sharedlib extensions properly for NeXT
23787
23788- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
23789fixed; moved addition of PURIFY to LINKCC to configure
23790
23791- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
23792added to shup up various compilers.
23793
23794- _tkinter.c: removed buggy mac #ifndef
23795
23796- Doc: various Mac documentation changes, added docs for 'ic' module
23797
23798- PC/make_nt.in: deleted
23799
23800- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
23801"")
23802
23803- test_rotor.py: print b -> print `b`
23804
23805- Tkinter.py: (tagOrId) -> (tagOrId,)
23806
23807- Tkinter.py: the Tk class now also has a configure() method and
23808friends (they have been moved to the Misc class to accomplish this).
23809
23810- dict.get(key[, default]) returns dict[key] if it exists, or default
23811if it doesn't. The default defaults to None. This is quicker for
23812some applications than using either has_key() or try:...except
23813KeyError:....
23814
23815- Tools/webchecker/: some small changes to webchecker.py; added
23816websucker.py (a simple web site mirroring script).
23817
23818- Dictionary objects now have a get() method (also in UserDict.py).
23819dict.get(key, default) returns dict[key] if it exists and default
23820otherwise; default defaults to None.
23821
23822- Tools/scripts/logmerge.py: print the author, too.
23823
23824- Changes to import: support for "import a.b.c" is now built in. See
23825http://grail.cnri.reston.va.us/python/essays/packages.html
23826for more info. Most important deviations from "ni.py": __init__.py is
23827executed in the package's namespace instead of as a submodule; and
23828there's no support for "__" or "__domain__". Note that "ni.py" is not
23829changed to match this -- it is simply declared obsolete (while at the
23830same time, it is documented...:-( ).
23831Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
23832for an example implementation of hierarchical module import written in
23833Python).
23834
23835- More changes to import: the site.py module is now imported by
23836default when Python is initialized; use -S to disable it. The site.py
23837module extends the path with several more directories: site-packages
23838inside the lib/python1.5/ directory, site-python in the lib/
23839directory, and pathnames mentioned in *.pth files found in either of
23840those directories. See
23841http://grail.cnri.reston.va.us/python/essays/packages.html
23842for more info.
23843
23844- Changes to standard library subdirectory names: those subdirectories
23845that are not packages have been renamed with a hypen in their name,
23846e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
23847The test suite is now a package -- to run a test, you must now use
23848"import test.test_foo".
23849
23850- A completely new re.py module is provided (thanks to Andrew
23851Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
23852"pcre" re compiler and engine. For a while, the "old" re.py (which
23853was new in 1.5a3!) will be kept around as re1.py. The "old" regex
23854module and underlying parser and engine are still present -- while
23855regex is now officially obsolete, it will probably take several major
23856release cycles before it can be removed.
23857
23858- The posix module now has a strerror() function which translates an
23859error code to a string.
23860
23861- The emacs.py module (which was long obsolete) has been removed.
23862
23863- The universal makefile Misc/Makefile.pre.in now features an
23864"install" target. By default, installed shared libraries go into
23865$exec_prefix/lib/python$VERSION/site-packages/.
23866
23867- The install-sh script is installed with the other configuration
23868specific files (in the config/ subdirectory).
23869
23870- It turns out whatsound.py and sndhdr.py were identical modules.
23871Since there's also an imghdr.py file, I propose to make sndhdr.py the
23872official one. For compatibility, whatsound.py imports * from
23873sndhdr.py.
23874
23875- Class objects have a new attribute, __module__, giving the name of
23876the module in which they were declared. This is useful for pickle and
23877for printing the full name of a class exception.
23878
23879- Many extension modules no longer issue a fatal error when their
23880initialization fails; the importing code now checks whether an error
23881occurred during module initialization, and correctly propagates the
23882exception to the import statement.
23883
23884- Most extension modules now raise class-based exceptions (except when
23885-X is used).
23886
23887- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
23888thread state -- just don't manipulate the lock if it isn't there.
23889
23890- Fixed a bug in Python/getopt.c that made it do the wrong thing when
23891an option was a single '-'. Thanks to Andrew Kuchling.
23892
23893- New module mimetypes.py will guess a MIME type from a filename's
23894extension.
23895
23896- Windows: the DLL version is now settable via a resource rather than
23897being hardcoded. This can be used for "branding" a binary Python
23898distribution.
23899
23900- urllib.py is now threadsafe -- it now uses re instead of regex, and
23901sys.exc_info() instead of sys.exc_{type,value}.
23902
23903- Many other library modules that used to use
23904sys.exc_{type,value,traceback} are now more thread-safe by virtue of
23905using sys.exc_info().
23906
23907- The functions in popen2 have an optional buffer size parameter.
23908Also, the command argument can now be either a string (passed to the
23909shell) or a list of arguments (passed directly to execv).
23910
23911- Alas, the thread support for _tkinter released with 1.5a3 didn't
23912work. It's been rewritten. The bad news is that it now requires a
23913modified version of a file in the standard Tcl distribution, which you
23914must compile with a -I option pointing to the standard Tcl source
23915tree. For this reason, the thread support is disabled by default.
23916
23917- The errno extension module adds two tables: errorcode maps errno
23918numbers to errno names (e.g. EINTR), and errorstr maps them to
23919message strings. (The latter is redundant because the new call
23920posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
23921
23922- The readline extension module now provides some interfaces to
23923internal readline routines that make it possible to write a completer
23924in Python. An example completer, rlcompleter.py, is provided.
23925
23926 When completing a simple identifier, it completes keywords,
23927 built-ins and globals in __main__; when completing
23928 NAME.NAME..., it evaluates (!) the expression up to the last
23929 dot and completes its attributes.
23930
23931 It's very cool to do "import string" type "string.", hit the
23932 completion key (twice), and see the list of names defined by
23933 the string module!
23934
23935 Tip: to use the tab key as the completion key, call
23936
23937 readline.parse_and_bind("tab: complete")
23938
23939- The traceback.py module has a new function tb_lineno() by Marc-Andre
23940Lemburg which extracts the line number from the linenumber table in
23941the code object. Apparently the traceback object doesn't contains the
23942right linenumber when -O is used. Rather than guessing whether -O is
23943on or off, the module itself uses tb_lineno() unconditionally.
23944
23945- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
23946to tag_bind() so it works again.
23947
23948- The pystone script is now a standard library module. Example use:
23949"import test.pystone; test.pystone.main()".
23950
23951- The import of the readline module in interactive mode is now also
23952attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
23953Lemburg, who asked for this. :-)
23954
23955- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
23956Mullender, to be closer to the standard. This fixes the getaddr()
23957method. Unfortunately, getaddrlist() is as broken as ever, since it
23958splits on commas without regard for RFC 822 quoting conventions.
23959
23960- pprint.py: correctly emit trailing "," in singleton tuples.
23961
23962- _tkinter.c: export names for its type objects, TkappType and
23963TkttType.
23964
23965- pickle.py: use __module__ when defined; fix a particularly hard to
23966reproduce bug that confuses the memo when temporary objects are
23967returned by custom pickling interfaces; and a semantic change: when
23968unpickling the instance variables of an instance, use
23969inst.__dict__.update(value) instead of a for loop with setattr() over
23970the value.keys(). This is more consistent (the pickling doesn't use
23971getattr() either but pickles inst.__dict__) and avoids problems with
23972instances that have a __setattr__ hook. But it *is* a semantic change
23973(because the setattr hook is no longer used). So beware!
23974
23975- config.h is now installed (at last) in
23976$exec_prefix/include/python1.5/. For most sites, this means that it
23977is actually in $prefix/include/python1.5/, with all the other Python
23978include files, since $prefix and $exec_prefix are the same by
23979default.
23980
23981- The imp module now supports parts of the functionality to implement
23982import of hierarchical module names. It now supports find_module()
23983and load_module() for all types of modules. Docstrings have been
23984added for those functions in the built-in imp module that are still
23985relevant (some old interfaces are obsolete). For a sample
23986implementation of hierarchical module import in Python, see the new
23987library module knee.py.
23988
23989- The % operator on string objects now allows arbitrary nested parens
23990in a %(...)X style format. (Brad Howes)
23991
23992- Reverse the order in which Setup and Setup.local are passed to the
23993makesetup script. This allows variable definitions in Setup.local to
23994override definitions in Setup. (But you'll still have to edit Setup
23995if you want to disable modules that are enabled by default, or if such
23996modules need non-standard options.)
23997
23998- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
23999is like PyImport_ImporModule(name) but receives the globals and locals
24000dict and the fromlist arguments as well. (The name is a char*; the
24001others are PyObject*s).
24002
24003- The 'p' format in the struct extension module alloded to above is
24004new in 1.5a4.
24005
24006- The types.py module now uses try-except in a few places to make it
24007more likely that it can be imported in restricted mode. Some type
24008names are undefined in that case, e.g. CodeType (inaccessible),
24009FileType (not always accessible), and TracebackType and FrameType
24010(inaccessible).
24011
24012- In urllib.py: added separate administration of temporary files
24013created y URLopener.retrieve() so cleanup() can properly remove them.
24014The old code removed everything in tempcache which was a bad idea if
24015the user had passed a non-temp file into it. Also, in basejoin(),
24016interpret relative paths starting in "../". This is necessary if the
24017server uses symbolic links.
24018
24019- The Windows build procedure and project files are now based on
24020Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
24021directory. It is much more robust, and properly builds separate Debug
24022and Release versions. (The installer will be added shortly.)
24023
24024- Added casts and changed some return types in regexpr.c to avoid
24025compiler warnings or errors on some platforms.
24026
24027- The AIX build tools for shared libraries now supports VPATH. (Donn
24028Cave)
24029
24030- By default, disable the "portable" multimedia modules audioop,
24031imageop, and rgbimg, since they don't work on 64-bit platforms.
24032
24033- Fixed a nasty bug in cStringIO.c when code was actually using the
24034close() method (the destructors would try to free certain fields a
24035second time).
24036
24037- For those who think they need it, there's a "user.py" module. This
24038is *not* imported by default, but can be imported to run user-specific
24039setup commands, ~/.pythonrc.py.
24040
24041- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
24042Vladimir Marangozov, and others.
24043
24044- Added os.altsep; this is '/' on DOS/Windows, and None on systems
24045with a sane filename syntax.
24046
24047- os.py: Write out the dynamic OS choice, to avoid exec statements.
24048Adding support for a new OS is now a bit more work, but I bet that
24049'dos' or 'nt' will cover most situations...
24050
24051- The obsolete exception AccessError is now really gone.
24052
24053- Tools/faqwiz/: New installation instructions show how to maintain
24054multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
24055Added instructions to bootstrap script, too. Version bumped to 0.8.1.
24056Added <html>...</html> feature suggested by Skip Montanaro. Added
24057leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
24058default SRCDIR.
24059
24060- Documentation for the relatively new modules "keyword" and "symbol"
24061has been added (to the end of the section on the parser extension
24062module).
24063
24064- In module bisect.py, but functions have two optional argument 'lo'
24065and 'hi' which allow you to specify a subsequence of the array to
24066operate on.
24067
24068- In ftplib.py, changed most methods to return their status (even when
24069it is always "200 OK") rather than swallowing it.
24070
24071- main() now calls setlocale(LC_ALL, ""), if setlocale() and
24072<locale.h> are defined.
24073
24074- Changes to configure.in, the configure script, and both
24075Makefile.pre.in files, to support SGI's SGI_ABI platform selection
24076environment variable.
24077
24078
24079======================================================================
24080
24081
24082From 1.4 to 1.5a3
24083=================
24084
24085Security
24086--------
24087
24088- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
24089please use the new version. The old version has a huge security leak.
24090
24091Miscellaneous
24092-------------
24093
24094- Because of various (small) incompatible changes in the Python
24095bytecode interpreter, the magic number for .pyc files has changed
24096again.
24097
24098- The default module search path is now much saner. Both on Unix and
24099Windows, it is essentially derived from the path to the executable
24100(which can be overridden by setting the environment variable
24101$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
24102front of the default path, like in Unix (instead of overriding the
24103default path). On Windows, the directory containing the executable is
24104added to the end of the path.
24105
24106- A new version of python-mode.el for Emacs has been included. Also,
24107a new file ccpy-style.el has been added to configure Emacs cc-mode for
24108the preferred style in Python C sources.
24109
24110- On Unix, when using sys.argv[0] to insert the script directory in
24111front of sys.path, expand a symbolic link. You can now install a
24112program in a private directory and have a symbolic link to it in a
24113public bin directory, and it will put the private directory in the
24114module search path. Note that the symlink is expanded in sys.path[0]
24115but not in sys.argv[0], so you can still tell the name by which you
24116were invoked.
24117
24118- It is now recommended to use ``#!/usr/bin/env python'' instead of
24119``#!/usr/local/bin/python'' at the start of executable scripts, except
24120for CGI scripts. It has been determined that the use of /usr/bin/env
24121is more portable than that of /usr/local/bin/python -- scripts almost
24122never have to be edited when the Python interpreter lives in a
24123non-standard place. Note that this doesn't work for CGI scripts since
24124the python executable often doesn't live in the HTTP server's default
24125search path.
24126
24127- The silly -s command line option and the corresponding
24128PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
24129flag in the Python/C API) are gone.
24130
24131- Most problems on 64-bit platforms should now be fixed. Andrew
24132Kuchling helped. Some uncommon extension modules are still not
24133clean (image and audio ops?).
24134
24135- Fixed a bug where multiple anonymous tuple arguments would be mixed up
24136when using the debugger or profiler (reported by Just van Rossum).
24137The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
24138would print the wrong value when run under the debugger or profiler.
24139
24140- The hacks that the dictionary implementation used to speed up
24141repeated lookups of the same C string were removed; these were a
24142source of subtle problems and don't seem to serve much of a purpose
24143any longer.
24144
24145- All traces of support for the long dead access statement have been
24146removed from the sources.
24147
24148- Plugged the two-byte memory leak in the tokenizer when reading an
24149interactive EOF.
24150
24151- There's a -O option to the interpreter that removes SET_LINENO
24152instructions and assert statements (see below); it uses and produces
24153.pyo files instead of .pyc files. The speedup is only a few percent
24154in most cases. The line numbers are still available in the .pyo file,
24155as a separate table (which is also available in .pyc files). However,
24156the removal of the SET_LINENO instructions means that the debugger
24157(pdb) can't set breakpoints on lines in -O mode. The traceback module
24158contains a function to extract a line number from the code object
24159referenced in a traceback object. In the future it should be possible
24160to write external bytecode optimizers that create better optimized
24161.pyo files, and there should be more control over optimization;
24162consider the -O option a "teaser". Without -O, the assert statement
24163actually generates code that first checks __debug__; if this variable
24164is false, the assertion is not checked. __debug__ is a built-in
24165variable whose value is initialized to track the -O flag (it's true
24166iff -O is not specified). With -O, no code is generated for assert
24167statements, nor for code of the form ``if __debug__: <something>''.
24168Sorry, no further constant folding happens.
24169
24170
24171Performance
24172-----------
24173
24174- It's much faster (almost twice for pystone.py -- see
24175Tools/scripts). See the entry on string interning below.
24176
24177- Some speedup by using separate free lists for method objects (both
24178the C and the Python variety) and for floating point numbers.
24179
24180- Big speedup by allocating frame objects with a single malloc() call.
24181The Python/C API for frames is changed (you shouldn't be using this
24182anyway).
24183
24184- Significant speedup by inlining some common opcodes for common operand
24185types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
24186
24187- Small speedup by reordering the method tables of some common
24188objects (e.g. list.append is now first).
24189
24190- Big optimization to the read() method of file objects. A read()
24191without arguments now attempts to use fstat to allocate a buffer of
24192the right size; for pipes and sockets, it will fall back to doubling
24193the buffer size. While that the improvement is real on all systems,
24194it is most dramatic on Windows.
24195
24196
24197Documentation
24198-------------
24199
24200- Many new pieces of library documentation were contributed, mostly by
24201Andrew Kuchling. Even cmath is now documented! There's also a
24202chapter of the library manual, "libundoc.tex", which provides a
24203listing of all undocumented modules, plus their status (e.g. internal,
24204obsolete, or in need of documentation). Also contributions by Sue
24205Williams, Skip Montanaro, and some module authors who succumbed to
24206pressure to document their own contributed modules :-). Note that
24207printing the documentation now kills fewer trees -- the margins have
24208been reduced.
24209
24210- I have started documenting the Python/C API. Unfortunately this project
24211hasn't been completed yet. It will be complete before the final release of
24212Python 1.5, though. At the moment, it's better to read the LaTeX source
24213than to attempt to run it through LaTeX and print the resulting dvi file.
24214
24215- The posix module (and hence os.py) now has doc strings! Thanks to Neil
24216Schemenauer. I received a few other contributions of doc strings. In most
24217other places, doc strings are still wishful thinking...
24218
24219
24220Language changes
24221----------------
24222
24223- Private variables with leading double underscore are now a permanent
24224feature of the language. (These were experimental in release 1.4. I have
24225favorable experience using them; I can't label them "experimental"
24226forever.)
24227
24228- There's new string literal syntax for "raw strings". Prefixing a string
24229literal with the letter r (or R) disables all escape processing in the
24230string; for example, r'\n' is a two-character string consisting of a
24231backslash followed by the letter n. This combines with all forms of string
24232quotes; it is actually useful for triple quoted doc strings which might
24233contain references to \n or \t. An embedded quote prefixed with a
24234backslash does not terminate the string, but the backslash is still
24235included in the string; for example, r'\'' is a two-character string
24236consisting of a backslash and a quote. (Raw strings are also
24237affectionately known as Robin strings, after their inventor, Robin
24238Friedrich.)
24239
24240- There's a simple assert statement, and a new exception
24241AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
24242not foo > 0: raise AssertionError''. Sorry, the text of the asserted
24243condition is not available; it would be too complicated to generate
24244code for this (since the code is generated from a parse tree).
24245However, the text is displayed as part of the traceback!
24246
24247- The raise statement has a new feature: when using "raise SomeClass,
24248somevalue" where somevalue is not an instance of SomeClass, it
24249instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
24250instance of a *derived* class of SomeClass, the exception class raised
24251is set to somevalue.__class__, and SomeClass is ignored after that.
24252
24253- Duplicate keyword arguments are now detected at compile time;
24254f(a=1,a=2) is now a syntax error.
24255
24256
Georg Brandl93dc9eb2010-03-14 10:56:14 +000024257Changes to built-in features
24258----------------------------
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024259
24260- There's a new exception FloatingPointError (used only by Lee Busby's
24261patches to catch floating point exceptions, at the moment).
24262
24263- The obsolete exception ConflictError (presumably used by the long
24264obsolete access statement) has been deleted.
24265
24266- There's a new function sys.exc_info() which returns the tuple
24267(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
24268
24269- There's a new variable sys.executable, pointing to the executable file
24270for the Python interpreter.
24271
24272- The sort() methods for lists no longer uses the C library qsort(); I
24273wrote my own quicksort implementation, with lots of help (in the form
24274of a kind of competition) from Tim Peters. This solves a bug in
24275dictionary comparisons on some Solaris versions when Python is built
24276with threads, and makes sorting lists even faster.
24277
24278- The semantics of comparing two dictionaries have changed, to make
24279comparison of unequal dictionaries faster. A shorter dictionary is
24280always considered smaller than a larger dictionary. For dictionaries
24281of the same size, the smallest differing element determines the
24282outcome (which yields the same results as before in this case, without
24283explicit sorting). Thanks to Aaron Watters for suggesting something
24284like this.
24285
24286- The semantics of try-except have changed subtly so that calling a
24287function in an exception handler that itself raises and catches an
24288exception no longer overwrites the sys.exc_* variables. This also
24289alleviates the problem that objects referenced in a stack frame that
24290caught an exception are kept alive until another exception is caught
24291-- the sys.exc_* variables are restored to their previous value when
24292returning from a function that caught an exception.
24293
24294- There's a new "buffer" interface. Certain objects (e.g. strings and
24295arrays) now support the "buffer" protocol. Buffer objects are acceptable
24296whenever formerly a string was required for a write operation; mutable
24297buffer objects can be the target of a read operation using the call
24298f.readinto(buffer). A cool feature is that regular expression matching now
24299also work on array objects. Contribution by Jack Jansen. (Needs
24300documentation.)
24301
24302- String interning: dictionary lookups are faster when the lookup
24303string object is the same object as the key in the dictionary, not
24304just a string with the same value. This is done by having a pool of
24305"interned" strings. Most names generated by the interpreter are now
24306automatically interned, and there's a new built-in function intern(s)
24307that returns the interned version of a string. Interned strings are
24308not a different object type, and interning is totally optional, but by
24309interning most keys a speedup of about 15% was obtained for the
24310pystone benchmark.
24311
24312- Dictionary objects have several new methods; clear() and copy() have
24313the obvious semantics, while update(d) merges the contents of another
24314dictionary d into this one, overriding existing keys. The dictionary
24315implementation file is now called dictobject.c rather than the
24316confusing mappingobject.c.
24317
24318- The intrinsic function dir() is much smarter; it looks in __dict__,
24319__members__ and __methods__.
24320
24321- The intrinsic functions int(), long() and float() can now take a
24322string argument and then do the same thing as string.atoi(),
24323string.atol(), and string.atof(). No second 'base' argument is
24324allowed, and complex() does not take a string (nobody cared enough).
24325
24326- When a module is deleted, its globals are now deleted in two phases.
24327In the first phase, all variables whose name begins with exactly one
24328underscore are replaced by None; in the second phase, all variables
24329are deleted. This makes it possible to have global objects whose
24330destructors depend on other globals. The deletion order within each
24331phase is still random.
24332
24333- It is no longer an error for a function to be called without a
24334global variable __builtins__ -- an empty directory will be provided
24335by default.
24336
24337- Guido's corollary to the "Don Beaudry hook": it is now possible to
24338do metaprogramming by using an instance as a base class. Not for the
24339faint of heart; and undocumented as yet, but basically if a base class
24340is an instance, its class will be instantiated to create the new
24341class. Jim Fulton will love it -- it also works with instances of his
24342"extension classes", since it is triggered by the presence of a
24343__class__ attribute on the purported base class. See
24344Demo/metaclasses/index.html for an explanation and see that directory
24345for examples.
24346
24347- Another change is that the Don Beaudry hook is now invoked when
24348*any* base class is special. (Up to 1.5a3, the *last* special base
24349class is used; in 1.5a4, the more rational choice of the *first*
24350special base class is used.)
24351
24352- New optional parameter to the readlines() method of file objects.
24353This indicates the number of bytes to read (the actual number of bytes
24354read will be somewhat larger due to buffering reading until the end of
24355the line). Some optimizations have also been made to speed it up (but
24356not as much as read()).
24357
24358- Complex numbers no longer have the ".conj" pseudo attribute; use
24359z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
24360now *do* support the __members__ and __methods__ special attributes.
24361
24362- The complex() function now looks for a __complex__() method on class
24363instances before giving up.
24364
24365- Long integers now support arbitrary shift counts, so you can now
24366write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
24367shift count for this.)
24368
24369- The hex() and oct() functions have been changed so that for regular
24370integers, they never emit a minus sign. For example, on a 32-bit
24371machine, oct(-1) now returns '037777777777' and hex(-1) returns
24372'0xffffffff'. While this may seem inconsistent, it is much more
24373useful. (For long integers, a minus sign is used as before, to fit
24374the result in memory :-)
24375
24376- The hash() function computes better hashes for several data types,
24377including strings, floating point numbers, and complex numbers.
24378
24379
24380New extension modules
24381---------------------
24382
24383- New extension modules cStringIO.c and cPickle.c, written by Jim
24384Fulton and other folks at Digital Creations. These are much more
24385efficient than their Python counterparts StringIO.py and pickle.py,
24386but don't support subclassing. cPickle.c clocks up to 1000 times
24387faster than pickle.py; cStringIO.c's improvement is less dramatic but
24388still significant.
24389
24390- New extension module zlibmodule.c, interfacing to the free zlib
24391library (gzip compatible compression). There's also a module gzip.py
24392which provides a higher level interface. Written by Andrew Kuchling
24393and Jeremy Hylton.
24394
24395- New module readline; see the "miscellaneous" section above.
24396
24397- New Unix extension module resource.c, by Jeremy Hylton, provides
24398access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
24399related symbolic constants.
24400
24401- New extension puremodule.c, by Barry Warsaw, which interfaces to the
24402Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
24403possible to enable Purify by simply setting the PURIFY Makefile
24404variable in the Modules/Setup file.
24405
24406
24407Changes in extension modules
24408----------------------------
24409
24410- The struct extension module has several new features to control byte
24411order and word size. It supports reading and writing IEEE floats even
24412on platforms where this is not the native format. It uses uppercase
24413format codes for unsigned integers of various sizes (always using
24414Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
24415and 'p' for "Pascal strings" (with a leading length byte, included in
24416the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
24417big-endian data and '<' forces little-endian data; these also select
24418standard data sizes and disable automatic alignment (use pad bytes as
24419needed).
24420
24421- The array module supports uppercase format codes for unsigned data
24422formats (like the struct module).
24423
24424- The fcntl extension module now exports the needed symbolic
24425constants. (Formerly these were in FCNTL.py which was not available
24426or correct for all platforms.)
24427
24428- The extension modules dbm, gdbm and bsddb now check that the
24429database is still open before making any new calls.
24430
24431- The dbhash module is no more. Use bsddb instead. (There's a third
24432party interface for the BSD 2.x code somewhere on the web; support for
24433bsddb will be deprecated.)
24434
24435- The gdbm module now supports a sync() method.
24436
24437- The socket module now has some new functions: getprotobyname(), and
24438the set {ntoh,hton}{s,l}().
24439
24440- Various modules now export their type object: socket.SocketType,
24441array.ArrayType.
24442
24443- The socket module's accept() method now returns unknown addresses as
24444a tuple rather than raising an exception. (This can happen in
24445promiscuous mode.) Theres' also a new function getprotobyname().
24446
24447- The pthread support for the thread module now works on most platforms.
24448
24449- STDWIN is now officially obsolete. Support for it will eventually
24450be removed from the distribution.
24451
24452- The binascii extension module is now hopefully fully debugged.
24453(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
24454received.)
24455
24456- audioop.c: added a ratecv() function; better handling of overflow in
24457add().
24458
24459- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
24460Windows, also O_TEXT and O_BINARY. The 'error' variable (the
24461exception is raises) is renamed -- its string value is now "os.error",
24462so newbies don't believe they have to import posix (or nt) to catch
24463it when they see os.error reported as posix.error. The execve()
24464function now accepts any mapping object for the environment.
24465
24466- A new version of the al (audio library) module for SGI was
24467contributed by Sjoerd Mullender.
24468
24469- The regex module has a new function get_syntax() which retrieves the
24470syntax setting set by set_syntax(). The code was also sanitized,
24471removing worries about unclean error handling. See also below for its
24472successor, re.py.
24473
24474- The "new" module (which creates new objects of various types) once
24475again has a fully functioning new.function() method. Dangerous as
24476ever! Also, new.code() has several new arguments.
24477
24478- A problem has been fixed in the rotor module: on systems with signed
24479characters, rotor-encoded data was not portable when the key contained
244808-bit characters. Also, setkey() now requires its argument rather
24481than having broken code to default it.
24482
24483- The sys.builtin_module_names variable is now a tuple. Another new
24484variables in sys is sys.executable (the full path to the Python
24485binary, if known).
24486
24487- The specs for time.strftime() have undergone some revisions. It
24488appears that not all format characters are supported in the same way
24489on all platforms. Rather than reimplement it, we note these
24490differences in the documentation, and emphasize the shared set of
24491features. There's also a thorough test set (that occasionally finds
24492problems in the C library implementation, e.g. on some Linuxes),
24493thanks to Skip Montanaro.
24494
24495- The nis module seems broken when used with NIS+; unfortunately
24496nobody knows how to fix it. It should still work with old NIS.
24497
24498
24499New library modules
24500-------------------
24501
24502- New (still experimental) Perl-style regular expression module,
24503re.py, which uses a new interface for matching as well as a new
24504syntax; the new interface avoids the thread-unsafety of the regex
24505interface. This comes with a helper extension reopmodule.c and vastly
24506rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
24507Peters, and Andrew Kuchling. See the documentation libre.tex. In
245081.5, the old regex module is still fully supported; in the future, it
24509will become obsolete.
24510
24511- New module gzip.py; see zlib above.
24512
24513- New module keyword.py exports knowledge about Python's built-in
24514keywords. (New version by Ka-Ping Yee.)
24515
24516- New module pprint.py (with documentation) which supports
24517pretty-printing of lists, tuples, & dictionaries recursively. By Fred
24518Drake.
24519
24520- New module code.py. The function code.compile_command() can
24521determine whether an interactively entered command is complete or not,
24522distinguishing incomplete from invalid input. (XXX Unfortunately,
24523this seems broken at this moment, and I don't have the time to fix
24524it. It's probably better to add an explicit interface to the parser
24525for this.)
24526
24527- There is now a library module xdrlib.py which can read and write the
24528XDR data format as used by Sun RPC, for example. It uses the struct
24529module.
24530
24531
24532Changes in library modules
24533--------------------------
24534
24535- Module codehack.py is now completely obsolete.
24536
24537- The pickle.py module has been updated to make it compatible with the
24538new binary format that cPickle.c produces. By default it produces the
24539old all-ASCII format compatible with the old pickle.py, still much
24540faster than pickle.py; it will read both formats automatically. A few
24541other updates have been made.
24542
24543- A new helper module, copy_reg.py, is provided to register extensions
24544to the pickling code.
24545
24546- Revamped module tokenize.py is much more accurate and has an
24547interface that makes it a breeze to write code to colorize Python
24548source code. Contributed by Ka-Ping Yee.
24549
24550- In ihooks.py, ModuleLoader.load_module() now closes the file under
24551all circumstances.
24552
24553- The tempfile.py module has a new class, TemporaryFile, which creates
24554an open temporary file that will be deleted automatically when
24555closed. This works on Windows and MacOS as well as on Unix. (Jim
24556Fulton.)
24557
24558- Changes to the cgi.py module: Most imports are now done at the
24559top of the module, which provides a speedup when using ni (Jim
24560Fulton). The problem with file upload to a Windows platform is solved
24561by using the new tempfile.TemporaryFile class; temporary files are now
24562always opened in binary mode (Jim Fulton). The cgi.escape() function
24563now takes an optional flag argument that quotes '"' to '&quot;'. It
24564is now possible to invoke cgi.py from a command line script, to test
24565cgi scripts more easily outside an http server. There's an optional
24566limit to the size of uploads to POST (Skip Montanaro). Added a
24567'strict_parsing' option to all parsing functions (Jim Fulton). The
24568function parse_qs() now uses urllib.unquote() on the name as well as
24569the value of fields (Clarence Gardner). The FieldStorage class now
24570has a __len__() method.
24571
24572- httplib.py: the socket object is no longer closed; all HTTP/1.*
24573responses are now accepted; and it is now thread-safe (by not using
24574the regex module).
24575
24576- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
24577
24578- The popen2.py module is now rewritten using a class, which makes
24579access to the standard error stream and the process id of the
24580subprocess possible.
24581
24582- Added timezone support to the rfc822.py module, in the form of a
24583getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
24584Also added recognition of some non-standard date formats, by Lars
24585Wirzenius, and RFC 850 dates (Chris Lawrence).
24586
24587- mhlib.py: various enhancements, including almost compatible parsing
24588of message sequence specifiers without invoking a subprocess. Also
24589added a createmessage() method by Lars Wirzenius.
24590
24591- The StringIO.StringIO class now supports readline(nbytes). (Lars
24592Wirzenius.) (Of course, you should be using cStringIO for performance.)
24593
24594- UserDict.py supports the new dictionary methods as well.
24595
24596- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
24597speed it up, and replace 0 seed values by 1 to avoid degeneration.
24598A bug was fixed in the test for invalid arguments.
24599
24600- Module ftplib.py: added support for parsing a .netrc file (Fred
24601Drake). Also added an ntransfercmd() method to the FTP class, which
24602allows access to the expected size of a transfer when available, and a
24603parse150() function to the module which parses the corresponding 150
24604response.
24605
24606- urllib.py: the ftp cache is now limited to 10 entries. Added
24607quote_plus() and unquote_plus() functions which are like quote() and
24608unquote() but also replace spaces with '+' or vice versa, for
24609encoding/decoding CGI form arguments. Catch all errors from the ftp
24610module. HTTP requests now add the Host: header line. The proxy
24611variable names are now mapped to lower case, for Windows. The
24612spliturl() function no longer erroneously throws away all data past
24613the first newline. The basejoin() function now intereprets "../"
24614correctly. I *believe* that the problems with "exception raised in
24615__del__" under certain circumstances have been fixed (mostly by
24616changes elsewher in the interpreter).
24617
24618- In urlparse.py, there is a cache for results in urlparse.urlparse();
24619its size limit is set to 20. Also, new URL schemes shttp, https, and
24620snews are "supported".
24621
24622- shelve.py: use cPickle and cStringIO when available. Also added
24623a sync() method, which calls the database's sync() method if there is
24624one.
24625
24626- The mimetools.py module now uses the available Python modules for
24627decoding quoted-printable, uuencode and base64 formats, rather than
24628creating a subprocess.
24629
24630- The python debugger (pdb.py, and its base class bdb.py) now support
24631conditional breakpoints. See the docs.
24632
24633- The modules base64.py, uu.py and quopri.py can now be used as simple
24634command line utilities.
24635
24636- Various small fixes to the nntplib.py module that I can't bother to
24637document in detail.
24638
24639- Sjoerd Mullender's mimify.py module now supports base64 encoding and
24640includes functions to handle the funny encoding you sometimes see in mail
24641headers. It is now documented.
24642
24643- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
24644gotten from the environment.
24645
24646- Many more modules now correctly open files in binary mode when this
24647is necessary on non-Unix platforms.
24648
24649- The copying functions in the undocumented module shutil.py are
24650smarter.
24651
24652- The Writer classes in the formatter.py module now have a flush()
24653method.
24654
24655- The sgmllib.py module accepts hyphens and periods in the middle of
24656attribute names. While this is against the SGML standard, there is
24657some HTML out there that uses this...
24658
24659- The interface for the Python bytecode disassembler module, dis.py,
24660has been enhanced quite a bit. There's now one main function,
24661dis.dis(), which takes almost any kind of object (function, module,
24662class, instance, method, code object) and disassembles it; without
24663arguments it disassembles the last frame of the last traceback. The
24664other functions have changed slightly, too.
24665
24666- The imghdr.py module recognizes new image types: BMP, PNG.
24667
24668- The string.py module has a new function replace(str, old, new,
24669[maxsplit]) which does substring replacements. It is actually
24670implemented in C in the strop module. The functions [r]find() an
24671[r]index() have an optional 4th argument indicating the end of the
24672substring to search, alsoo implemented by their strop counterparts.
24673(Remember, never import strop -- import string uses strop when
24674available with zero overhead.)
24675
24676- The string.join() function now accepts any sequence argument, not
24677just lists and tuples.
24678
24679- The string.maketrans() requires its first two arguments to be
24680present. The old version didn't require them, but there's not much
24681point without them, and the documentation suggests that they are
24682required, so we fixed the code to match the documentation.
24683
24684- The regsub.py module has a function clear_cache(), which clears its
24685internal cache of compiled regular expressions. Also, the cache now
24686takes the current syntax setting into account. (However, this module
24687is now obsolete -- use the sub() or subn() functions or methods in the
24688re module.)
24689
24690- The undocumented module Complex.py has been removed, now that Python
24691has built-in complex numbers. A similar module remains as
24692Demo/classes/Complex.py, as an example.
24693
24694
24695Changes to the build process
24696----------------------------
24697
24698- The way GNU readline is configured is totally different. The
24699--with-readline configure option is gone. It is now an extension
24700module, which may be loaded dynamically. You must enable it (and
Thomas Wouters89f507f2006-12-13 04:49:30 +000024701specify the correct libraries to link with) in the Modules/Setup file.
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024702Importing the module installs some hooks which enable command line
24703editing. When the interpreter shell is invoked interactively, it
24704attempts to import the readline module; when this fails, the default
24705input mechanism is used. The hook variables are PyOS_InputHook and
24706PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
24707ideas from William Magro.)
24708
24709- New build procedure: a single library, libpython1.5.a, is now built,
24710which contains absolutely everything except for a one-line main()
24711program (which calls Py_Main(argc, argv) to start the interpreter
24712shell). This makes life much simpler for applications that need to
24713embed Python. The serial number of the build is now included in the
24714version string (sys.version).
24715
24716- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
24717emits a single warning any more when compiling Python.
24718
24719- A number of new Makefile variables have been added for special
24720situations, e.g. LDLAST is appended to the link command. These are
24721used by editing the Makefile or passing them on the make command
24722line.
24723
24724- A set of patches from Lee Busby has been integrated that make it
24725possible to catch floating point exceptions. Use the configure option
24726--with-fpectl to enable the patches; the extension modules fpectl and
24727fpetest provide control to enable/disable and test the feature,
24728respectively.
24729
24730- The support for shared libraries under AIX is now simpler and more
24731robust. Thanks to Vladimir Marangozov for revamping his own patches!
24732
24733- The Modules/makesetup script now reads a file Setup.local as well as
24734a file Setup. Most changes to the Setup script can be done by editing
24735Setup.local instead, which makes it easier to carry a particular setup
24736over from one release to the next.
24737
24738- The Modules/makesetup script now copies any "include" lines it
24739encounters verbatim into the output Makefile. It also recognizes .cxx
24740and .cpp as C++ source files.
24741
24742- The configure script is smarter about C compiler options; e.g. with
24743gcc it uses -O2 and -g when possible, and on some other platforms it
24744uses -Olimit 1500 to avoid a warning from the optimizer about the main
24745loop in ceval.c (which has more than 1000 basic blocks).
24746
24747- The configure script now detects whether malloc(0) returns a NULL
24748pointer or a valid block (of length zero). This avoids the nonsense
24749of always adding one byte to all malloc() arguments on most platforms.
24750
24751- The configure script has a new option, --with-dec-threads, to enable
24752DEC threads on DEC Alpha platforms. Also, --with-threads is now an
24753alias for --with-thread (this was the Most Common Typo in configure
24754arguments).
24755
24756- Many changes in Doc/Makefile; amongst others, latex2html is now used
24757to generate HTML from all latex documents.
24758
24759
24760Change to the Python/C API
24761--------------------------
24762
24763- Because some interfaces have changed, the PYTHON_API macro has been
24764bumped. Most extensions built for the old API version will still run,
24765but I can't guarantee this. Python prints a warning message on
24766version mismatches; it dumps core when the version mismatch causes a
24767serious problem :-)
24768
24769- I've completed the Grand Renaming, with the help of Roger Masse and
24770Barry Warsaw. This makes reading or debugging the code much easier.
24771Many other unrelated code reorganizations have also been carried out.
24772The allobjects.h header file is gone; instead, you would have to
24773include Python.h followed by rename2.h. But you're better off running
24774Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
24775the rename2.h; it will disappear in the next release.
24776
24777- Various and sundry small bugs in the "abstract" interfaces have been
24778fixed. Thanks to all the (involuntary) testers of the Python 1.4
24779version! Some new functions have been added, e.g. PySequence_List(o),
24780equivalent to list(o) in Python.
24781
24782- New API functions PyLong_FromUnsignedLong() and
24783PyLong_AsUnsignedLong().
24784
24785- The API functions in the file cgensupport.c are no longer
24786supported. This file has been moved to Modules and is only ever
24787compiled when the SGI specific 'gl' module is built.
24788
24789- PyObject_Compare() can now raise an exception. Check with
24790PyErr_Occurred(). The comparison function in an object type may also
24791raise an exception.
24792
24793- The slice interface uses an upper bound of INT_MAX when no explicit
24794upper bound is given (e.x. for a[1:]). It used to ask the object for
24795its length and do the calculations.
24796
24797- Support for multiple independent interpreters. See Doc/api.tex,
24798functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
24799documentation is incomplete, also see the new Demo/pysvr example
24800(which shows how to use these in a threaded application) and the
24801source code.
24802
24803- There is now a Py_Finalize() function which "de-initializes"
24804Python. It is possible to completely restart the interpreter
24805repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
24806change of functionality in Py_Initialize() means that it is now a
24807fatal error to call it while the interpreter is already initialized.
24808The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
24809is deprecated (it is nothing more than Py_Finalize() followed by
24810exit()).
24811
24812- There are no known memory leaks left. While Py_Finalize() doesn't
24813free *all* allocated memory (some of it is hard to track down),
24814repeated calls to Py_Finalize() and Py_Initialize() do not create
24815unaccessible heap blocks.
24816
24817- There is now explicit per-thread state. (Inspired by, but not the
24818same as, Greg Stein's free threading patches.)
24819
24820- There is now better support for threading C applications. There are
24821now explicit APIs to manipulate the interpreter lock. Read the source
24822or the Demo/pysvr example; the new functions are
24823PyEval_{Acquire,Release}{Lock,Thread}().
24824
24825- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
24826with other libraries' DEBUG macros. Likewise for any other test
24827macros that didn't yet start with Py_.
24828
24829- New wrappers around malloc() and friends: Py_Malloc() etc. call
24830malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
24831just malloc(). Use of these wrappers could be essential if multiple
24832memory allocators exist (e.g. when using certain DLL setups under
24833Windows). (Idea by Jim Fulton.)
24834
24835- New C API PyImport_Import() which uses whatever __import__() hook
24836that is installed for the current execution environment. By Jim
24837Fulton.
24838
24839- It is now possible for an extension module's init function to fail
24840non-fatally, by calling one of the PyErr_* functions and returning.
24841
24842- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
24843argument to the proper type, like the similar PyString macros already
24844did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
24845and PyList_GET_ITEM.
24846
24847- Some of the Py_Get* function, like Py_GetVersion() (but not yet
24848Py_GetPath()) are now declared as returning a const char *. (More
24849should follow.)
24850
24851- Changed the run-time library to check for exceptions after object
24852comparisons. PyObject_Compare() can now return an exception; use
24853PyErr_Occurred() to check (there is *no* special return value).
24854
24855- PyFile_WriteString() and Py_Flushline() now return error indicators
24856instead of clearing exceptions. This fixes an obscure bug where using
24857these would clear a pending exception, discovered by Just van Rossum.
24858
24859- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
24860an argument list including keyword arguments. Contributed by Geoff
24861Philbrick.
24862
24863- PyArg_GetInt() is gone.
24864
24865- It's no longer necessary to include graminit.h when calling one of
24866the extended parser API functions. The three public grammar start
24867symbols are now in Python.h as Py_single_input, Py_file_input, and
24868Py_eval_input.
24869
24870- The CObject interface has a new function,
24871PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
24872on the object referenced by "module.name".
24873
24874
24875Tkinter
24876-------
24877
24878- On popular demand, _tkinter once again installs a hook for readline
24879that processes certain Tk events while waiting for the user to type
24880(using PyOS_InputHook).
24881
24882- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
24883caused by command definitions referencing widget objects beyond their
24884lifetime.
24885
24886- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
24887tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
24888with the new Tk dialog scripts, and provide more "native platform"
24889style file selection dialog boxes on some platforms. Contributed by
24890Fredrik Lundh.
24891
24892- Tkinter.py: when the first Tk object is destroyed, it sets the
24893hiddel global _default_root to None, so that when another Tk object is
24894created it becomes the new default root. Other miscellaneous
24895changes and fixes.
24896
24897- The Image class now has a configure method.
24898
24899- Added a bunch of new winfo options to Tkinter.py; we should now be
24900up to date with Tk 4.2. The new winfo options supported are:
24901mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
24902visualsavailable.
24903
24904- The broken bind() method on Canvas objects defined in the Canvas.py
24905module has been fixed. The CanvasItem and Group classes now also have
24906an unbind() method.
24907
24908- The problem with Tkinter.py falling back to trying to import
24909"tkinter" when "_tkinter" is not found has been fixed -- it no longer
24910tries "tkinter", ever. This makes diagnosing the problem "_tkinter
24911not configured" much easier and will hopefully reduce the newsgroup
24912traffic on this topic.
24913
24914- The ScrolledText module once again supports the 'cnf' parameter, to
24915be compatible with the examples in Mark Lutz' book (I know, I know,
24916too late...)
24917
24918- The _tkinter.c extension module has been revamped. It now support
24919Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
24920works well under Windows and Mac (with the latest Tk ports to those
24921platforms). It also supports threading -- it is safe for one
24922(Python-created) thread to be blocked in _tkinter.mainloop() while
24923other threads modify widgets. To make the changes visible, those
24924threads must use update_idletasks()method. (The patch for threading
24925in 1.5a3 was broken; in 1.5a4, it is back in a different version,
24926which requires access to the Tcl sources to get it to work -- hence it
24927is disabled by default.)
24928
24929- A bug in _tkinter.c has been fixed, where Split() with a string
24930containing an unmatched '"' could cause an exception or core dump.
24931
24932- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
24933CreateFileHandler, so _tkinter.createfilehandler is not available on
24934those platforms when using Tk 8.0 or later. I will have to rethink
24935how to interface with Tcl's lower-level event mechanism, or with its
24936channels (which are like Python's file-like objects). Jack Jansen has
24937provided a fix for the Mac, so createfilehandler *is* actually
24938supported there; maybe I can adapt his fix for Windows.
24939
24940
24941Tools and Demos
24942---------------
24943
24944- A new regression test suite is provided, which tests most of the
24945standard and built-in modules. The regression test is run by invoking
24946the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
24947he and Roger Masse contributed most of the new tests.
24948
24949- New tool: faqwiz -- the CGI script that is used to maintain the
24950Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
24951Tools/faqwiz.
24952
24953- New tool: webchecker -- a simple extensible web robot that, when
24954aimed at a web server, checks that server for dead links. Available
24955are a command line utility as well as a Tkinter based GUI version. In
24956Tools/webchecker. A simplified version of this program is dissected
24957in my article in O'Reilly's WWW Journal, the issue on Scripting
24958Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
24959Includes a parser for robots.txt files by Skip Montanaro.
24960
24961- New small tools: cvsfiles.py (prints a list of all files under CVS
24962n a particular directory tree), treesync.py (a rather Guido-specific
24963script to synchronize two source trees, one on Windows NT, the other
24964one on Unix under CVS but accessible from the NT box), and logmerge.py
24965(sort a collection of RCS or CVS logs by date). In Tools/scripts.
24966
24967- The freeze script now also works under Windows (NT). Another
24968feature allows the -p option to be pointed at the Python source tree
24969instead of the installation prefix. This was loosely based on part of
24970xfreeze by Sam Rushing and Bill Tutt.
24971
24972- New examples (Demo/extend) that show how to use the generic
24973extension makefile (Misc/Makefile.pre.in).
24974
24975- Tools/scripts/h2py.py now supports C++ comments.
24976
24977- Tools/scripts/pystone.py script is upgraded to version 1.1; there
24978was a bug in version 1.0 (distributed with Python 1.4) that leaked
24979memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
24980
24981- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
24982
24983
24984Windows (NT and 95)
24985-------------------
24986
24987- New project files for Developer Studio (Visual C++) 5.0 for Windows
24988NT (the old VC++ 4.2 Makefile is also still supported, but will
24989eventually be withdrawn due to its bulkiness).
24990
24991- See the note on the new module search path in the "Miscellaneous" section
24992above.
24993
24994- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
24995basically withdrawn. If it still works for you, you're lucky.
24996
24997- There's a new extension module, msvcrt.c, which provides various
24998low-level operations defined in the Microsoft Visual C++ Runtime Library.
24999These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
25000console I/O functions like kbhit(), getch() and putch().
25001
25002- The -u option not only sets the standard I/O streams to unbuffered
25003status, but also sets them in binary mode. (This can also be done
25004using msvcrt.setmode(), by the way.)
25005
25006- The, sys.prefix and sys.exec_prefix variables point to the directory
25007where Python is installed, or to the top of the source tree, if it was run
25008from there.
25009
25010- The various os.path modules (posixpath, ntpath, macpath) now support
25011passing more than two arguments to the join() function, so
25012os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
25013c)).
25014
25015- The ntpath module (normally used as os.path) supports ~ to $HOME
25016expansion in expanduser().
25017
25018- The freeze tool now works on Windows.
25019
25020- See also the Tkinter category for a sad note on
25021_tkinter.createfilehandler().
25022
25023- The truncate() method for file objects now works on Windows.
25024
25025- Py_Initialize() is no longer called when the DLL is loaded. You
25026must call it yourself.
25027
25028- The time module's clock() function now has good precision through
25029the use of the Win32 API QueryPerformanceCounter().
25030
25031- Mark Hammond will release Python 1.5 versions of PythonWin and his
25032other Windows specific code: the win32api extensions, COM/ActiveX
25033support, and the MFC interface.
25034
25035
25036Mac
25037---
25038
25039- As always, the Macintosh port will be done by Jack Jansen. He will
25040make a separate announcement for the Mac specific source code and the
25041binary distribution(s) when these are ready.
25042
25043
25044======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +000025045
Guido van Rossumaa253861994-10-06 17:18:57 +000025046
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025047=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +000025048==> Release 1.4 (October 25 1996) <==
25049=====================================
25050
25051(Starting in reverse chronological order:)
25052
25053- Changed disclaimer notice.
25054
25055- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
25056default to the user's login shell.
25057
25058- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
25059widget, and bogus bspace() function.
25060
25061- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
25062paragraph.
25063
25064- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
25065subprojects, and to remove the (broken) experimental NumPy
25066subprojects.
25067
25068- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
25069(where os.stat() returns mtimes as floats.)
25070- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
25071fix POST in CGIHTTPServer.py.
25072
25073- Version 2.83 of Misc/python-mode.el for Emacs is included.
25074
25075- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
25076group starting immediately after a group tag.
25077
25078- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
25079
25080- In Objects/stringobject.c, fixed the compare function to do the
25081first char comparison in unsigned mode, for consistency with the way
25082other characters are compared by memcmp().
25083
25084- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
25085
25086- In Lib/urllib.py, fix another case where openedurl wasn't set.
25087
25088(XXX Sorry, the rest is in totally random order. No time to fix it.)
25089
25090- SyntaxError exceptions detected during code generation
25091(e.g. assignment to an expression) now include a line number.
25092
25093- Don't leave trailing / or \ in script directory inserted in front of
25094sys.path.
25095
25096- Added a note to Tools/scripts/classfix.py abouts its historical
25097importance.
25098
25099- Added Misc/Makefile.pre.in, a universal Makefile for extensions
25100built outside the distribution.
25101
25102- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
25103
25104- Install shared modules with mode 555 (needed for performance on some
25105platforms).
25106
25107- Some changes to standard library modules to avoid calling append()
25108with more than one argument -- while supported, this should be
25109outlawed, and I don't want to set a bad example.
25110
25111- bdb.py (and hence pdb.py) supports calling run() with a code object
25112instead of a code string.
25113
25114- Fixed an embarrassing bug cgi.py which prevented correct uploading
25115of binary files from Netscape (which doesn't distinguish between
25116binary and text files). Also added dormant logging support, which
25117makes it easier to debug the cgi module itself.
25118
25119- Added default writer to constructor of NullFormatter class.
25120
25121- Use binary mode for socket.makefile() calls in ftplib.py.
25122
25123- The ihooks module no longer "installs" itself upon import -- this
25124was an experimental feature that helped ironing out some bugs but that
25125slowed down code that imported it without the need to install it
25126(e.g. the rexec module). Also close the file in some cases and add
25127the __file__ attribute to loaded modules.
25128
25129- The test program for mailbox.py is now more useful.
25130
25131- Added getparamnames() to Message class in mimetools.py -- it returns
25132the names of parameters to the content-type header.
25133
25134- Fixed a typo in ni that broke the loop stripping "__." from names.
25135
25136- Fix sys.path[0] for scripts run via pdb.py's new main program.
25137
25138- profile.py can now also run a script, like pdb.
25139
25140- Fix a small bug in pyclbr -- don't add names starting with _ when
25141emulating from ... import *.
25142
25143- Fixed a series of embarrassing typos in rexec's handling of standard
25144I/O redirection. Added some more "safe" built-in modules: cmath,
25145errno, operator.
25146
25147- Fixed embarrassing typo in shelve.py.
25148
25149- Added SliceType and EllipsisType to types.py.
25150
25151- In urllib.py, added handling for error 301 (same as 302); added
25152geturl() method to get the URL after redirection.
25153
25154- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
25155for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
25156
25157- Fixed bsddbmodule.c to add binary mode indicator on platforms that
25158have it. This should make it working on Windows NT.
25159
25160- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
25161whatever applies. Also rationalized some other tests for various MS
25162platforms.
25163
25164- Added the sources for the NT installer script used for Python
251651.4beta3. Not tested with this release, but better than nothing.
25166
25167- A compromise in pickle's defenses against Trojan horses: a
25168user-defined function is now okay where a class is expected. A
25169built-in function is not okay, to prevent pickling something that
25170will execute os.system("rm -f *") when unpickling.
25171
25172- dis.py will print the name of local variables referenced by local
25173load/store/delete instructions.
25174
25175- Improved portability of SimpleHTTPServer module to non-Unix
25176platform.
25177
25178- The thread.h interface adds an extra argument to down_sema(). This
25179only affects other C code that uses thread.c; the Python thread module
25180doesn't use semaphores (which aren't provided on all platforms where
25181Python threads are supported). Note: on NT, this change is not
25182implemented.
25183
25184- Fixed some typos in abstract.h; corrected signature of
25185PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
25186abstract.c's PyObject_CallMethod().
25187
25188- apply(classname, (), {}) now works even if the class has no
25189__init__() method.
25190
25191- Implemented complex remainder and divmod() (these would dump core!).
25192Conversion of complex numbers to int, long int or float now raises an
25193exception, since there is no meaningful way to do it without losing
25194information.
25195
25196- Fixed bug in built-in complex() function which gave the wrong result
25197for two real arguments.
25198
25199- Change the hash algorithm for strings -- the multiplier is now
252001000003 instead of 3, which gives better spread for short strings.
25201
25202- New default path for Windows NT, the registry structure now supports
25203default paths for different install packages. (Mark Hammond -- the
25204next PythonWin release will use this.)
25205
25206- Added more symbols to the python_nt.def file.
25207
25208- When using GNU readline, set rl_readline_name to "python".
25209
25210- The Ellipses built-in name has been renamed to Ellipsis -- this is
25211the correct singular form. Thanks to Ka-Ping Yee, who saved us from
25212eternal embarrassment.
25213
25214- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
25215Ellipsis name change.
25216
25217- Updated the library reference manual. Added documentation of
25218restricted mode (rexec, Bastion) and the formatter module (for use
25219with the htmllib module). Fixed the documentation of htmllib
25220(finally).
25221
25222- The reference manual is now maintained in FrameMaker.
25223
25224- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
25225
25226- Slight improvements to Doc/Makefile.
25227
25228- Added fcntl.lockf(). This should be used for Unix file locking
25229instead of the posixfile module; lockf() is more portable.
25230
25231- The getopt module now supports long option names, thanks to Lars
25232Wizenius.
25233
25234- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
25235and Nils Fischbeck.
25236
25237- Use more bits of time.time() in whrandom's default seed().
25238
25239- Performance hack for regex module's regs attribute.
25240
25241- Don't close already closed socket in socket module.
25242
25243- Correctly handle separators containing embedded nulls in
25244strop.split, strop.find and strop.rfind. Also added more detail to
25245error message for strop.atoi and friends.
25246
25247- Moved fallback definition for hypot() to Python/hypot.c.
25248
25249- Added fallback definition for strdup, in Python/strdup.c.
25250
25251- Fixed some bugs where a function would return 0 to indicate an error
25252where it should return -1.
25253
25254- Test for error returned by time.localtime(), and rationalized its MS
25255tests.
25256
25257- Added Modules/Setup.local file, which is processed after Setup.
25258
25259- Corrected bug in toplevel Makefile.in -- execution of regen script
25260would not use the right PATH and PYTHONPATH.
25261
25262- Various and sundry NeXT configuration changes (sigh).
25263
25264- Support systems where libreadline needs neither termcap nor curses.
25265
25266- Improved ld_so_aix script and python.exp file (for AIX).
25267
25268- More stringent test for working <stdarg.h> in configure script.
25269
25270- Removed Demo/www subdirectory -- it was totally out of date.
25271
25272- Improved demos and docs for Fred Drake's parser module; fixed one
25273typo in the module itself.
25274
25275
25276=========================================
25277==> Release 1.4beta3 (August 26 1996) <==
25278=========================================
25279
25280
25281(XXX This is less readable that it should. I promise to restructure
25282it for the final 1.4 release.)
25283
25284
25285What's new in 1.4beta3 (since beta2)?
25286-------------------------------------
25287
25288- Name mangling to implement a simple form of class-private variables.
25289A name of the form "__spam" can't easily be used outside the class.
25290(This was added in 1.4beta3, but left out of the 1.4beta3 release
25291message.)
25292
25293- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
25294handled correctly when using a proxy server.
25295
25296- In ntpath.normpath(): don't truncate to 8+3 format.
25297
25298- In mimetools.choose_boundary(): don't die when getuid() or getpid()
25299aren't defined.
25300
25301- Module urllib: some optimizations to (un)quoting.
25302
25303- New module MimeWriter for writing MIME documents.
25304
25305- More changes to formatter module.
25306
25307- The freeze script works once again and is much more robust (using
25308sys.prefix etc.). It also supports a -o option to specify an
25309output directory.
25310
25311- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
25312
25313- The Doc/Makefile targets have been reorganized somewhat to remove the
25314insistence on always generating PostScript.
25315
25316- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
25317
25318- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
25319name conflict on the Mac.
25320
25321- Linking a module compiled with a different setting for Py_TRACE_REFS now
25322generates a linker error rather than a core dump.
25323
25324- The cgi module has a new convenience function print_exception(), which
25325formats a python exception using HTML. It also fixes a bug in the
25326compatibility code and adds a dubious feature which makes it possible to
25327have two query strings, one in the URL and one in the POST data.
25328
25329- A subtle change in the unpickling of class instances makes it possible
25330to unpickle in restricted execution mode, where the __dict__ attribute is
25331not available (but setattr() is).
25332
25333- Documentation for os.path.splitext() (== posixpath.splitext()) has been
25334cleared up. It splits at the *last* dot.
25335
25336- posixfile locking is now also correctly supported on AIX.
25337
25338- The tempfile module once again honors an initial setting of tmpdir. It
25339now works on Windows, too.
25340
25341- The traceback module has some new functions to extract, format and print
25342the active stack.
25343
25344- Some translation functions in the urllib module have been made a little
25345less sluggish.
25346
25347- The addtag_* methods for Canvas widgets in Tkinter as well as in the
25348separate Canvas class have been fixed so they actually do something
25349meaningful.
25350
25351- A tiny _test() function has been added to Tkinter.py.
25352
25353- A generic Makefile for dynamically loaded modules is provided in the Misc
25354subdirectory (Misc/gMakefile).
25355
25356- A new version of python-mode.el for Emacs is provided. See
25357http://www.python.org/ftp/emacs/pmdetails.html for details. The
25358separate file pyimenu.el is no longer needed, imenu support is folded
25359into python-mode.el.
25360
25361- The configure script can finally correctly find the readline library in a
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000025362non-standard location. The LDFLAGS variable is passed on the Makefiles
Guido van Rossum821a5581997-05-23 04:05:31 +000025363from the configure script.
25364
25365- Shared libraries are now installed as programs (i.e. with executable
25366permission). This is required on HP-UX and won't hurt on other systems.
25367
25368- The objc.c module is no longer part of the distribution. Objective-C
25369support may become available as contributed software on the ftp site.
25370
25371- The sybase module is no longer part of the distribution. A much
25372improved sybase module is available as contributed software from the
25373ftp site.
25374
25375- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
25376Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
25377now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
25378
25379- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
25380can use *.so and *.sl as shared libraries.
25381
25382- Some more fidgeting for AIX shared libraries.
25383
25384- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
25385(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
25386available from the contrib directory on the ftp site.)
25387
25388- A warning is written to sys.stderr when a __del__ method raises an
25389exception (formerly, such exceptions were completely ignored).
25390
25391- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
25392incapable of ANSI style token concatenation and stringification.
25393
25394- All source files (except a few platform specific modules) are once again
25395compatible with K&R C compilers as well as ANSI compilers. In particular,
25396ANSI-isms have been removed or made conditional in complexobject.c,
25397getargs.c and operator.c.
25398
25399- The abstract object API has three new functions, PyObject_DelItem,
25400PySequence_DelItem, and PySequence_DelSlice.
25401
25402- The operator module has new functions delitem and delslice, and the
25403functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
25404"and" are reserved words). ("__or__" and "__and__" are unchanged.)
25405
25406- The environment module is no longer supported; putenv() is now a function
25407in posixmodule (also under NT).
25408
25409- Error in filter(<function>, "") has been fixed.
25410
25411- Unrecognized keyword arguments raise TypeError, not KeyError.
25412
25413- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
25414some more documentation.
25415
25416- Bug in float power boundary case (0.0 to the negative integer power)
25417fixed.
25418
25419- The test of negative number to the float power has been moved from the
25420built-in pow() functin to floatobject.c (so complex numbers can yield the
25421correct result).
25422
25423- The bug introduced in beta2 where shared libraries loaded (using
25424dlopen()) from the current directory would fail, has been fixed.
25425
25426- Modules imported as shared libraries now also have a __file__ attribute,
25427giving the filename from which they were loaded. The only modules without
25428a __file__ attribute now are built-in modules.
25429
25430- On the Mac, dynamically loaded modules can end in either ".slb" or
25431".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
25432extension should only be used for "fat" binaries.
25433
25434- C API addition: marshal.c now supports
25435PyMarshal_WriteObjectToString(object).
25436
25437- C API addition: getargs.c now supports
25438PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
25439to parse keyword arguments.
25440
25441- The PC versioning scheme (sys.winver) has changed once again. the
25442version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
25443first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
25444"1.4.1" for Python 1.4.1 -- the beta level is not included) and
25445<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
25446
25447- h2py.py accepts whitespace before the # in CPP directives
25448
25449- On Solaris 2.5, it should now be possible to use either Posix threads or
25450Solaris threads (XXX: how do you select which is used???). (Note: the
25451Python pthreads interface doesn't fully support semaphores yet -- anyone
25452care to fix this?)
25453
25454- Thread support should now work on AIX, using either DCE threads or
25455pthreads.
25456
25457- New file Demo/sockets/unicast.py
25458
25459- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
25460both) (XXX)
25461
25462- New project setup for PC port, now compatible with PythonWin, with
25463_tkinter and NumPy support (XXX)
25464
25465- New module site.py (XXX)
25466
25467- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
25468
25469- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
25470
25471- regen script fixed (XXX)
25472
25473- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
25474
25475- testall now also tests math module (XXX)
25476
25477- string.atoi c.s. now raise an exception for an empty input string.
25478
25479- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
25480have config.h included at various places.
25481
25482- Unrecognized keyword arguments now raise TypeError rather than KeyError.
25483
25484- The makesetup script recognizes files with extension .so or .sl as
25485(shared) libraries.
25486
25487- 'access' is no longer a reserved word, and all code related to its
25488implementation is gone (or at least #ifdef'ed out). This should make
25489Python a little speedier too!
25490
25491- Performance enhancements suggested by Sjoerd Mullender. This includes
25492the introduction of two new optional function pointers in type object,
25493getattro and setattro, which are like getattr and setattr but take a
25494string object instead of a C string pointer.
25495
25496- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
25497only on the left or only on the right, A new optional third argument to
25498split() specifies the maximum number of separators honored (so
25499splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
255001.3, splitfields(s, None) is totally equivalent to split(s).)
25501string.capwords() has an optional second argument specifying the
25502separator (which is passed to split()).
25503
25504- regsub.split() has the same addition as string.split(). regsub.splitx(s,
25505sep, maxsep) implements the functionality that was regsub.split(s, 1) in
255061.4beta2 (return a list containing the delimiters as well as the words).
25507
25508- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
25509
25510- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
25511argument to _tkinter.create() to set Tcl's argv0 variable, so X
25512resources use the right resource class again.
25513
25514- Add #undef fabs to Modules/mathmodule.c for macintosh.
25515
25516- Added some macro renames for AIX in Modules/operator.c.
25517
25518- Removed spurious 'E' from Doc/liberrno.tex.
25519
25520- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
25521Misc/gMakefile and new version of Misc/python-mode.el.
25522
25523- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
25524NameError).
25525
25526- Added missing "from types import *" to Lib/tkinter/Canvas.py.
25527
25528- Added hint about using default args for __init__ to pickle docs.
25529
25530- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
25531PySequence_Length.
25532
25533- Some improvements to Doc/texi2html.py.
25534
25535- In Python/import.c, Cast unsigned char * in struct _frozen to char *
25536in calls to rds_object().
25537
25538- In doc/ref4.tex, added note about scope of lambda bodies.
25539
25540What's new in 1.4beta2 (since beta1)?
25541-------------------------------------
25542
25543- Portability bug in the md5.h header solved.
25544
25545- The PC build procedure now really works, and sets sys.platform to a
25546meaningful value (a few things were botched in beta 1). Lib/dos_8x3
25547is now a standard part of the distribution (alas).
25548
25549- More improvements to the installation procedure. Typing "make install"
25550now inserts the version number in the pathnames of almost everything
25551installed, and creates the machine dependent modules (FCNTL.py etc.) if not
25552supplied by the distribution. (XXX There's still a problem with the latter
25553because the "regen" script requires that Python is installed. Some manual
25554intervention may still be required.) (This has been fixed in 1.4beta3.)
25555
25556- New modules: errno, operator (XXX).
25557
Georg Brandl93dc9eb2010-03-14 10:56:14 +000025558- Changes for use with Numerical Python: built-in function slice() and
Guido van Rossum821a5581997-05-23 04:05:31 +000025559Ellipses object, and corresponding syntax:
25560
25561 x[lo:hi:stride] == x[slice(lo, hi, stride)]
25562 x[a, ..., z] == x[(a, Ellipses, z)]
25563
Raymond Hettinger565ea5a2004-10-02 11:02:59 +000025564- New documentation for errno and cgi modules.
Guido van Rossum821a5581997-05-23 04:05:31 +000025565
25566- The directory containing the script passed to the interpreter is
25567inserted in from of sys.path; "." is no longer a default path
25568component.
25569
25570- Optional third string argument to string.translate() specifies
25571characters to delete. New function string.maketrans() creates a
25572translation table for translate() or for regex.compile().
25573
25574- Module posix (and hence module os under Unix) now supports putenv().
25575Moreover, module os is enhanced so that if putenv() is supported,
25576assignments to os.environ entries make the appropriate putenv() call.
25577(XXX the putenv() implementation can leak a small amount of memory per
25578call.)
25579
25580- pdb.py can now be invoked from the command line to debug a script:
25581python pdb.py <script> <arg> ...
25582
25583- Much improved parseaddr() in rfc822.
25584
25585- In cgi.py, you can now pass an alternative value for environ to
25586nearly all functions.
25587
25588- You can now assign to instance variables whose name begins and ends
25589with '__'.
25590
25591- New version of Fred Drake's parser module and associates (token,
25592symbol, AST).
25593
25594- New PYTHON_API_VERSION value and .pyc file magic number (again!).
25595
25596- The "complex" internal structure type is now called "Py_complex" to
25597avoid name conflicts.
25598
25599- Numerous small bugs fixed.
25600
25601- Slight pickle speedups.
25602
25603- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
25604
25605- NeXT portability mods by Bill Bumgarner integrated.
25606
25607- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
25608converted to new naming style.
25609
25610
25611What's new in 1.4beta1 (since 1.3)?
25612-----------------------------------
25613
25614- Added sys.platform and sys.exec_platform for Bill Janssen.
25615
25616- Installation has been completely overhauled. "make install" now installs
25617everything, not just the python binary. Installation uses the install-sh
25618script (borrowed from X11) to install each file.
25619
25620- New functions in the posix module: mkfifo, plock, remove (== unlink),
25621and ftruncate. More functions are also available under NT.
25622
25623- New function in the fcntl module: flock.
25624
25625- Shared library support for FreeBSD.
25626
25627- The --with-readline option can now be used without a DIRECTORY argument,
25628for systems where libreadline.* is in one of the standard places. It is
25629also possible for it to be a shared library.
25630
25631- The extension tkinter has been renamed to _tkinter, to avoid confusion
25632with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
25633well as 4.0.
25634
25635- Author's change of address from CWI in Amsterdam, The Netherlands, to
25636CNRI in Reston, VA, USA.
25637
25638- The math.hypot() function is now always available (if it isn't found in
25639the C math library, Python provides its own implementation).
25640
25641- The latex documentation is now compatible with latex2e, thanks to David
25642Ascher.
25643
25644- The expression x**y is now equivalent to pow(x, y).
25645
25646- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
25647
25648- Complex numbers are now supported. Imaginary constants are written with
25649a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
25650part to an imaginary part, like 3+4j. Complex numbers are always stored in
25651floating point form, so this is equivalent to 3.0+4.0j. It is also
25652possible to create complex numbers with the new built-in function
25653complex(re, [im]). For the footprint-conscious, complex number support can
25654be disabled by defining the symbol WITHOUT_COMPLEX.
25655
25656- New built-in function list() is the long-awaited counterpart of tuple().
25657
25658- There's a new "cmath" module which provides the same functions as the
25659"math" library but with complex arguments and results. (There are very
25660good reasons why math.sqrt(-1) still raises an exception -- you have to use
25661cmath.sqrt(-1) to get 1j for an answer.)
25662
25663- The Python.h header file (which is really the same as allobjects.h except
25664it disables support for old style names) now includes several more files,
25665so you have to have fewer #include statements in the average extension.
25666
25667- The NDEBUG symbol is no longer used. Code that used to be dependent on
25668the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
25669and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
25670respectively. At long last, the source actually compiles and links without
25671errors when this symbol is defined.
25672
25673- Several symbols that didn't follow the new naming scheme have been
25674renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
25675are no external symbols left without a Py or _Py prefix, not even those
25676defined by sources that were incorporated from elsewhere (regexpr.c,
25677md5c.c). (Macros are a different story...)
25678
25679- There are now typedefs for the structures defined in config.c and
25680frozen.c.
25681
25682- New PYTHON_API_VERSION value and .pyc file magic number.
25683
25684- New module Bastion. (XXX)
25685
25686- Improved performance of StringIO module.
25687
25688- UserList module now supports + and * operators.
25689
25690- The binhex and binascii modules now actually work.
25691
25692- The cgi module has been almost totally rewritten and documented.
25693It now supports file upload and a new data type to handle forms more
25694flexibly.
25695
25696- The formatter module (for use with htmllib) has been overhauled (again).
25697
25698- The ftplib module now supports passive mode and has doc strings.
25699
25700- In (ideally) all places where binary files are read or written, the file
25701is now correctly opened in binary mode ('rb' or 'wb') so the code will work
25702on Mac or PC.
25703
25704- Dummy versions of os.path.expandvars() and expanduser() are now provided
25705on non-Unix platforms.
25706
25707- Module urllib now has two new functions url2pathname and pathname2url
25708which turn local filenames into "file:..." URLs using the same rules as
25709Netscape (why be different). it also supports urlretrieve() with a
25710pathname parameter, and honors the proxy environment variables (http_proxy
25711etc.). The URL parsing has been improved somewhat, too.
25712
25713- Micro improvements to urlparse. Added urlparse.urldefrag() which
25714removes a trailing ``#fragment'' if any.
25715
25716- The mailbox module now supports MH style message delimiters as well.
25717
25718- The mhlib module contains some new functionality: setcontext() to set the
25719current folder and parsesequence() to parse a sequence as commonly passed
25720to MH commands (e.g. 1-10 or last:5).
25721
25722- New module mimify for conversion to and from MIME format of email
25723messages.
25724
25725- Module ni now automatically installs itself when first imported -- this
25726is against the normal rule that modules should define classes and functions
25727but not invoke them, but appears more useful in the case that two
25728different, independent modules want to use ni's features.
25729
25730- Some small performance enhancements in module pickle.
25731
25732- Small interface change to the profile.run*() family of functions -- more
25733sensible handling of return values.
25734
25735- The officially registered Mac creator for Python files is 'Pyth'. This
25736replaces 'PYTH' which was used before but never registered.
25737
25738- Added regsub.capwords(). (XXX)
25739
25740- Added string.capwords(), string.capitalize() and string.translate().
25741(XXX)
25742
25743- Fixed an interface bug in the rexec module: it was impossible to pass a
25744hooks instance to the RExec class. rexec now also supports the dynamic
25745loading of modules from shared libraries. Some other interfaces have been
25746added too.
25747
25748- Module rfc822 now caches the headers in a dictionary for more efficient
25749lookup.
25750
25751- The sgmllib module now understands a limited number of SGML "shorthands"
25752like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
25753
25754- The tempfile module actually tries a number of different places to find a
25755usable temporary directory. (This was prompted by certain Linux
25756installations that appear to be missing a /usr/tmp directory.) [A bug in
25757the implementation that would ignore a pre-existing tmpdir global has been
25758fixed in beta3.]
25759
25760- Much improved and enhanved FileDialog module for Tkinter.
25761
25762- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
25763well as Tk 4.1).
25764
25765- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
25766s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
25767extension is called _socket and a wrapper module win/socket.py provides
25768"makefile()" and "dup()" functionality. On Windows, the select module
25769works only with socket objects.
25770
25771- Bugs in bsddb module fixed (e.g. missing default argument values).
25772
25773- The curses extension now includes <ncurses.h> when available.
25774
25775- The gdbm module now supports opening databases in "fast" mode by
25776specifying 'f' as the second character or the mode string.
25777
25778- new variables sys.prefix and sys.exec_prefix pass corresponding
25779configuration options / Makefile variables to the Python programmer.
25780
25781- The ``new'' module now supports creating new user-defined classes as well
25782as instances thereof.
25783
25784- The soundex module now sports get_soundex() to get the soundex value for an
25785arbitrary string (formerly it would only do soundex-based string
25786comparison) as well as doc strings.
25787
25788- New object type "cobject" to safely wrap void pointers for passing them
25789between various extension modules.
25790
25791- More efficient computation of float**smallint.
25792
25793- The mysterious bug whereby "x.x" (two occurrences of the same
25794one-character name) typed from the commandline would sometimes fail
25795mysteriously.
25796
25797- The initialization of the readline function can now be invoked by a C
25798extension through PyOS_ReadlineInit().
25799
25800- There's now an externally visible pointer PyImport_FrozenModules which
25801can be changed by an embedding application.
25802
25803- The argument parsing functions now support a new format character 'D' to
25804specify complex numbers.
25805
25806- Various memory leaks plugged and bugs fixed.
25807
25808- Improved support for posix threads (now that real implementations are
25809beginning to apepar). Still no fully functioning semaphores.
25810
25811- Some various and sundry improvements and new entries in the Tools
25812directory.
25813
25814
25815=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025816==> Release 1.3 (13 October 1995) <==
25817=====================================
25818
25819Major change
25820============
25821
25822Two words: Keyword Arguments. See the first section of Chapter 12 of
25823the Tutorial.
25824
25825(The rest of this file is textually the same as the remaining sections
25826of that chapter.)
25827
25828
25829Changes to the WWW and Internet tools
25830=====================================
25831
25832The "htmllib" module has been rewritten in an incompatible fashion.
25833The new version is considerably more complete (HTML 2.0 except forms,
25834but including all ISO-8859-1 entity definitions), and easy to use.
25835Small changes to "sgmllib" have also been made, to better match the
25836tokenization of HTML as recognized by other web tools.
25837
25838A new module "formatter" has been added, for use with the new
25839"htmllib" module.
25840
25841The "urllib"and "httplib" modules have been changed somewhat to allow
25842overriding unknown URL types and to support authentication. They now
25843use "mimetools.Message" instead of "rfc822.Message" to parse headers.
25844The "endrequest()" method has been removed from the HTTP class since
25845it breaks the interaction with some servers.
25846
25847The "rfc822.Message" class has been changed to allow a flag to be
25848passed in that says that the file is unseekable.
25849
25850The "ftplib" module has been fixed to be (hopefully) more robust on
25851Linux.
25852
25853Several new operations that are optionally supported by servers have
25854been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
25855
25856Other Language Changes
25857======================
25858
25859The "raise" statement now takes an optional argument which specifies
25860the traceback to be used when printing the exception's stack trace.
25861This must be a traceback object, such as found in "sys.exc_traceback".
25862When omitted or given as "None", the old behavior (to generate a stack
25863trace entry for the current stack frame) is used.
25864
25865The tokenizer is now more tolerant of alien whitespace. Control-L in
25866the leading whitespace of a line resets the column number to zero,
25867while Control-R just before the end of the line is ignored.
25868
25869Changes to Built-in Operations
25870==============================
25871
25872For file objects, "f.read(0)" and "f.readline(0)" now return an empty
25873string rather than reading an unlimited number of bytes. For the
25874latter, omit the argument altogether or pass a negative value.
25875
25876A new system variable, "sys.platform", has been added. It specifies
25877the current platform, e.g. "sunos5" or "linux1".
25878
25879The built-in functions "input()" and "raw_input()" now use the GNU
25880readline library when it has been configured (formerly, only
25881interactive input to the interpreter itself was read using GNU
25882readline). The GNU readline library provides elaborate line editing
25883and history. The Python debugger ("pdb") is the first beneficiary of
25884this change.
25885
25886Two new built-in functions, "globals()" and "locals()", provide access
25887to dictionaries containming current global and local variables,
25888respectively. (These augment rather than replace "vars()", which
25889returns the current local variables when called without an argument,
25890and a module's global variables when called with an argument of type
25891module.)
25892
25893The built-in function "compile()" now takes a third possible value for
25894the kind of code to be compiled: specifying "'single'" generates code
25895for a single interactive statement, which prints the output of
25896expression statements that evaluate to something else than "None".
25897
25898Library Changes
25899===============
25900
25901There are new module "ni" and "ihooks" that support importing modules
25902with hierarchical names such as "A.B.C". This is enabled by writing
25903"import ni; ni.ni()" at the very top of the main program. These
25904modules are amply documented in the Python source.
25905
25906The module "rexec" has been rewritten (incompatibly) to define a class
25907and to use "ihooks".
25908
25909The "string.split()" and "string.splitfields()" functions are now the
25910same function (the presence or absence of the second argument
25911determines which operation is invoked); similar for "string.join()"
25912and "string.joinfields()".
25913
25914The "Tkinter" module and its helper "Dialog" have been revamped to use
25915keyword arguments. Tk 4.0 is now the standard. A new module
25916"FileDialog" has been added which implements standard file selection
25917dialogs.
25918
25919The optional built-in modules "dbm" and "gdbm" are more coordinated
25920--- their "open()" functions now take the same values for their "flag"
25921argument, and the "flag" and "mode" argument have default values (to
25922open the database for reading only, and to create the database with
25923mode "0666" minuse the umask, respectively). The memory leaks have
25924finally been fixed.
25925
25926A new dbm-like module, "bsddb", has been added, which uses the BSD DB
25927package's hash method.
25928
25929A portable (though slow) dbm-clone, implemented in Python, has been
25930added for systems where none of the above is provided. It is aptly
25931dubbed "dumbdbm".
25932
25933The module "anydbm" provides a unified interface to "bsddb", "gdbm",
25934"dbm", and "dumbdbm", choosing the first one available.
25935
25936A new extension module, "binascii", provides a variety of operations
25937for conversion of text-encoded binary data.
25938
25939There are three new or rewritten companion modules implemented in
25940Python that can encode and decode the most common such formats: "uu"
25941(uuencode), "base64" and "binhex".
25942
25943A module to handle the MIME encoding quoted-printable has also been
25944added: "quopri".
25945
25946The parser module (which provides an interface to the Python parser's
25947abstract syntax trees) has been rewritten (incompatibly) by Fred
25948Drake. It now lets you change the parse tree and compile the result!
25949
25950The \code{syslog} module has been upgraded and documented.
25951
25952Other Changes
25953=============
25954
25955The dynamic module loader recognizes the fact that different filenames
25956point to the same shared library and loads the library only once, so
25957you can have a single shared library that defines multiple modules.
25958(SunOS / SVR4 style shared libraries only.)
25959
25960Jim Fulton's ``abstract object interface'' has been incorporated into
25961the run-time API. For more detailes, read the files
25962"Include/abstract.h" and "Objects/abstract.c".
25963
25964The Macintosh version is much more robust now.
25965
25966Numerous things I have forgotten or that are so obscure no-one will
25967notice them anyway :-)
25968
25969
Guido van Rossumf456b6d1995-01-04 19:20:37 +000025970===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +000025971==> Release 1.2 (13 April 1995) <==
25972===================================
25973
25974- Changes to Misc/python-mode.el:
25975 - Wrapping and indentation within triple quote strings should work
25976 properly now.
25977 - `Standard' bug reporting mechanism (use C-c C-b)
25978 - py-mark-block was moved to C-c C-m
25979 - C-c C-v shows you the python-mode version
25980 - a basic python-font-lock-keywords has been added for Emacs 19
25981 font-lock colorizations.
25982 - proper interaction with pending-del and del-sel modes.
25983 - New py-electric-colon (:) command for improved outdenting. Also
25984 py-indent-line (TAB) should handle outdented lines better.
25985 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
25986
25987- The Library Reference has been restructured, and many new and
25988existing modules are now documented, in particular the debugger and
25989the profiler, as well as the persistency and the WWW/Internet support
25990modules.
25991
25992- All known bugs have been fixed. For example the pow(2,2,3L) bug on
25993Linux has been fixed. Also the re-entrancy problems with __del__ have
25994been fixed.
25995
25996- All known memory leaks have been fixed.
25997
25998- Phase 2 of the Great Renaming has been executed. The header files
25999now use the new names (PyObject instead of object, etc.). The linker
26000also sees the new names. Most source files still use the old names,
26001by virtue of the rename2.h header file. If you include Python.h, you
26002only see the new names. Dynamically linked modules have to be
26003recompiled. (Phase 3, fixing the rest of the sources, will be
26004executed gradually with the release later versions.)
26005
26006- The hooks for implementing "safe-python" (better called "restricted
26007execution") are in place. Specifically, the import statement is
26008implemented by calling the built-in function __import__, and the
26009built-in names used in a particular scope are taken from the
26010dictionary __builtins__ in that scope's global dictionary. See also
26011the new (unsupported, undocumented) module rexec.py.
26012
26013- The import statement now supports the syntax "import a.b.c" and
26014"from a.b.c import name". No officially supported implementation
26015exists, but one can be prototyped by replacing the built-in __import__
26016function. A proposal by Ken Manheimer is provided as newimp.py.
26017
26018- All machinery used by the import statement (or the built-in
26019__import__ function) is now exposed through the new built-in module
26020"imp" (see the library reference manual). All dynamic loading
26021machinery is moved to the new file importdl.c.
26022
26023- Persistent storage is supported through the use of the modules
26024"pickle" and "shelve" (implemented in Python). There's also a "copy"
26025module implementing deepcopy and normal (shallow) copy operations.
26026See the library reference manual.
26027
26028- Documentation strings for many objects types are accessible through
26029the __doc__ attribute. Modules, classes and functions support special
26030syntax to initialize the __doc__ attribute: if the first statement
26031consists of just a string literal, that string literal becomes the
26032value of the __doc__ attribute. The default __doc__ attribute is
26033None. Documentation strings are also supported for built-in
26034functions, types and modules; however this feature hasn't been widely
26035used yet. See the 'new' module for an example. (Basically, the type
26036object's tp_doc field contains the doc string for the type, and the
260374th member of the methodlist structure contains the doc string for the
26038method.)
26039
26040- The __coerce__ and __cmp__ methods for user-defined classes once
26041again work as expected. As an example, there's a new standard class
26042Complex in the library.
26043
26044- The functions posix.popen() and posix.fdopen() now have an optional
26045third argument to specify the buffer size, and default their second
Georg Brandl93dc9eb2010-03-14 10:56:14 +000026046(mode) argument to 'r' -- in analogy to the built-in open() function.
Guido van Rossumd462f3d1995-10-09 21:30:37 +000026047The same applies to posixfile.open() and the socket method makefile().
26048
26049- The thread.exit_thread() function now raises SystemExit so that
26050'finally' clauses are honored and a memory leak is plugged.
26051
26052- Improved X11 and Motif support, by Sjoerd Mullender. This extension
26053is being maintained and distributed separately.
26054
26055- Improved support for the Apple Macintosh, in part by Jack Jansen,
26056e.g. interfaces to (a few) resource mananger functions, get/set file
26057type and creator, gestalt, sound manager, speech manager, MacTCP, comm
26058toolbox, and the think C console library. This is being maintained
26059and distributed separately.
26060
26061- Improved version for Windows NT, by Mark Hammond. This is being
26062maintained and distributed separately.
26063
26064- Used autoconf 2.0 to generate the configure script. Adapted
26065configure.in to use the new features in autoconf 2.0.
26066
26067- It now builds on the NeXT without intervention, even on the 3.3
26068Sparc pre-release.
26069
26070- Characters passed to isspace() and friends are masked to nonnegative
26071values.
26072
26073- Correctly compute pow(-3.0, 3).
26074
26075- Fix portability problems with getopt (configure now checks for a
26076non-GNU getopt).
26077
26078- Don't add frozenmain.o to libPython.a.
26079
26080- Exceptions can now be classes. ALl built-in exceptions are still
26081string objects, but this will change in the future.
26082
26083- The socket module exports a long list of socket related symbols.
26084(More built-in modules will export their symbolic constants instead of
26085relying on a separately generated Python module.)
26086
26087- When a module object is deleted, it clears out its own dictionary.
26088This fixes a circularity in the references between functions and
26089their global dictionary.
26090
26091- Changed the error handling by [new]getargs() e.g. for "O&".
26092
26093- Dynamic loading of modules using shared libraries is supported for
26094several new platforms.
26095
26096- Support "O&", "[...]" and "{...}" in mkvalue().
26097
26098- Extension to findmethod(): findmethodinchain() (where a chain is a
26099linked list of methodlist arrays). The calling interface for
26100findmethod() has changed: it now gets a pointer to the (static!)
26101methodlist structure rather than just to the function name -- this
26102saves copying flags etc. into the (short-lived) method object.
26103
26104- The callable() function is now public.
26105
26106- Object types can define a few new operations by setting function
26107pointers in the type object structure: tp_call defines how an object
26108is called, and tp_str defines how an object's str() is computed.
26109
26110
26111===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +000026112==> Release 1.1.1 (10 Nov 1994) <==
26113===================================
26114
26115This is a pure bugfix release again. See the ChangeLog file for details.
26116
26117One exception: a few new features were added to tkinter.
26118
26119
26120=================================
26121==> Release 1.1 (11 Oct 1994) <==
26122=================================
26123
26124This release adds several new features, improved configuration and
26125portability, and fixes more bugs than I can list here (including some
26126memory leaks).
26127
26128The source compiles and runs out of the box on more platforms than
26129ever -- including Windows NT. Makefiles or projects for a variety of
26130non-UNIX platforms are provided.
26131
26132APOLOGY: some new features are badly documented or not at all. I had
26133the choice -- postpone the new release indefinitely, or release it
26134now, with working code but some undocumented areas. The problem with
26135postponing the release is that people continue to suffer from existing
26136bugs, and send me patches based on the previous release -- which I
26137can't apply directly because my own source has changed. Also, some
26138new modules (like signal) have been ready for release for quite some
26139time, and people are anxiously waiting for them. In the case of
26140signal, the interface is simple enough to figure out without
26141documentation (if you're anxious enough :-). In this case it was not
26142simple to release the module on its own, since it relies on many small
26143patches elsewhere in the source.
26144
26145For most new Python modules, the source code contains comments that
26146explain how to use them. Documentation for the Tk interface, written
26147by Matt Conway, is available as tkinter-doc.tar.gz from the Python
26148home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
26149new operator overloading facilities, have a look at Demo/classes:
26150Complex.py and Rat.py show how to implement a numeric type without and
26151with __coerce__ method. Also have a look at the end of the Tutorial
26152document (Doc/tut.tex). If you're still confused: use the newsgroup
26153or mailing list.
26154
26155
26156New language features:
26157
26158 - More flexible operator overloading for user-defined classes
26159 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
26160
26161 - Classes can define methods named __getattr__, __setattr__ and
26162 __delattr__ to trap attribute accesses. See end of tutorial.
26163
26164 - Classes can define method __call__ so instances can be called
26165 directly. See end of tutorial.
26166
26167
26168New support facilities:
26169
26170 - The Makefiles (for the base interpreter as well as for extensions)
26171 now support creating dynamically loadable modules if the platform
26172 supports shared libraries.
26173
26174 - Passing the interpreter a .pyc file as script argument will execute
26175 the code in that file. (On the Mac such files can be double-clicked!)
26176
26177 - New Freeze script, to create independently distributable "binaries"
26178 of Python programs -- look in Demo/freeze
26179
26180 - Improved h2py script (in Demo/scripts) follows #includes and
26181 supports macros with one argument
26182
26183 - New module compileall generates .pyc files for all modules in a
26184 directory (tree) without also executing them
26185
26186 - Threads should work on more platforms
26187
26188
26189New built-in modules:
26190
26191 - tkinter (support for Tcl's Tk widget set) is now part of the base
26192 distribution
26193
26194 - signal allows catching or ignoring UNIX signals (unfortunately still
26195 undocumented -- any taker?)
26196
26197 - termios provides portable access to POSIX tty settings
26198
26199 - curses provides an interface to the System V curses library
26200
26201 - syslog provides an interface to the (BSD?) syslog daemon
26202
26203 - 'new' provides interfaces to create new built-in object types
26204 (e.g. modules and functions)
26205
26206 - sybase provides an interface to SYBASE database
26207
26208
26209New/obsolete built-in methods:
26210
26211 - callable(x) tests whether x can be called
26212
26213 - sockets now have a setblocking() method
26214
26215 - sockets no longer have an allowbroadcast() method
26216
26217 - socket methods send() and sendto() return byte count
26218
26219
26220New standard library modules:
26221
26222 - types.py defines standard names for built-in types, e.g. StringType
26223
26224 - urlparse.py parses URLs according to the latest Internet draft
26225
26226 - uu.py does uuencode/uudecode (not the fastest in the world, but
26227 quicker than installing uuencode on a non-UNIX machine :-)
26228
26229 - New, faster and more powerful profile module.py
26230
26231 - mhlib.py provides interface to MH folders and messages
26232
26233
26234New facilities for extension writers (unfortunately still
26235undocumented):
26236
26237 - newgetargs() supports optional arguments and improved error messages
26238
26239 - O!, O& O? formats for getargs allow more versatile type checking of
26240 non-standard types
26241
26242 - can register pending asynchronous callback, to be called the next
26243 time the Python VM begins a new instruction (Py_AddPendingCall)
26244
26245 - can register cleanup routines to be called when Python exits
26246 (Py_AtExit)
26247
26248 - makesetup script understands C++ files in Setup file (use file.C
26249 or file.cc)
26250
26251 - Make variable OPT is passed on to sub-Makefiles
26252
26253 - An init<module>() routine may signal an error by not entering
26254 the module in the module table and raising an exception instead
26255
26256 - For long module names, instead of foobarbletchmodule.c you can
26257 use foobarbletch.c
26258
26259 - getintvalue() and getfloatvalue() try to convert any object
26260 instead of requiring an "intobject" or "floatobject"
26261
26262 - All the [new]getargs() formats that retrieve an integer value
26263 will now also work if a float is passed
26264
26265 - C function listtuple() converts list to tuple, fast
26266
26267 - You should now call sigcheck() instead of intrcheck();
26268 sigcheck() also sets an exception when it returns nonzero
26269
26270
Guido van Rossumaa253861994-10-06 17:18:57 +000026271====================================
26272==> Release 1.0.3 (14 July 1994) <==
26273====================================
26274
26275This release consists entirely of bug fixes to the C sources; see the
26276head of ../ChangeLog for a complete list. Most important bugs fixed:
26277
26278- Sometimes the format operator (string%expr) would drop the last
26279character of the format string
26280
26281- Tokenizer looped when last line did not end in \n
26282
26283- Bug when triple-quoted string ended in quote plus newline
26284
26285- Typo in socketmodule (listen) (== instead of =)
26286
26287- typing vars() at the >>> prompt would cause recursive output
26288
26289
26290==================================
26291==> Release 1.0.2 (4 May 1994) <==
26292==================================
26293
26294Overview of the most visible changes. Bug fixes are not listed. See
26295also ChangeLog.
26296
26297Tokens
26298------
26299
26300* String literals follow Standard C rules: they may be continued on
26301the next line using a backslash; adjacent literals are concatenated
26302at compile time.
26303
26304* A new kind of string literals, surrounded by triple quotes (""" or
26305'''), can be continued on the next line without a backslash.
26306
26307Syntax
26308------
26309
26310* Function arguments may have a default value, e.g. def f(a, b=1);
26311defaults are evaluated at function definition time. This also applies
26312to lambda.
26313
26314* The try-except statement has an optional else clause, which is
26315executed when no exception occurs in the try clause.
26316
26317Interpreter
26318-----------
26319
26320* The result of a statement-level expression is no longer printed,
26321except_ for expressions entered interactively. Consequently, the -k
26322command line option is gone.
26323
26324* The result of the last printed interactive expression is assigned to
26325the variable '_'.
26326
26327* Access to implicit global variables has been speeded up by removing
26328an always-failing dictionary lookup in the dictionary of local
26329variables (mod suggested by Steve Makewski and Tim Peters).
26330
26331* There is a new command line option, -u, to force stdout and stderr
26332to be unbuffered.
26333
26334* Incorporated Steve Majewski's mods to import.c for dynamic loading
26335under AIX.
26336
26337* Fewer chances of dumping core when trying to reload or re-import
26338static built-in, dynamically loaded built-in, or frozen modules.
26339
26340* Loops over sequences now don't ask for the sequence's length when
26341they start, but try to access items 0, 1, 2, and so on until they hit
26342an IndexError. This makes it possible to create classes that generate
26343infinite or indefinite sequences a la Steve Majewski. This affects
26344for loops, the (not) in operator, and the built-in functions filter(),
26345map(), max(), min(), reduce().
26346
26347Changed Built-in operations
26348---------------------------
26349
26350* The '%' operator on strings (printf-style formatting) supports a new
26351feature (adapted from a patch by Donald Beaudry) to allow
26352'%(<key>)<format>' % {...} to take values from a dictionary by name
26353instead of from a tuple by position (see also the new function
26354vars()).
26355
26356* The '%s' formatting operator is changed to accept any type and
26357convert it to a string using str().
26358
26359* Dictionaries with more than 20,000 entries can now be created
26360(thanks to Steve Kirsch).
26361
26362New Built-in Functions
26363----------------------
26364
26365* vars() returns a dictionary containing the local variables; vars(m)
26366returns a dictionary containing the variables of module m. Note:
26367dir(x) is now equivalent to vars(x).keys().
26368
26369Changed Built-in Functions
26370--------------------------
26371
26372* open() has an optional third argument to specify the buffer size: 0
26373for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
26374for default.
26375
26376* open()'s second argument is now optional; it defaults to "r".
26377
26378* apply() now checks that its second argument is indeed a tuple.
26379
26380New Built-in Modules
26381--------------------
26382
26383Changed Built-in Modules
26384------------------------
26385
26386The thread module no longer supports exit_prog().
26387
26388New Python Modules
26389------------------
26390
26391* Module addpack contains a standard interface to modify sys.path to
26392find optional packages (groups of related modules).
26393
26394* Module urllib contains a number of functions to access
26395World-Wide-Web files specified by their URL.
26396
26397* Module httplib implements the client side of the HTTP protocol used
26398by World-Wide-Web servers.
26399
26400* Module gopherlib implements the client side of the Gopher protocol.
26401
26402* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
26403style mailbox files.
26404
26405* Module random contains various random distributions, e.g. gauss().
26406
26407* Module lockfile locks and unlocks open files using fcntl (inspired
26408by a similar module by Andy Bensky).
26409
26410* Module ntpath (by Jaap Vermeulen) implements path operations for
26411Windows/NT.
26412
26413* Module test_thread (in Lib/test) contains a small test set for the
26414thread module.
26415
26416Changed Python Modules
26417----------------------
26418
26419* The string module's expandvars() function is now documented and is
26420implemented in Python (using regular expressions) instead of forking
26421off a shell process.
26422
26423* Module rfc822 now supports accessing the header fields using the
26424mapping/dictionary interface, e.g. h['subject'].
26425
26426* Module pdb now makes it possible to set a break on a function
26427(syntax: break <expression>, where <expression> yields a function
26428object).
26429
26430Changed Demos
26431-------------
26432
26433* The Demo/scripts/freeze.py script is working again (thanks to Jaap
26434Vermeulen).
26435
26436New Demos
26437---------
26438
26439* Demo/threads/Generator.py is a proposed interface for restartable
26440functions a la Tim Peters.
26441
26442* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
26443directory full of HTML pages which between them contain links to all
26444the newsgroups available on your server.
26445
26446* Demo/dns contains a DNS (Domain Name Server) client.
26447
26448* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
26449nice enhanced Python shell!!!).
26450
26451* Demo/turing contains a Turing machine by Amrit Prem.
26452
26453Documentation
26454-------------
26455
26456* Documented new language features mentioned above (but not all new
26457modules).
26458
26459* Added a chapter to the Tutorial describing recent additions to
26460Python.
26461
26462* Clarified some sentences in the reference manual,
26463e.g. break/continue, local/global scope, slice assignment.
26464
26465Source Structure
26466----------------
26467
26468* Moved Include/tokenizer.h to Parser/tokenizer.h.
26469
26470* Added Python/getopt.c for systems that don't have it.
26471
26472Emacs mode
26473----------
26474
26475* Indentation of continuated lines is done more intelligently;
26476consequently the variable py-continuation-offset is gone.
26477
Guido van Rossumf2eac992000-09-04 17:24:24 +000026478
Guido van Rossumaa253861994-10-06 17:18:57 +000026479========================================
26480==> Release 1.0.1 (15 February 1994) <==
26481========================================
26482
26483* Many portability fixes should make it painless to build Python on
26484several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
26485
26486* Fixed test for <stdarg.h> -- this broke on some platforms.
26487
26488* Fixed test for shared library dynalic loading -- this broke on SunOS
264894.x using the GNU loader.
26490
26491* Changed order and number of SVR4 networking libraries (it is now
26492-lsocket -linet -lnsl, if these libraries exist).
26493
26494* Installing the build intermediate stages with "make libainstall" now
26495also installs config.c.in, Setup and makesetup, which are used by the
26496new Extensions mechanism.
26497
26498* Improved README file contains more hints and new troubleshooting
26499section.
26500
26501* The built-in module strop now defines fast versions of three more
26502functions of the standard string module: atoi(), atol() and atof().
26503The strop versions of atoi() and atol() support an optional second
26504argument to specify the base (default 10). NOTE: you don't have to
26505explicitly import strop to use the faster versions -- the string
26506module contains code to let versions from stop override the default
26507versions.
26508
26509* There is now a working Lib/dospath.py for those who use Python under
26510DOS (or Windows). Thanks, Jaap!
26511
26512* There is now a working Modules/dosmodule.c for DOS (or Windows)
26513system calls.
26514
26515* Lib.os.py has been reorganized (making it ready for more operating
26516systems).
26517
26518* Lib/ospath.py is now obsolete (use os.path instead).
26519
26520* Many fixes to the tutorial to make it match Python 1.0. Thanks,
26521Tim!
26522
26523* Fixed Doc/Makefile, Doc/README and various scripts there.
26524
26525* Added missing description of fdopen to Doc/libposix.tex.
26526
26527* Made cleanup() global, for the benefit of embedded applications.
26528
26529* Added parsing of addresses and dates to Lib/rfc822.py.
26530
26531* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
26532them usable at all.
26533
26534* New module Lib/wave.py reads RIFF (*.wav) audio files.
26535
26536* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
26537belongs.
26538
26539* New options and comments for Modules/makesetup (used by new
26540Extension mechanism).
26541
26542* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
26543and elsewhere.
26544
26545* Fixed coredump in filter(None, 'abcdefg').
26546
26547
26548=======================================
26549==> Release 1.0.0 (26 January 1994) <==
26550=======================================
26551
26552As is traditional, so many things have changed that I can't pretend to
26553be complete in these release notes, but I'll try anyway :-)
26554
26555Note that the very last section is labeled "remaining bugs".
26556
26557
26558Source organization and build process
26559-------------------------------------
26560
26561* The sources have finally been split: instead of a single src
26562subdirectory there are now separate directories Include, Parser,
26563Grammar, Objects, Python and Modules. Other directories also start
26564with a capital letter: Misc, Doc, Lib, Demo.
26565
26566* A few extensions (notably Amoeba and X support) have been moved to a
26567separate subtree Extensions, which is no longer in the core
26568distribution, but separately ftp'able as extensions.tar.Z. (The
26569distribution contains a placeholder Ext-dummy with a description of
26570the Extensions subtree as well as the most recent versions of the
26571scripts used there.)
26572
26573* A few large specialized demos (SGI video and www) have been
26574moved to a separate subdirectory Demo2, which is no longer in the core
26575distribution, but separately ftp'able as demo2.tar.Z.
26576
26577* Parts of the standard library have been moved to subdirectories:
26578there are now standard subdirectories stdwin, test, sgi and sun4.
26579
26580* The configuration process has radically changed: I now use GNU
26581autoconf. This makes it much easier to build on new Unix flavors, as
26582well as fully supporting VPATH (if your Make has it). The scripts
26583Configure.py and Addmodule.sh are no longer needed. Many source files
26584have been adapted in order to work with the symbols that the configure
26585script generated by autoconf defines (or not); the resulting source is
26586much more portable to different C compilers and operating systems,
26587even non Unix systems (a Mac port was done in an afternoon). See the
26588toplevel README file for a description of the new build process.
26589
26590* GNU readline (a slightly newer version) is now a subdirectory of the
26591Python toplevel. It is still not automatically configured (being
26592totally autoconf-unaware :-). One problem has been solved: typing
26593Control-C to a readline prompt will now work. The distribution no
26594longer contains a "super-level" directory (above the python toplevel
26595directory), and dl, dl-dld and GNU dld are no longer part of the
26596Python distribution (you can still ftp them from
26597ftp.cwi.nl:/pub/dynload).
26598
26599* The DOS functions have been taken out of posixmodule.c and moved
26600into a separate file dosmodule.c.
26601
26602* There's now a separate file version.c which contains nothing but
26603the version number.
26604
26605* The actual main program is now contained in config.c (unless NO_MAIN
26606is defined); pythonmain.c now contains a function realmain() which is
26607called from config.c's main().
26608
26609* All files needed to use the built-in module md5 are now contained in
26610the distribution. The module has been cleaned up considerably.
26611
26612
26613Documentation
26614-------------
26615
26616* The library manual has been split into many more small latex files,
26617so it is easier to edit Doc/lib.tex file to create a custom library
26618manual, describing only those modules supported on your system. (This
26619is not automated though.)
26620
26621* A fourth manual has been added, titled "Extending and Embedding the
26622Python Interpreter" (Doc/ext.tex), which collects information about
26623the interpreter which was previously spread over several files in the
26624misc subdirectory.
26625
26626* The entire documentation is now also available on-line for those who
26627have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
26628"http://www.cwi.nl/~guido/Python.html".
26629
26630
26631Syntax
26632------
26633
26634* Strings may now be enclosed in double quotes as well as in single
26635quotes. There is no difference in interpretation. The repr() of
26636string objects will use double quotes if the string contains a single
26637quote and no double quotes. Thanks to Amrit Prem for these changes!
26638
26639* There is a new keyword 'exec'. This replaces the exec() built-in
26640function. If a function contains an exec statement, local variable
26641optimization is not performed for that particular function, thus
26642making assignment to local variables in exec statements less
26643confusing. (As a consequence, os.exec and python.exec have been
26644renamed to execv.)
26645
26646* There is a new keyword 'lambda'. An expression of the form
26647
26648 lambda <parameters> : <expression>
26649
26650yields an anonymous function. This is really only syntactic sugar;
26651you can just as well define a local function using
26652
26653 def some_temporary_name(<parameters>): return <expression>
26654
26655Lambda expressions are particularly useful in combination with map(),
26656filter() and reduce(), described below. Thanks to Amrit Prem for
26657submitting this code (as well as map(), filter(), reduce() and
26658xrange())!
26659
26660
26661Built-in functions
26662------------------
26663
26664* The built-in module containing the built-in functions is called
26665__builtin__ instead of builtin.
26666
26667* New built-in functions map(), filter() and reduce() perform standard
26668functional programming operations (though not lazily):
26669
26670- map(f, seq) returns a new sequence whose items are the items from
26671seq with f() applied to them.
26672
26673- filter(f, seq) returns a subsequence of seq consisting of those
26674items for which f() is true.
26675
26676- reduce(f, seq, initial) returns a value computed as follows:
26677 acc = initial
26678 for item in seq: acc = f(acc, item)
26679 return acc
26680
26681* New function xrange() creates a "range object". Its arguments are
26682the same as those of range(), and when used in a for loop a range
26683objects also behaves identical. The advantage of xrange() over
26684range() is that its representation (if the range contains many
26685elements) is much more compact than that of range(). The disadvantage
26686is that the result cannot be used to initialize a list object or for
26687the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
26688architectures, benchmarks have shown that "for i in range(...): ..."
26689actually executes *faster* than "for i in xrange(...): ...", but on
26690memory starved machines like PCs running DOS range(100000) may be just
26691too big to be represented at all...
26692
26693* Built-in function exec() has been replaced by the exec statement --
26694see above.
26695
26696
26697The interpreter
26698---------------
26699
26700* Syntax errors are now not printed to stderr by the parser, but
26701rather the offending line and other relevant information are packed up
26702in the SyntaxError exception argument. When the main loop catches a
26703SyntaxError exception it will print the error in the same format as
26704previously, but at the proper position in the stack traceback.
26705
26706* You can now set a maximum to the number of traceback entries
26707printed by assigning to sys.tracebacklimit. The default is 1000.
26708
26709* The version number in .pyc files has changed yet again.
26710
26711* It is now possible to have a .pyc file without a corresponding .py
26712file. (Warning: this may break existing installations if you have an
26713old .pyc file lingering around somewhere on your module search path
26714without a corresponding .py file, when there is a .py file for a
26715module of the same name further down the path -- the new interpreter
26716will find the first .pyc file and complain about it, while the old
26717interpreter would ignore it and use the .py file further down.)
26718
26719* The list sys.builtin_module_names is now sorted and also contains
26720the names of a few hardwired built-in modules (sys, __main__ and
26721__builtin__).
26722
26723* A module can now find its own name by accessing the global variable
26724__name__. Assigning to this variable essentially renames the module
26725(it should also be stored under a different key in sys.modules).
26726A neat hack follows from this: a module that wants to execute a main
26727program when called as a script no longer needs to compare
26728sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
26729
26730* When an object is printed by the print statement, its implementation
26731of str() is used. This means that classes can define __str__(self) to
26732direct how their instances are printed. This is different from
26733__repr__(self), which should define an unambigous string
26734representation of the instance. (If __str__() is not defined, it
26735defaults to __repr__().)
26736
26737* Functions and code objects can now be compared meaningfully.
26738
26739* On systems supporting SunOS or SVR4 style shared libraries, dynamic
26740loading of modules using shared libraries is automatically configured.
26741Thanks to Bill Jansen and Denis Severson for contributing this change!
26742
26743
26744Built-in objects
26745----------------
26746
26747* File objects have acquired a new method writelines() which is the
26748reverse of readlines(). (It does not actually write lines, just a
26749list of strings, but the symmetry makes the choice of name OK.)
26750
26751
26752Built-in modules
26753----------------
26754
26755* Socket objects no longer support the avail() method. Use the select
26756module instead, or use this function to replace it:
26757
26758 def avail(f):
26759 import select
26760 return f in select.select([f], [], [], 0)[0]
26761
26762* Initialization of stdwin is done differently. It actually modifies
26763sys.argv (taking out the options the X version of stdwin recognizes)
26764the first time it is imported.
26765
26766* A new built-in module parser provides a rudimentary interface to the
26767python parser. Corresponding standard library modules token and symbol
26768defines the numeric values of tokens and non-terminal symbols.
26769
26770* The posix module has aquired new functions setuid(), setgid(),
26771execve(), and exec() has been renamed to execv().
26772
26773* The array module is extended with 8-byte object swaps, the 'i'
26774format character, and a reverse() method. The read() and write()
26775methods are renamed to fromfile() and tofile().
26776
26777* The rotor module has freed of portability bugs. This introduces a
26778backward compatibility problem: strings encoded with the old rotor
26779module can't be decoded by the new version.
26780
26781* For select.select(), a timeout (4th) argument of None means the same
26782as leaving the timeout argument out.
26783
26784* Module strop (and hence standard library module string) has aquired
26785a new function: rindex(). Thanks to Amrit Prem!
26786
26787* Module regex defines a new function symcomp() which uses an extended
26788regular expression syntax: parenthesized subexpressions may be labeled
26789using the form "\(<labelname>...\)", and the group() method can return
26790sub-expressions by name. Thanks to Tracy Tims for these changes!
26791
26792* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
26793Mullender!
26794
26795
26796Standard library modules
26797------------------------
26798
26799* The library is now split in several subdirectories: all stuff using
26800stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
26801is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
26802test modules are in Lib/test. The default module search path will
26803include all relevant subdirectories by default.
26804
26805* Module os now knows about trying to import dos. It defines
26806functions execl(), execle(), execlp() and execvp().
26807
26808* New module dospath (should be attacked by a DOS hacker though).
26809
26810* All modules defining classes now define __init__() constructors
26811instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
26812
26813* Some minor changes and bugfixes module ftplib (mostly Steve
26814Majewski's suggestions); the debug() method is renamed to
26815set_debuglevel().
26816
26817* Some new test modules (not run automatically by testall though):
26818test_audioop, test_md5, test_rgbimg, test_select.
26819
26820* Module string now defines rindex() and rfind() in analogy of index()
26821and find(). It also defines atof() and atol() (and corresponding
26822exceptions) in analogy to atoi().
26823
26824* Added help() functions to modules profile and pdb.
26825
26826* The wdb debugger (now in Lib/stdwin) now shows class or instance
26827variables on a double click. Thanks to Sjoerd Mullender!
26828
26829* The (undocumented) module lambda has gone -- you couldn't import it
26830any more, and it was basically more a demo than a library module...
26831
26832
26833Multimedia extensions
26834---------------------
26835
26836* The optional built-in modules audioop and imageop are now standard
26837parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
26838for contributing this code!
26839
26840* There's a new operation in audioop: minmax().
26841
26842* There's a new built-in module called rgbimg which supports portable
26843efficient reading of SGI RCG image files. Thanks also to Paul
26844Haeberli for the original code! (Who will contribute a GIF reader?)
26845
26846* The module aifc is gone -- you should now always use aifc, which has
26847received a facelift.
26848
26849* There's a new module sunau., for reading Sun (and NeXT) audio files.
26850
26851* There's a new module audiodev which provides a uniform interface to
26852(SGI Indigo and Sun Sparc) audio hardware.
26853
26854* There's a new module sndhdr which recognizes various sound files by
26855looking in their header and checking for various magic words.
26856
26857
26858Optimizations
26859-------------
26860
26861* Most optimizations below can be configured by compile-time flags.
26862Thanks to Sjoerd Mullender for submitting these optimizations!
26863
26864* Small integers (default -1..99) are shared -- i.e. if two different
26865functions compute the same value it is possible (but not
26866guaranteed!!!) that they return the same *object*. Python programs
26867can detect this but should *never* rely on it.
26868
26869* Empty tuples (which all compare equal) are shared in the same
26870manner.
26871
26872* Tuples of size up to 20 (default) are put in separate free lists
26873when deallocated.
26874
26875* There is a compile-time option to cache a string's hash function,
26876but this appeared to have a negligeable effect, and as it costs 4
26877bytes per string it is disabled by default.
26878
26879
26880Embedding Python
26881----------------
26882
26883* The initialization interface has been simplified somewhat. You now
26884only call "initall()" to initialize the interpreter.
26885
26886* The previously announced renaming of externally visible identifiers
26887has not been carried out. It will happen in a later release. Sorry.
26888
26889
26890Miscellaneous bugs that have been fixed
26891---------------------------------------
26892
26893* All known portability bugs.
26894
26895* Version 0.9.9 dumped core in <listobject>.sort() which has been
26896fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
26897on the mailing list while I was away!
26898
26899* Core dump on a format string ending in '%', e.g. in the expression
26900'%' % None.
26901
26902* The array module yielded a bogus result for concatenation (a+b would
26903yield a+a).
26904
26905* Some serious memory leaks in strop.split() and strop.splitfields().
26906
26907* Several problems with the nis module.
26908
26909* Subtle problem when copying a class method from another class
26910through assignment (the method could not be called).
26911
26912
26913Remaining bugs
26914--------------
26915
26916* One problem with 64-bit machines remains -- since .pyc files are
26917portable and use only 4 bytes to represent an integer object, 64-bit
26918integer literals are silently truncated when written into a .pyc file.
26919Work-around: use eval('123456789101112').
26920
26921* The freeze script doesn't work any more. A new and more portable
26922one can probably be cooked up using tricks from Extensions/mkext.py.
26923
26924* The dos support hasn't been tested yet. (Really Soon Now we should
26925have a PC with a working C compiler!)
26926
26927
Guido van Rossuma7925f11994-01-26 10:20:16 +000026928===================================
26929==> Release 0.9.9 (29 Jul 1993) <==
26930===================================
26931
26932I *believe* these are the main user-visible changes in this release,
26933but there may be others. SGI users may scan the {src,lib}/ChangeLog
26934files for improvements of some SGI specific modules, e.g. aifc and
26935cl. Developers of extension modules should also read src/ChangeLog.
26936
26937
26938Naming of C symbols used by the Python interpreter
26939--------------------------------------------------
26940
26941* This is the last release using the current naming conventions. New
26942naming conventions are explained in the file misc/NAMING.
26943Summarizing, all externally visible symbols get (at least) a "Py"
26944prefix, and most functions are renamed to the standard form
26945PyModule_FunctionName.
26946
26947* Writers of extensions are urged to start using the new naming
26948conventions. The next release will use the new naming conventions
26949throughout (it will also have a different source directory
26950structure).
26951
26952* As a result of the preliminary work for the great renaming, many
26953functions that were accidentally global have been made static.
26954
26955
26956BETA X11 support
26957----------------
26958
26959* There are now modules interfacing to the X11 Toolkit Intrinsics, the
26960Athena widgets, and the Motif 1.1 widget set. These are not yet
26961documented except through the examples and README file in the demo/x11
26962directory. It is expected that this interface will be replaced by a
26963more powerful and correct one in the future, which may or may not be
26964backward compatible. In other words, this part of the code is at most
26965BETA level software! (Note: the rest of Python is rock solid as ever!)
26966
26967* I understand that the above may be a bit of a disappointment,
26968however my current schedule does not allow me to change this situation
26969before putting the release out of the door. By releasing it
26970undocumented and buggy, at least some of the (working!) demo programs,
26971like itr (my Internet Talk Radio browser) become available to a larger
26972audience.
26973
26974* There are also modules interfacing to SGI's "Glx" widget (a GL
26975window wrapped in a widget) and to NCSA's "HTML" widget (which can
26976format HyperText Markup Language, the document format used by the
26977World Wide Web).
26978
26979* I've experienced some problems when building the X11 support. In
26980particular, the Xm and Xaw widget sets don't go together, and it
26981appears that using X11R5 is better than using X11R4. Also the threads
26982module and its link time options may spoil things. My own strategy is
26983to build two Python binaries: one for use with X11 and one without
26984it, which can contain a richer set of built-in modules. Don't even
26985*think* of loading the X11 modules dynamically...
26986
26987
26988Environmental changes
26989---------------------
26990
26991* Compiled files (*.pyc files) created by this Python version are
26992incompatible with those created by the previous version. Both
26993versions detect this and silently create a correct version, but it
26994means that it is not a good idea to use the same library directory for
26995an old and a new interpreter, since they will start to "fight" over
26996the *.pyc files...
26997
26998* When a stack trace is printed, the exception is printed last instead
26999of first. This means that if the beginning of the stack trace
27000scrolled out of your window you can still see what exception caused
27001it.
27002
27003* Sometimes interrupting a Python operation does not work because it
27004hangs in a blocking system call. You can now kill the interpreter by
27005interrupting it three times. The second time you interrupt it, a
27006message will be printed telling you that the third interrupt will kill
27007the interpreter. The "sys.exitfunc" feature still makes limited
27008clean-up possible in this case.
27009
27010
27011Changes to the command line interface
27012-------------------------------------
27013
27014* The python usage message is now much more informative.
27015
27016* New option -i enters interactive mode after executing a script --
27017useful for debugging.
27018
27019* New option -k raises an exception when an expression statement
27020yields a value other than None.
27021
27022* For each option there is now also a corresponding environment
27023variable.
27024
27025
27026Using Python as an embedded language
27027------------------------------------
27028
27029* The distribution now contains (some) documentation on the use of
27030Python as an "embedded language" in other applications, as well as a
27031simple example. See the file misc/EMBEDDING and the directory embed/.
27032
27033
27034Speed improvements
27035------------------
27036
27037* Function local variables are now generally stored in an array and
27038accessed using an integer indexing operation, instead of through a
27039dictionary lookup. (This compensates the somewhat slower dictionary
27040lookup caused by the generalization of the dictionary module.)
27041
27042
27043Changes to the syntax
27044---------------------
27045
27046* Continuation lines can now *sometimes* be written without a
27047backslash: if the continuation is contained within nesting (), [] or
27048{} brackets the \ may be omitted. There's a much improved
27049python-mode.el in the misc directory which knows about this as well.
27050
27051* You can no longer use an empty set of parentheses to define a class
27052without base classes. That is, you no longer write this:
27053
27054 class Foo(): # syntax error
27055 ...
27056
27057You must write this instead:
27058
27059 class Foo:
27060 ...
27061
27062This was already the preferred syntax in release 0.9.8 but many
27063people seemed not to have picked it up. There's a Python script that
27064fixes old code: demo/scripts/classfix.py.
27065
27066* There's a new reserved word: "access". The syntax and semantics are
Georg Brandleeb575f2009-06-24 06:42:05 +000027067still subject of research and debate (as well as undocumented), but
Guido van Rossuma7925f11994-01-26 10:20:16 +000027068the parser knows about the keyword so you must not use it as a
27069variable, function, or attribute name.
27070
27071
27072Changes to the semantics of the language proper
27073-----------------------------------------------
27074
27075* The following compatibility hack is removed: if a function was
27076defined with two or more arguments, and called with a single argument
27077that was a tuple with just as many arguments, the items of this tuple
27078would be used as the arguments. This is no longer supported.
27079
27080
27081Changes to the semantics of classes and instances
27082-------------------------------------------------
27083
27084* Class variables are now also accessible as instance variables for
27085reading (assignment creates an instance variable which overrides the
27086class variable of the same name though).
27087
27088* If a class attribute is a user-defined function, a new kind of
27089object is returned: an "unbound method". This contains a pointer to
27090the class and can only be called with a first argument which is a
27091member of that class (or a derived class).
27092
27093* If a class defines a method __init__(self, arg1, ...) then this
27094method is called when a class instance is created by the classname()
27095construct. Arguments passed to classname() are passed to the
27096__init__() method. The __init__() methods of base classes are not
27097automatically called; the derived __init__() method must call these if
27098necessary (this was done so the derived __init__() method can choose
27099the call order and arguments for the base __init__() methods).
27100
27101* If a class defines a method __del__(self) then this method is called
27102when an instance of the class is about to be destroyed. This makes it
27103possible to implement clean-up of external resources attached to the
27104instance. As with __init__(), the __del__() methods of base classes
27105are not automatically called. If __del__ manages to store a reference
27106to the object somewhere, its destruction is postponed; when the object
27107is again about to be destroyed its __del__() method will be called
27108again.
27109
27110* Classes may define a method __hash__(self) to allow their instances
27111to be used as dictionary keys. This must return a 32-bit integer.
27112
27113
27114Minor improvements
27115------------------
27116
27117* Function and class objects now know their name (the name given in
27118the 'def' or 'class' statement that created them).
27119
27120* Class instances now know their class name.
27121
27122
27123Additions to built-in operations
27124--------------------------------
27125
27126* The % operator with a string left argument implements formatting
27127similar to sprintf() in C. The right argument is either a single
27128value or a tuple of values. All features of Standard C sprintf() are
27129supported except %p.
27130
27131* Dictionaries now support almost any key type, instead of just
27132strings. (The key type must be an immutable type or must be a class
27133instance where the class defines a method __hash__(), in order to
27134avoid losing track of keys whose value may change.)
27135
27136* Built-in methods are now compared properly: when comparing x.meth1
27137and y.meth2, if x is equal to y and the methods are defined by the
27138same function, x.meth1 compares equal to y.meth2.
27139
27140
27141Additions to built-in functions
27142-------------------------------
27143
27144* str(x) returns a string version of its argument. If the argument is
27145a string it is returned unchanged, otherwise it returns `x`.
27146
27147* repr(x) returns the same as `x`. (Some users found it easier to
27148have this as a function.)
27149
27150* round(x) returns the floating point number x rounded to an whole
27151number, represented as a floating point number. round(x, n) returns x
27152rounded to n digits.
27153
27154* hasattr(x, name) returns true when x has an attribute with the given
27155name.
27156
27157* hash(x) returns a hash code (32-bit integer) of an arbitrary
27158immutable object's value.
27159
27160* id(x) returns a unique identifier (32-bit integer) of an arbitrary
27161object.
27162
27163* compile() compiles a string to a Python code object.
27164
27165* exec() and eval() now support execution of code objects.
27166
27167
27168Changes to the documented part of the library (standard modules)
27169----------------------------------------------------------------
27170
27171* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
27172the border case '/foo/..' returns '/' instead of ''.
27173
27174* A new function string.find() is added with similar semantics to
27175string.index(); however when it does not find the given substring it
27176returns -1 instead of raising string.index_error.
27177
27178
27179Changes to built-in modules
27180---------------------------
27181
27182* New optional module 'array' implements operations on sequences of
27183integers or floating point numbers of a particular size. This is
27184useful to manipulate large numerical arrays or to read and write
27185binary files consisting of numerical data.
27186
27187* Regular expression objects created by module regex now support a new
27188method named group(), which returns one or more \(...\) groups by number.
27189The number of groups is increased from 10 to 100.
27190
27191* Function compile() in module regex now supports an optional mapping
27192argument; a variable casefold is added to the module which can be used
27193as a standard uppercase to lowercase mapping.
27194
27195* Module time now supports many routines that are defined in the
27196Standard C time interface (<time.h>): gmtime(), localtime(),
27197asctime(), ctime(), mktime(), as well as these variables (taken from
27198System V): timezone, altzone, daylight and tzname. (The corresponding
27199functions in the undocumented module calendar have been removed; the
27200undocumented and unfinished module tzparse is now obsolete and will
27201disappear in a future release.)
27202
27203* Module strop (the fast built-in version of standard module string)
27204now uses C's definition of whitespace instead of fixing it to space,
27205tab and newline; in practice this usually means that vertical tab,
27206form feed and return are now also considered whitespace. It exports
27207the string of characters that are considered whitespace as well as the
27208characters that are considered lowercase or uppercase.
27209
27210* Module sys now defines the variable builtin_module_names, a list of
27211names of modules built into the current interpreter (including not
27212yet imported, but excluding two special modules that always have to be
27213defined -- sys and builtin).
27214
27215* Objects created by module sunaudiodev now also support flush() and
27216close() methods.
27217
27218* Socket objects created by module socket now support an optional
27219flags argument for their methods sendto() and recvfrom().
27220
27221* Module marshal now supports dumping to and loading from strings,
27222through the functions dumps() and loads().
27223
27224* Module stdwin now supports some new functionality. You may have to
27225ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
27226
27227
27228Bugs fixed
27229----------
27230
27231* Fixed comparison of negative long integers.
27232
27233* The tokenizer no longer botches input lines longer than BUFSIZ.
27234
27235* Fixed several severe memory leaks in module select.
27236
27237* Fixed memory leaks in modules socket and sv.
27238
27239* Fixed memory leak in divmod() for long integers.
27240
27241* Problems with definition of floatsleep() on Suns fixed.
27242
27243* Many portability bugs fixed (and undoubtedly new ones added :-).
27244
27245
27246Changes to the build procedure
27247------------------------------
27248
27249* The Makefile supports some new targets: "make default" and "make
27250all". Both are by normally equivalent to "make python".
27251
27252* The Makefile no longer uses $> since it's not supported by all
27253versions of Make.
27254
27255* The header files now all contain #ifdef constructs designed to make
27256it safe to include the same header file twice, as well as support for
27257inclusion from C++ programs (automatic extern "C" { ... } added).
27258
27259
27260Freezing Python scripts
27261-----------------------
27262
27263* There is now some support for "freezing" a Python script as a
27264stand-alone executable binary file. See the script
27265demo/scripts/freeze.py. It will require some site-specific tailoring
27266of the script to get this working, but is quite worthwhile if you write
27267Python code for other who may not have built and installed Python.
27268
27269
27270MS-DOS
27271------
27272
27273* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
27274Marcel van der Peijl! This requires fewer compatibility hacks in
27275posixmodule.c. The executable is not yet available but will be soon
27276(check the mailing list).
27277
27278* The default PYTHONPATH has changed.
27279
27280
27281Changes for developers of extension modules
27282-------------------------------------------
27283
27284* Read src/ChangeLog for full details.
27285
27286
27287SGI specific changes
27288--------------------
27289
27290* Read src/ChangeLog for full details.
27291
Guido van Rossumaa253861994-10-06 17:18:57 +000027292
Guido van Rossuma7925f11994-01-26 10:20:16 +000027293==================================
27294==> Release 0.9.8 (9 Jan 1993) <==
27295==================================
27296
27297I claim no completeness here, but I've tried my best to scan the log
27298files throughout my source tree for interesting bits of news. A more
27299complete account of the changes is to be found in the various
27300ChangeLog files. See also "News for release 0.9.7beta" below if you're
27301still using release 0.9.6, and the file HISTORY if you have an even
27302older release.
27303
27304 --Guido
27305
27306
27307Changes to the language proper
27308------------------------------
27309
27310There's only one big change: the conformance checking for function
27311argument lists (of user-defined functions only) is stricter. Earlier,
27312you could get away with the following:
27313
27314 (a) define a function of one argument and call it with any
27315 number of arguments; if the actual argument count wasn't
27316 one, the function would receive a tuple containing the
Georg Brandleeb575f2009-06-24 06:42:05 +000027317 arguments (an empty tuple if there were none).
Guido van Rossuma7925f11994-01-26 10:20:16 +000027318
27319 (b) define a function of two arguments, and call it with more
27320 than two arguments; if there were more than two arguments,
27321 the second argument would be passed as a tuple containing
27322 the second and further actual arguments.
27323
27324(Note that an argument (formal or actual) that is a tuple is counted as
27325one; these rules don't apply inside such tuples, only at the top level
27326of the argument list.)
27327
27328Case (a) was needed to accommodate variable-length argument lists;
27329there is now an explicit "varargs" feature (precede the last argument
27330with a '*'). Case (b) was needed for compatibility with old class
27331definitions: up to release 0.9.4 a method with more than one argument
27332had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
27333Version 0.9.6 provide better ways to handle both casees, bot provided
27334backward compatibility; version 0.9.8 retracts the compatibility hacks
27335since they also cause confusing behavior if a function is called with
27336the wrong number of arguments.
27337
27338There's a script that helps converting classes that still rely on (b),
27339provided their methods' first argument is called "self":
27340demo/scripts/methfix.py.
27341
27342If this change breaks lots of code you have developed locally, try
27343#defining COMPAT_HACKS in ceval.c.
27344
27345(There's a third compatibility hack, which is the reverse of (a): if a
27346function is defined with two or more arguments, and called with a
27347single argument that is a tuple with just as many arguments, the items
27348of this tuple will be used as the arguments. Although this can (and
27349should!) be done using the built-in function apply() instead, it isn't
27350withdrawn yet.)
27351
27352
27353One minor change: comparing instance methods works like expected, so
27354that if x is an instance of a user-defined class and has a method m,
27355then (x.m==x.m) yields 1.
27356
27357
27358The following was already present in 0.9.7beta, but not explicitly
27359mentioned in the NEWS file: user-defined classes can now define types
27360that behave in almost allrespects like numbers. See
27361demo/classes/Rat.py for a simple example.
27362
27363
27364Changes to the build process
27365----------------------------
27366
27367The Configure.py script and the Makefile has been made somewhat more
27368bullet-proof, after reports of (minor) trouble on certain platforms.
27369
27370There is now a script to patch Makefile and config.c to add a new
27371optional built-in module: Addmodule.sh. Read the script before using!
27372
27373Useing Addmodule.sh, all optional modules can now be configured at
27374compile time using Configure.py, so there are no modules left that
27375require dynamic loading.
27376
27377The Makefile has been fixed to make it easier to use with the VPATH
27378feature of some Make versions (e.g. SunOS).
27379
27380
27381Changes affecting portability
27382-----------------------------
27383
27384Several minor portability problems have been solved, e.g. "malloc.h"
27385has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
27386the system now tolerates malloc(0) returning 0.
27387
27388For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
27389distributed with Python. This solves several minor problems, in
27390particular scripts invoked using #! can now use dynamic loading.
27391
27392
27393Changes to the interpreter interface
27394------------------------------------
27395
27396On popular demand, there's finally a "profile" feature for interactive
27397use of the interpreter. If the environment variable $PYTHONSTARTUP is
27398set to the name of an existing file, Python statements in this file
27399are executed when the interpreter is started in interactive mode.
27400
27401There is a new clean-up mechanism, complementing try...finally: if you
27402assign a function object to sys.exitfunc, it will be called when
27403Python exits or receives a SIGTERM or SIGHUP signal.
27404
27405The interpreter is now generally assumed to live in
27406/usr/local/bin/python (as opposed to /usr/local/python). The script
27407demo/scripts/fixps.py will update old scripts in place (you can easily
27408modify it to do other similar changes).
27409
27410Most I/O that uses sys.stdin/stdout/stderr will now use any object
27411assigned to those names as long as the object supports readline() or
27412write() methods.
27413
27414The parser stack has been increased to 500 to accommodate more
27415complicated expressions (7 levels used to be the practical maximum,
27416it's now about 38).
27417
27418The limit on the size of the *run-time* stack has completely been
27419removed -- this means that tuple or list displays can contain any
27420number of elements (formerly more than 50 would crash the
27421interpreter).
27422
27423
27424Changes to existing built-in functions and methods
27425--------------------------------------------------
27426
27427The built-in functions int(), long(), float(), oct() and hex() now
27428also apply to class instalces that define corresponding methods
27429(__int__ etc.).
27430
27431
27432New built-in functions
27433----------------------
27434
27435The new functions str() and repr() convert any object to a string.
27436The function repr(x) is in all respects equivalent to `x` -- some
27437people prefer a function for this. The function str(x) does the same
27438except if x is already a string -- then it returns x unchanged
27439(repr(x) adds quotes and escapes "funny" characters as octal escapes).
27440
27441The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
27442
27443
27444Changes to general built-in modules
27445-----------------------------------
27446
27447The time module's functions are more general: time() returns a
27448floating point number and sleep() accepts one. Their accuracies
27449depends on the precision of the system clock. Millisleep is no longer
27450needed (although it still exists for now), but millitimer is still
27451needed since on some systems wall clock time is only available with
27452seconds precision, while a source of more precise time exists that
27453isn't synchronized with the wall clock. (On UNIX systems that support
27454the BSD gettimeofday() function, time.time() is as time.millitimer().)
27455
27456The string representation of a file object now includes an address:
27457'<file 'filename', mode 'r' at #######>' where ###### is a hex number
27458(the object's address) to make it unique.
27459
27460New functions added to posix: nice(), setpgrp(), and if your system
27461supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
27462
27463Improvements to the socket module: socket objects have new methods
27464getpeername() and getsockname(), and the {get,set}sockopt methods can
27465now get/set any kind of option using strings built with the new struct
27466module. And there's a new function fromfd() which creates a socket
27467object given a file descriptor (useful for servers started by inetd,
27468which have a socket connected to stdin and stdout).
27469
27470
27471Changes to SGI-specific built-in modules
27472----------------------------------------
27473
27474The FORMS library interface (fl) now requires FORMS 2.1a. Some new
27475functions have been added and some bugs have been fixed.
27476
27477Additions to al (audio library interface): added getname(),
27478getdefault() and getminmax().
27479
27480The gl modules doesn't call "foreground()" when initialized (this
27481caused some problems) like it dit in 0.9.7beta (but not before).
27482There's a new gl function 'gversion() which returns a version string.
27483
27484The interface to sv (Indigo video interface) has totally changed.
27485(Sorry, still no documentation, but see the examples in
27486demo/sgi/{sv,video}.)
27487
27488
27489Changes to standard library modules
27490-----------------------------------
27491
27492Most functions in module string are now much faster: they're actually
27493implemented in C. The module containing the C versions is called
27494"strop" but you should still import "string" since strop doesn't
27495provide all the interfaces defined in string (and strop may be renamed
27496to string when it is complete in a future release).
27497
27498string.index() now accepts an optional third argument giving an index
27499where to start searching in the first argument, so you can find second
27500and further occurrences (this is similar to the regular expression
27501functions in regex).
27502
27503The definition of what string.splitfields(anything, '') should return
27504is changed for the last time: it returns a singleton list containing
27505its whole first argument unchanged. This is compatible with
27506regsub.split() which also ignores empty delimiter matches.
27507
27508posixpath, macpath: added dirname() and normpath() (and basename() to
27509macpath).
27510
27511The mainloop module (for use with stdwin) can now demultiplex input
27512from other sources, as long as they can be polled with select().
27513
27514
27515New built-in modules
27516--------------------
27517
27518Module struct defines functions to pack/unpack values to/from strings
27519representing binary values in native byte order.
27520
27521Module strop implements C versions of many functions from string (see
27522above).
27523
27524Optional module fcntl defines interfaces to fcntl() and ioctl() --
27525UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
27526
27527Optional module mpz defines an interface to an altaernative long
27528integer implementation, the GNU MPZ library.
27529
27530Optional module md5 uses the GNU MPZ library to calculate MD5
27531signatures of strings.
27532
27533There are also optional new modules specific to SGI machines: imageop
27534defines some simple operations to images represented as strings; sv
27535interfaces to the Indigo video board; cl interfaces to the (yet
27536unreleased) compression library.
27537
27538
27539New standard library modules
27540----------------------------
27541
27542(Unfortunately the following modules are not all documented; read the
27543sources to find out more about them!)
27544
27545autotest: run testall without showing any output unless it differs
27546from the expected output
27547
27548bisect: use bisection to insert or find an item in a sorted list
27549
27550colorsys: defines conversions between various color systems (e.g. RGB
27551<-> YUV)
27552
27553nntplib: a client interface to NNTP servers
27554
27555pipes: utility to construct pipeline from templates, e.g. for
27556conversion from one file format to another using several utilities.
27557
27558regsub: contains three functions that are more or less compatible with
27559awk functions of the same name: sub() and gsub() do string
27560substitution, split() splits a string using a regular expression to
27561define how separators are define.
27562
27563test_types: test operations on the built-in types of Python
27564
27565toaiff: convert various audio file formats to AIFF format
27566
27567tzparse: parse the TZ environment parameter (this may be less general
27568than it could be, let me know if you fix it).
27569
27570(Note that the obsolete module "path" no longer exists.)
27571
27572
27573New SGI-specific library modules
27574--------------------------------
27575
27576CL: constants for use with the built-in compression library interface (cl)
27577
27578Queue: a multi-producer, multi-consumer queue class implemented for
27579use with the built-in thread module
27580
27581SOCKET: constants for use with built-in module socket, e.g. to set/get
27582socket options. This is SGI-specific because the constants to be
27583passed are system-dependent. You can generate a version for your own
27584system by running the script demo/scripts/h2py.py with
27585/usr/include/sys/socket.h as input.
27586
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000027587cddb: interface to the database used by the CD player
Guido van Rossuma7925f11994-01-26 10:20:16 +000027588
27589torgb: convert various image file types to rgb format (requires pbmplus)
27590
27591
27592New demos
27593---------
27594
27595There's an experimental interface to define Sun RPC clients and
27596servers in demo/rpc.
27597
27598There's a collection of interfaces to WWW, WAIS and Gopher (both
27599Python classes and program providing a user interface) in demo/www.
27600This includes a program texi2html.py which converts texinfo files to
27601HTML files (the format used hy WWW).
27602
27603The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
27604
27605For SGI systems, there's a whole collection of programs and classes
27606that make use of the Indigo video board in demo/sgi/{sv,video}. This
27607represents a significant amount of work that we're giving away!
27608
27609There are demos "rsa" and "md5test" that exercise the mpz and md5
27610modules, respectively. The rsa demo is a complete implementation of
27611the RSA public-key cryptosystem!
27612
27613A bunch of games and examples submitted by Stoffel Erasmus have been
27614included in demo/stoffel.
27615
27616There are miscellaneous new files in some existing demo
27617subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
27618sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
27619
27620There are also many minor changes to existing files, but I'm too lazy
27621to run a diff and note the differences -- you can do this yourself if
27622you save the old distribution's demos. One highlight: the
27623stdwin/python.py demo is much improved!
27624
27625
27626Changes to the documentation
27627----------------------------
27628
27629The LaTeX source for the library uses different macros to enable it to
27630be converted to texinfo, and from there to INFO or HTML format so it
27631can be browsed as a hypertext. The net result is that you can now
27632read the Python library documentation in Emacs info mode!
27633
27634
27635Changes to the source code that affect C extension writers
27636----------------------------------------------------------
27637
27638The function strdup() no longer exists (it was used only in one places
Georg Brandleeb575f2009-06-24 06:42:05 +000027639and is somewhat of a portability problem since some systems have the
Guido van Rossuma7925f11994-01-26 10:20:16 +000027640same function in their C library.
27641
27642The functions NEW() and RENEW() allocate one spare byte to guard
27643against a NULL return from malloc(0) being taken for an error, but
27644this should not be relied upon.
27645
27646
27647=========================
27648==> Release 0.9.7beta <==
27649=========================
27650
27651
27652Changes to the language proper
27653------------------------------
27654
27655User-defined classes can now implement operations invoked through
27656special syntax, such as x[i] or `x` by defining methods named
27657__getitem__(self, i) or __repr__(self), etc.
27658
27659
27660Changes to the build process
27661----------------------------
27662
27663Instead of extensive manual editing of the Makefile to select
27664compile-time options, you can now run a Configure.py script.
27665The Makefile as distributed builds a minimal interpreter sufficient to
27666run Configure.py. See also misc/BUILD
27667
27668The Makefile now includes more "utility" targets, e.g. install and
27669tags/TAGS
27670
27671Using the provided strtod.c and strtol.c are now separate options, as
27672on the Sun the provided strtod.c dumps core :-(
27673
27674The regex module is now an option chosen by the Makefile, since some
27675(old) C compilers choke on regexpr.c
27676
27677
27678Changes affecting portability
27679-----------------------------
27680
27681You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
27682interface
27683
27684Dynamic loading is now supported for Sun (and other non-COFF systems)
27685throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
27686DL is out, 1.4)
27687
27688The system-dependent code for the use of the select() system call is
27689moved to one file: myselect.h
27690
27691Thanks to Jaap Vermeulen, the code should now port cleanly to the
27692SEQUENT
27693
27694
27695Changes to the interpreter interface
27696------------------------------------
27697
27698The interpretation of $PYTHONPATH in the environment is different: it
27699is inserted in front of the default path instead of overriding it
27700
27701
27702Changes to existing built-in functions and methods
27703--------------------------------------------------
27704
27705List objects now support an optional argument to their sort() method,
27706which is a comparison function similar to qsort(3) in C
27707
27708File objects now have a method fileno(), used by the new select module
27709(see below)
27710
27711
27712New built-in function
27713---------------------
27714
27715coerce(x, y): take two numbers and return a tuple containing them
27716both converted to a common type
27717
27718
27719Changes to built-in modules
27720---------------------------
27721
27722sys: fixed core dumps in settrace() and setprofile()
27723
27724socket: added socket methods setsockopt() and getsockopt(); and
27725fileno(), used by the new select module (see below)
27726
27727stdwin: added fileno() == connectionnumber(), in support of new module
27728select (see below)
27729
27730posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
27731
27732gl: added qgetfd()
27733
27734fl: added several new functions, fixed several obscure bugs, adapted
27735to FORMS 2.1
27736
27737
27738Changes to standard modules
27739---------------------------
27740
27741posixpath: changed implementation of ismount()
27742
27743string: atoi() no longer mistakes leading zero for octal number
27744
27745...
27746
27747
27748New built-in modules
27749--------------------
27750
27751Modules marked "dynamic only" are not configured at compile time but
27752can be loaded dynamically. You need to turn on the DL or DLD option in
27753the Makefile for support dynamic loading of modules (this requires
27754external code).
27755
27756select: interfaces to the BSD select() system call
27757
27758dbm: interfaces to the (new) dbm library (dynamic only)
27759
27760nis: interfaces to some NIS functions (aka yellow pages)
27761
27762thread: limited form of multiple threads (sgi only)
27763
27764audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
27765coding (dynamic only)
27766
27767cd: interface to Indigo SCSI CDROM player audio library (sgi only)
27768
27769jpeg: read files in JPEG format (dynamic only, sgi only; needs
27770external code)
27771
27772imgfile: read SGI image files (dynamic only, sgi only)
27773
27774sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
27775
27776sv: interface to Indigo video library (sgi only)
27777
27778pc: a minimal set of MS-DOS interfaces (MS-DOS only)
27779
27780rotor: encryption, by Lance Ellinghouse (dynamic only)
27781
27782
27783New standard modules
27784--------------------
27785
27786Not all these modules are documented. Read the source:
27787lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
27788additional documentation.
27789
27790imghdr: recognizes image file headers
27791
27792sndhdr: recognizes sound file headers
27793
27794profile: print run-time statistics of Python code
27795
27796readcd, cdplayer: companion modules for built-in module cd (sgi only)
27797
27798emacs: interface to Emacs using py-connect.el (see below).
27799
27800SOCKET: symbolic constant definitions for socket options
27801
27802SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
27803
27804SV: symbolic constat definitions for sv (sgi only)
27805
27806CD: symbolic constat definitions for cd (sgi only)
27807
27808
27809New demos
27810---------
27811
27812scripts/pp.py: execute Python as a filter with a Perl-like command
27813line interface
27814
27815classes/: examples using the new class features
27816
27817threads/: examples using the new thread module
27818
27819sgi/cd/: examples using the new cd module
27820
27821
27822Changes to the documentation
27823----------------------------
27824
27825The last-minute syntax changes of release 0.9.6 are now reflected
27826everywhere in the manuals
27827
27828The reference manual has a new section (3.2) on implementing new kinds
27829of numbers, sequences or mappings with user classes
27830
27831Classes are now treated extensively in the tutorial (chapter 9)
27832
27833Slightly restructured the system-dependent chapters of the library
27834manual
27835
27836The file misc/EXTENDING incorporates documentation for mkvalue() and
27837a new section on error handling
27838
27839The files misc/CLASSES and misc/ERRORS are no longer necessary
27840
27841The doc/Makefile now creates PostScript files automatically
27842
27843
27844Miscellaneous changes
27845---------------------
27846
27847Incorporated Tim Peters' changes to python-mode.el, it's now version
278481.06
27849
27850A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
27851program running in an Emacs buffer execute Emacs lisp code. The
27852necessary Python code is in lib/emacs.py. The Emacs code is
27853misc/py-connect.el (it needs some external Emacs lisp code)
27854
27855
27856Changes to the source code that affect C extension writers
27857----------------------------------------------------------
27858
27859New service function mkvalue() to construct a Python object from C
27860values according to a "format" string a la getargs()
27861
27862Most functions from pythonmain.c moved to new pythonrun.c which is
27863in libpython.a. This should make embedded versions of Python easier
27864
27865ceval.h is split in eval.h (which needs compile.h and only declares
27866eval_code) and ceval.h (which doesn't need compile.hand declares the
27867rest)
27868
27869ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
27870improve the parallellism of multi-threaded programs by letting other
27871Python code run when a blocking system call or something similar is
27872made)
27873
27874In structmember.[ch], new member types BYTE, CHAR and unsigned
27875variants have been added
27876
27877New file xxmodule.c is a template for new extension modules.
27878
Guido van Rossumaa253861994-10-06 17:18:57 +000027879
Guido van Rossuma7925f11994-01-26 10:20:16 +000027880==================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027881==> Release 0.9.6 (6 Apr 1992) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027882==================================
27883
27884Misc news in 0.9.6:
27885- Restructured the misc subdirectory
27886- Reference manual completed, library manual much extended (with indexes!)
27887- the GNU Readline library is now distributed standard with Python
27888- the script "../demo/scripts/classfix.py" fixes Python modules using old
27889 class syntax
27890- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
27891- Because of the GNU copyleft business I am not using the GNU regular
27892 expression implementation but a free re-implementation by Tatu Ylonen
27893 that recently appeared in comp.sources.misc (Bravo, Tatu!)
27894
27895New features in 0.9.6:
27896- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
27897- New module 'os' supplants modules 'mac' and 'posix' for most cases;
27898 module 'path' is replaced by 'os.path'
27899- os.path.split() return value differs from that of old path.split()
27900- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
27901 currently being handled
27902- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
27903 exception
27904- New function string.expandtabs() expands tabs in a string
27905- Added times() interface to posix (user & sys time of process & children)
27906- Added uname() interface to posix (returns OS type, hostname, etc.)
27907- New built-in function execfile() is like exec() but from a file
27908- Functions exec() and eval() are less picky about whitespace/newlines
27909- New built-in functions getattr() and setattr() access arbitrary attributes
27910- More generic argument handling in built-in functions (see "./EXTENDING")
27911- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
27912- Division and modulo for long and plain integers with negative operands
27913 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
27914 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
27915 (a/b, a%b) for integers. For floats, % is also changed, but of course
27916 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
27917- A function with explicit variable-length argument list can be declared
27918 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
27919- Code tracing and profiling features have been added, and two source
27920 code debuggers are provided in the library (pdb.py, tty-oriented,
27921 and wdb, window-oriented); you can now step through Python programs!
27922 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
27923- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
27924 a script that fixes old Python modules
27925- Plain integer right shift now uses sign extension
27926- Long integer shift/mask operations now simulate 2's complement
27927 to give more useful results for negative operands
27928- Changed/added range checks for long/plain integer shifts
27929- Options found after "-c command" are now passed to the command in sys.argv
27930 (note subtle incompatiblity with "python -c command -- -options"!)
27931- Module stdwin is better protected against touching objects after they've
27932 been closed; menus can now also be closed explicitly
27933- Stdwin now uses its own exception (stdwin.error)
27934
27935New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
27936- dictionary objects can now be compared properly; e.g., {}=={} is true
27937- new exception SystemExit causes termination if not caught;
27938 it is raised by sys.exit() so that 'finally' clauses can clean up,
27939 and it may even be caught. It does work interactively!
27940- new module "regex" implements GNU Emacs style regular expressions;
27941 module "regexp" is rewritten in Python for backward compatibility
27942- formal parameter lists may contain trailing commas
27943
27944Bugs fixed in 0.9.6:
27945- assigning to or deleting a list item with a negative index dumped core
27946- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
27947
27948Bugs fixed in 0.9.5:
27949- masking operations involving negative long integers gave wrong results
27950
27951
27952===================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027953==> Release 0.9.4 (24 Dec 1991) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027954===================================
27955
27956- new function argument handling (see below)
27957- built-in apply(func, args) means func(args[0], args[1], ...)
27958- new, more refined exceptions
27959- new exception string values (NameError = 'NameError' etc.)
27960- better checking for math exceptions
27961- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
27962- fixed list assignment bug: "a[1:1] = a" now works correctly
27963- new class syntax, without extraneous parentheses
27964- new 'global' statement to assign global variables from within a function
27965
27966
27967New class syntax
27968----------------
27969
27970You can now declare a base class as follows:
27971
27972 class B: # Was: class B():
27973 def some_method(self): ...
27974 ...
27975
27976and a derived class thusly:
27977
27978 class D(B): # Was: class D() = B():
27979 def another_method(self, arg): ...
27980
27981Multiple inheritance looks like this:
27982
27983 class M(B, D): # Was: class M() = B(), D():
27984 def this_or_that_method(self, arg): ...
27985
27986The old syntax is still accepted by Python 0.9.4, but will disappear
27987in Python 1.0 (to be posted to comp.sources).
27988
27989
27990New 'global' statement
27991----------------------
27992
27993Every now and then you have a global variable in a module that you
27994want to change from within a function in that module -- say, a count
27995of calls to a function, or an option flag, etc. Until now this was
27996not directly possible. While several kludges are known that
27997circumvent the problem, and often the need for a global variable can
27998be avoided by rewriting the module as a class, this does not always
27999lead to clearer code.
28000
28001The 'global' statement solves this dilemma. Its occurrence in a
28002function body means that, for the duration of that function, the
28003names listed there refer to global variables. For instance:
28004
28005 total = 0.0
28006 count = 0
28007
28008 def add_to_total(amount):
28009 global total, count
28010 total = total + amount
28011 count = count + 1
28012
28013'global' must be repeated in each function where it is needed. The
28014names listed in a 'global' statement must not be used in the function
28015before the statement is reached.
28016
28017Remember that you don't need to use 'global' if you only want to *use*
28018a global variable in a function; nor do you need ot for assignments to
28019parts of global variables (e.g., list or dictionary items or
28020attributes of class instances). This has not changed; in fact
28021assignment to part of a global variable was the standard workaround.
28022
28023
28024New exceptions
28025--------------
28026
28027Several new exceptions have been defined, to distinguish more clearly
28028between different types of errors.
28029
28030name meaning was
28031
28032AttributeError reference to non-existing attribute NameError
28033IOError unexpected I/O error RuntimeError
28034ImportError import of non-existing module or name NameError
28035IndexError invalid string, tuple or list index RuntimeError
28036KeyError key not in dictionary RuntimeError
28037OverflowError numeric overflow RuntimeError
28038SyntaxError invalid syntax RuntimeError
28039ValueError invalid argument value RuntimeError
28040ZeroDivisionError division by zero RuntimeError
28041
28042The string value of each exception is now its name -- this makes it
28043easier to experimentally find out which operations raise which
28044exceptions; e.g.:
28045
28046 >>> KeyboardInterrupt
28047 'KeyboardInterrupt'
28048 >>>
28049
28050
28051New argument passing semantics
28052------------------------------
28053
28054Off-line discussions with Steve Majewski and Daniel LaLiberte have
28055convinced me that Python's parameter mechanism could be changed in a
28056way that made both of them happy (I hope), kept me happy, fixed a
28057number of outstanding problems, and, given some backward compatibility
28058provisions, would only break a very small amount of existing code --
28059probably all mine anyway. In fact I suspect that most Python users
28060will hardly notice the difference. And yet it has cost me at least
28061one sleepless night to decide to make the change...
28062
28063Philosophically, the change is quite radical (to me, anyway): a
28064function is no longer called with either zero or one argument, which
28065is a tuple if there appear to be more arguments. Every function now
28066has an argument list containing 0, 1 or more arguments. This list is
28067always implemented as a tuple, and it is a (run-time) error if a
28068function is called with a different number of arguments than expected.
28069
28070What's the difference? you may ask. The answer is, very little unless
28071you want to write variadic functions -- functions that may be called
28072with a variable number of arguments. Formerly, you could write a
28073function that accepted one or more arguments with little trouble, but
28074writing a function that could be called with either 0 or 1 argument
28075(or more) was next to impossible. This is now a piece of cake: you
28076can simply declare an argument that receives the entire argument
28077tuple, and check its length -- it will be of size 0 if there are no
28078arguments.
28079
28080Another anomaly of the old system was the way multi-argument methods
28081(in classes) had to be declared, e.g.:
28082
28083 class Point():
28084 def init(self, (x, y, color)): ...
28085 def setcolor(self, color): ...
28086 dev moveto(self, (x, y)): ...
28087 def draw(self): ...
28088
28089Using the new scheme there is no need to enclose the method arguments
28090in an extra set of parentheses, so the above class could become:
28091
28092 class Point:
28093 def init(self, x, y, color): ...
28094 def setcolor(self, color): ...
28095 dev moveto(self, x, y): ...
28096 def draw(self): ...
28097
28098That is, the equivalence rule between methods and functions has
28099changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
28100while formerly it was equivalent to Point.moveto(p,(x,y)).
28101
28102A special backward compatibility rule makes that the old version also
28103still works: whenever a function with exactly two arguments (at the top
28104level) is called with more than two arguments, the second and further
28105arguments are packed into a tuple and passed as the second argument.
28106This rule is invoked independently of whether the function is actually a
28107method, so there is a slight chance that some erroneous calls of
28108functions expecting two arguments with more than that number of
28109arguments go undetected at first -- when the function tries to use the
28110second argument it may find it is a tuple instead of what was expected.
28111Note that this rule will be removed from future versions of the
28112language; it is a backward compatibility provision *only*.
28113
28114Two other rules and a new built-in function handle conversion between
28115tuples and argument lists:
28116
28117Rule (a): when a function with more than one argument is called with a
28118single argument that is a tuple of the right size, the tuple's items
28119are used as arguments.
28120
28121Rule (b): when a function with exactly one argument receives no
28122arguments or more than one, that one argument will receive a tuple
28123containing the arguments (the tuple will be empty if there were no
28124arguments).
28125
28126
28127A new built-in function, apply(), was added to support functions that
28128need to call other functions with a constructed argument list. The call
28129
28130 apply(function, tuple)
28131
28132is equivalent to
28133
28134 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
28135
28136
28137While no new argument syntax was added in this phase, it would now be
28138quite sensible to add explicit syntax to Python for default argument
28139values (as in C++ or Modula-3), or a "rest" argument to receive the
28140remaining arguments of a variable-length argument list.
28141
28142
28143========================================================
28144==> Release 0.9.3 (never made available outside CWI) <==
28145========================================================
28146
28147- string sys.version shows current version (also printed on interactive entry)
28148- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
28149- 'global' statement to declare module-global variables assigned in functions.
28150- new class declaration syntax: class C(Base1, Base2, ...): suite
28151 (the old syntax is still accepted -- be sure to convert your classes now!)
28152- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
28153- C comparison operators: == != (the old = and <> remain valid).
28154- floating point numbers may now start with a period (e.g., .14).
28155- definition of integer division tightened (always truncates towards zero).
28156- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
28157- new list method l.count(x) returns the number of occurrences of x in l.
28158- new SGI module: al (Indigo and 4D/35 audio library).
28159- the FORMS interface (modules fl and FL) now uses FORMS 2.0
28160- module gl: added lrect{read,write}, rectzoom and pixmode;
28161 added (non-GL) functions (un)packrect.
28162- new socket method: s.allowbroadcast(flag).
28163- many objects support __dict__, __methods__ or __members__.
28164- dir() lists anything that has __dict__.
28165- class attributes are no longer read-only.
28166- classes support __bases__, instances support __class__ (and __dict__).
28167- divmod() now also works for floats.
28168- fixed obscure bug in eval('1 ').
28169
28170
28171===================================
28172==> Release 0.9.2 (Autumn 1991) <==
28173===================================
28174
28175Highlights
28176----------
28177
28178- tutorial now (almost) complete; library reference reorganized
28179- new syntax: continue statement; semicolons; dictionary constructors;
28180 restrictions on blank lines in source files removed
28181- dramatically improved module load time through precompiled modules
28182- arbitrary precision integers: compute 2 to the power 1000 and more...
28183- arithmetic operators now accept mixed type operands, e.g., 3.14/4
28184- more operations on list: remove, index, reverse; repetition
28185- improved/new file operations: readlines, seek, tell, flush, ...
28186- process management added to the posix module: fork/exec/wait/kill etc.
28187- BSD socket operations (with example servers and clients!)
28188- many new STDWIN features (color, fonts, polygons, ...)
28189- new SGI modules: font manager and FORMS library interface
28190
28191
28192Extended list of changes in 0.9.2
28193---------------------------------
28194
28195Here is a summary of the most important user-visible changes in 0.9.2,
28196in somewhat arbitrary order. Changes in later versions are listed in
28197the "highlights" section above.
28198
28199
282001. Changes to the interpreter proper
28201
28202- Simple statements can now be separated by semicolons.
28203 If you write "if t: s1; s2", both s1 and s2 are executed
28204 conditionally.
28205- The 'continue' statement was added, with semantics as in C.
28206- Dictionary displays are now allowed on input: {key: value, ...}.
28207- Blank lines and lines bearing only a comment no longer need to
28208 be indented properly. (A completely empty line still ends a multi-
28209 line statement interactively.)
28210- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
28211- Option "-c command" to execute statements from the command line
28212- Compiled versions of modules are cached in ".pyc" files, giving a
28213 dramatic improvement of start-up time
28214- Other, smaller speed improvements, e.g., extracting characters from
28215 strings, looking up single-character keys, and looking up global
28216 variables
28217- Interrupting a print operation raises KeyboardInterrupt instead of
28218 only cancelling the print operation
28219- Fixed various portability problems (it now passes gcc with only
28220 warnings -- more Standard C compatibility will be provided in later
28221 versions)
28222- Source is prepared for porting to MS-DOS
28223- Numeric constants are now checked for overflow (this requires
28224 standard-conforming strtol() and strtod() functions; a correct
28225 strtol() implementation is provided, but the strtod() provided
28226 relies on atof() for everything, including error checking
28227
28228
282292. Changes to the built-in types, functions and modules
28230
28231- New module socket: interface to BSD socket primitives
28232- New modules pwd and grp: access the UNIX password and group databases
28233- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
28234- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
28235- New numeric type: long integer, for unlimited precision
28236 - integer constants suffixed with 'L' or 'l' are long integers
28237 - new built-in function long(x) converts int or float to long
28238 - int() and float() now also convert from long integers
28239- New built-in function:
28240 - pow(x, y) returns x to the power y
28241- New operation and methods for lists:
28242 - l*n returns a new list consisting of n concatenated copies of l
28243 - l.remove(x) removes the first occurrence of the value x from l
28244 - l.index(x) returns the index of the first occurrence of x in l
28245 - l.reverse() reverses l in place
28246- New operation for tuples:
28247 - t*n returns a tuple consisting of n concatenated copies of t
28248- Improved file handling:
28249 - f.readline() no longer restricts the line length, is faster,
28250 and isn't confused by null bytes; same for raw_input()
28251 - f.read() without arguments reads the entire (rest of the) file
28252 - mixing of print and sys.stdout.write() has different effect
28253- New methods for files:
28254 - f.readlines() returns a list containing the lines of the file,
28255 as read with f.readline()
28256 - f.flush(), f.tell(), f.seek() call their stdio counterparts
28257 - f.isatty() tests for "tty-ness"
28258- New posix functions:
28259 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
28260 - popen() returns a file object connected to a pipe
28261 - utime() replaces utimes() (the latter is not a POSIX name)
28262- New stdwin features, including:
28263 - font handling
28264 - color drawing
28265 - scroll bars made optional
28266 - polygons
28267 - filled and xor shapes
28268 - text editing objects now have a 'settext' method
28269
28270
282713. Changes to the standard library
28272
28273- Name change: the functions path.cat and macpath.cat are now called
28274 path.join and macpath.join
28275- Added new modules: formatter, mutex, persist, sched, mainloop
28276- Added some modules and functionality to the "widget set" (which is
28277 still under development, so please bear with me):
28278 DirList, FormSplit, TextEdit, WindowSched
28279- Fixed module testall to work non-interactively
28280- Module string:
28281 - added functions join() and joinfields()
28282 - fixed center() to work correct and make it "transitive"
28283- Obsolete modules were removed: util, minmax
28284- Some modules were moved to the demo directory
28285
28286
282874. Changes to the demonstration programs
28288
28289- Added new useful scipts: byteyears, eptags, fact, from, lfact,
28290 objgraph, pdeps, pi, primes, ptags, which
28291- Added a bunch of socket demos
28292- Doubled the speed of ptags
28293- Added new stdwin demos: microedit, miniedit
28294- Added a windowing interface to the Python interpreter: python (most
28295 useful on the Mac)
28296- Added a browser for Emacs info files: demo/stdwin/ibrowse
28297 (yes, I plan to put all STDWIN and Python documentation in texinfo
28298 form in the future)
28299
28300
283015. Other changes to the distribution
28302
28303- An Emacs Lisp file "python.el" is provided to facilitate editing
28304 Python programs in GNU Emacs (slightly improved since posted to
28305 gnu.emacs.sources)
28306- Some info on writing an extension in C is provided
28307- Some info on building Python on non-UNIX platforms is provided
28308
28309
28310=====================================
28311==> Release 0.9.1 (February 1991) <==
28312=====================================
28313
28314- Micro changes only
28315- Added file "patchlevel.h"
28316
28317
28318=====================================
28319==> Release 0.9.0 (February 1991) <==
28320=====================================
28321
28322Original posting to alt.sources.