blob: 67823337b7ce61a66ebdf266f8fe57213683e047 [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
Victor Stinner554fd082014-03-17 22:33:49 +010021- Issue #16060: Fix refcounting bug when `__trunc__()` returns an object whose
22 `__int__()` gives a non-integer. Patch by Serhiy Storchaka.
Georg Brandl86dc7322012-10-01 18:58:45 +020023
24Extension Modules
25-----------------
26
Victor Stinner554fd082014-03-17 22:33:49 +010027- Issue #16012: Fix a regression in pyexpat. The parser's `UseForeignDTD()`
Georg Brandl86dc7322012-10-01 18:58:45 +020028 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
Victor Stinner554fd082014-03-17 22:33:49 +010039- Issue #15900: Fix reference leak in `PyUnicode_TranslateCharmap()`.
Georg Brandl86dc7322012-10-01 18:58:45 +020040
41- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
42
43- Issue #15895: Fix FILE pointer leak in one error branch of
Victor Stinner554fd082014-03-17 22:33:49 +010044 `PyRun_SimpleFileExFlags()` when filename points to a pyc/pyo file, closeit is
45 false an and set_main_loader() fails.
Georg Brandl86dc7322012-10-01 18:58:45 +020046
47- Fixes for a few crash and memory leak regressions found by Coverity.
48
49Library
50-------
51
Victor Stinner554fd082014-03-17 22:33:49 +010052- Issue #15882: Change `_decimal` to accept any coefficient tuple when
53 constructing infinities. This is done for backwards compatibility with
54 decimal.py: Infinity coefficients are undefined in _decimal (in accordance
55 with the specification).
Georg Brandl86dc7322012-10-01 18:58:45 +020056
Victor Stinner554fd082014-03-17 22:33:49 +010057- 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
Georg Brandl86dc7322012-10-01 18:58:45 +020059 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
Victor Stinner554fd082014-03-17 22:33:49 +010070- Issue #15969: `faulthandler` module: rename dump_tracebacks_later() to
Georg Brandl86dc7322012-10-01 18:58:45 +020071 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
Victor Stinner554fd082014-03-17 22:33:49 +010086 sporadic crashes in multi-thread programs when several long deallocator chains
87 ran concurrently and involved subclasses of built-in container types.
Georg Brandl86dc7322012-10-01 18:58:45 +020088
Victor Stinner554fd082014-03-17 22:33:49 +010089- Issue #15784: Modify `OSError`.__str__() to better distinguish between errno
90 error numbers and Windows error numbers.
Georg Brandl86dc7322012-10-01 18:58:45 +020091
92- Issue #15781: Fix two small race conditions in import's module locking.
93
94Library
95-------
96
Victor Stinner554fd082014-03-17 22:33:49 +010097- Issue #17158: Add 'symbols' to help() welcome message; clarify
98 'modules spam' messages.
Georg Brandl86dc7322012-10-01 18:58:45 +020099
Victor Stinner554fd082014-03-17 22:33:49 +0100100- Issue #15847: Fix a regression in argparse, which did not accept tuples as
101 argument lists anymore.
Georg Brandl86dc7322012-10-01 18:58:45 +0200102
Victor Stinner554fd082014-03-17 22:33:49 +0100103- Issue #15828: Restore support for C extensions in `imp.load_module()`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200104
Victor Stinner554fd082014-03-17 22:33:49 +0100105- Issue #15340: Fix importing the random module when ``/dev/urandom`` cannot be
106 opened. This was a regression caused by the hash randomization patch.
107
108- Issue #10650: Deprecate the watchexp parameter of the `Decimal.quantize()`
Georg Brandl86dc7322012-10-01 18:58:45 +0200109 method.
110
Victor Stinner554fd082014-03-17 22:33:49 +0100111- Issue #15785: Modify `window.get_wch()` API of the curses module: return a
112 character for most keys, and an integer for special keys, instead of always
113 returning an integer. So it is now possible to distinguish special keys like
114 keypad keys.
Georg Brandl86dc7322012-10-01 18:58:45 +0200115
Victor Stinner554fd082014-03-17 22:33:49 +0100116- Issue #14223: Fix `window.addch()` of the curses module for special characters
Georg Brandl86dc7322012-10-01 18:58:45 +0200117 like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
118 calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
119 instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
120 calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
121 to libncursesw.
122
123Build
124-----
125
126- Issue #15822: Really ensure 2to3 grammar pickles are properly installed
127 (replaces fixes for Issue #15645).
128
129Documentation
130-------------
131
Victor Stinner554fd082014-03-17 22:33:49 +0100132- Issue #15814: The memoryview enhancements in 3.3.0 accidentally permitted the
133 hashing of multi-dimensional memorviews and memoryviews with multi-byte item
134 formats. The intended restrictions have now been documented - they will be
135 correctly enforced in 3.3.1.
Georg Brandl86dc7322012-10-01 18:58:45 +0200136
137
138What's New in Python 3.3.0 Release Candidate 1?
139===============================================
140
141*Release date: 25-Aug-2012*
142
143Core and Builtins
144-----------------
145
146- Issue #15573: memoryview comparisons are now performed by value with full
147 support for any valid struct module format definition.
148
Victor Stinner554fd082014-03-17 22:33:49 +0100149- Issue #15316: When an item in the fromlist for `__import__()` doesn't exist,
Georg Brandl86dc7322012-10-01 18:58:45 +0200150 don't raise an error, but if an exception is raised as part of an import do
151 let that propagate.
152
Victor Stinner554fd082014-03-17 22:33:49 +0100153- Issue #15778: Ensure that ``str(ImportError(msg))`` returns a str even when
154 msg isn't a str.
Georg Brandl86dc7322012-10-01 18:58:45 +0200155
Victor Stinner554fd082014-03-17 22:33:49 +0100156- Issue #2051: Source file permission bits are once again correctly copied to
157 the cached bytecode file. (The migration to importlib reintroduced this
158 problem because these was no regression test. A test has been added as part of
159 this patch)
Georg Brandl86dc7322012-10-01 18:58:45 +0200160
Victor Stinner554fd082014-03-17 22:33:49 +0100161- Issue #15761: Fix crash when ``PYTHONEXECUTABLE`` is set on Mac OS X.
Georg Brandl86dc7322012-10-01 18:58:45 +0200162
Victor Stinner554fd082014-03-17 22:33:49 +0100163- Issue #15726: Fix incorrect bounds checking in PyState_FindModule. Patch by
164 Robin Schreiber.
Georg Brandl86dc7322012-10-01 18:58:45 +0200165
Victor Stinner554fd082014-03-17 22:33:49 +0100166- Issue #15604: Update uses of `PyObject_IsTrue()` to check for and handle
Georg Brandl86dc7322012-10-01 18:58:45 +0200167 errors correctly. Patch by Serhiy Storchaka.
168
Victor Stinner554fd082014-03-17 22:33:49 +0100169- Issue #14846: `importlib.FileFinder` now handles the case where the directory
170 being searched is removed after a previous import attempt.
Georg Brandl86dc7322012-10-01 18:58:45 +0200171
172Library
173-------
174
Victor Stinner554fd082014-03-17 22:33:49 +0100175- Issue #13370: Ensure that ctypes works on Mac OS X when Python is compiled
176 using the clang compiler.
Georg Brandl86dc7322012-10-01 18:58:45 +0200177
Victor Stinner554fd082014-03-17 22:33:49 +0100178- Issue #13072: The array module's 'u' format code is now deprecated and will be
179 removed in Python 4.0.
Georg Brandl86dc7322012-10-01 18:58:45 +0200180
181- Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
182
Victor Stinner554fd082014-03-17 22:33:49 +0100183- Issue #15776: Allow pyvenv to work in existing directory with --clean.
184
185- Issue #15249: email's BytesGenerator now correctly mangles From lines (when
Georg Brandl86dc7322012-10-01 18:58:45 +0200186 requested) even if the body contains undecodable bytes.
187
188- Issue #15777: Fix a refleak in _posixsubprocess.
189
Martin Panter4e525582016-05-22 03:01:52 +0000190- Issue #665194: Update `email.utils.localtime` to use datetime.astimezone and
Georg Brandl86dc7322012-10-01 18:58:45 +0200191 correctly handle historic changes in UTC offsets.
192
193- Issue #15199: Fix JavaScript's default MIME type to application/javascript.
194 Patch by Bohuslav Kabrda.
195
Victor Stinner554fd082014-03-17 22:33:49 +0100196- Issue #12643: `code.InteractiveConsole` now respects `sys.excepthook` when
197 displaying exceptions. Patch by Aaron Iles.
Georg Brandl86dc7322012-10-01 18:58:45 +0200198
Victor Stinner554fd082014-03-17 22:33:49 +0100199- Issue #13579: `string.Formatter` now understands the 'a' conversion specifier.
Georg Brandl86dc7322012-10-01 18:58:45 +0200200
Victor Stinner554fd082014-03-17 22:33:49 +0100201- Issue #15595: Fix ``subprocess.Popen(universal_newlines=True)`` for certain
202 locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
Georg Brandl86dc7322012-10-01 18:58:45 +0200203
204- Issue #15477: In cmath and math modules, add workaround for platforms whose
205 system-supplied log1p function doesn't respect signs of zeros.
206
Victor Stinner554fd082014-03-17 22:33:49 +0100207- Issue #15715: `importlib.__import__()` will silence an ImportError when the
208 use of fromlist leads to a failed import.
Georg Brandl86dc7322012-10-01 18:58:45 +0200209
Victor Stinner554fd082014-03-17 22:33:49 +0100210- Issue #14669: Fix pickling of connections and sockets on Mac OS X by
211 sending/receiving an acknowledgment after file descriptor transfer.
212 TestPicklingConnection has been reenabled for Mac OS X.
Georg Brandl86dc7322012-10-01 18:58:45 +0200213
214- Issue #11062: Fix adding a message from file to Babyl mailbox.
215
Victor Stinner554fd082014-03-17 22:33:49 +0100216- Issue #15646: Prevent equivalent of a fork bomb when using `multiprocessing`
217 on Windows without the ``if __name__ == '__main__'`` idiom.
Georg Brandl86dc7322012-10-01 18:58:45 +0200218
Victor Stinner554fd082014-03-17 22:33:49 +0100219IDLE
220----
Georg Brandl86dc7322012-10-01 18:58:45 +0200221
Victor Stinner554fd082014-03-17 22:33:49 +0100222- Issue #15678: Fix IDLE menus when started from OS X command line (3.3.0b2
223 regression).
Georg Brandl86dc7322012-10-01 18:58:45 +0200224
225Documentation
226-------------
227
Victor Stinner554fd082014-03-17 22:33:49 +0100228- Touched up the Python 2 to 3 porting guide.
229
230- Issue #14674: Add a discussion of the `json` module's standard compliance.
Georg Brandl86dc7322012-10-01 18:58:45 +0200231 Patch by Chris Rebert.
232
233- Create a 'Concurrent Execution' section in the docs, and split up the
234 'Optional Operating System Services' section to use a more user-centric
Victor Stinner554fd082014-03-17 22:33:49 +0100235 classification scheme (splitting them across the new CE section, IPC and text
236 processing). Operating system limitations can be reflected with the Sphinx
237 ``:platform:`` tag, it doesn't make sense as part of the Table of Contents.
Georg Brandl86dc7322012-10-01 18:58:45 +0200238
Victor Stinner554fd082014-03-17 22:33:49 +0100239- Issue #4966: Bring the sequence docs up to date for the Py3k transition and
240 the many language enhancements since they were original written.
Georg Brandl86dc7322012-10-01 18:58:45 +0200241
242- The "path importer" misnomer has been replaced with Eric Snow's
Victor Stinner554fd082014-03-17 22:33:49 +0100243 more-awkward-but-at-least-not-wrong suggestion of "path based finder" in the
244 import system reference docs.
Georg Brandl86dc7322012-10-01 18:58:45 +0200245
Victor Stinner554fd082014-03-17 22:33:49 +0100246- Issue #15640: Document `importlib.abc.Finder` as deprecated.
Georg Brandl86dc7322012-10-01 18:58:45 +0200247
Victor Stinner554fd082014-03-17 22:33:49 +0100248- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
Georg Brandl86dc7322012-10-01 18:58:45 +0200249 Daniel Ellis.
250
251Tests
252-----
253
254- Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the
Victor Stinner554fd082014-03-17 22:33:49 +0100255 UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected tests in
256 test_posix.py to account for this.
Georg Brandl86dc7322012-10-01 18:58:45 +0200257
Victor Stinner554fd082014-03-17 22:33:49 +0100258- Issue #15285: Refactor the approach for testing connect timeouts using two
259 external hosts that have been configured specifically for this type of test.
Georg Brandl86dc7322012-10-01 18:58:45 +0200260
Victor Stinner554fd082014-03-17 22:33:49 +0100261- Issue #15743: Remove the deprecated method usage in `urllib` tests. Patch by
Georg Brandl86dc7322012-10-01 18:58:45 +0200262 Jeff Knupp.
263
Victor Stinner554fd082014-03-17 22:33:49 +0100264- Issue #15615: Add some tests for the `json` module's handling of invalid input
265 data. Patch by Kushal Das.
Georg Brandl86dc7322012-10-01 18:58:45 +0200266
267Build
268-----
269
270- Output lib files for PGO build into PGO directory.
271
272- Pick up 32-bit launcher from PGO directory on 64-bit PGO build.
273
Victor Stinner554fd082014-03-17 22:33:49 +0100274- Drop ``PC\python_nt.h`` as it's not used. Add input dependency on custom
Georg Brandl86dc7322012-10-01 18:58:45 +0200275 build step.
276
Victor Stinner554fd082014-03-17 22:33:49 +0100277- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal amd64
278 configuration.
Georg Brandl86dc7322012-10-01 18:58:45 +0200279
280- Add missing PGI/PGO configurations for pywlauncher.
281
282- Issue #15645: Ensure 2to3 grammar pickles are properly installed.
283
284
285What's New in Python 3.3.0 Beta 2?
286==================================
287
288*Release date: 12-Aug-2012*
289
290Core and Builtins
291-----------------
292
Victor Stinner554fd082014-03-17 22:33:49 +0100293- Issue #15568: Fix the return value of ``yield from`` when StopIteration is
Georg Brandl86dc7322012-10-01 18:58:45 +0200294 raised by a custom iterator.
295
Victor Stinner554fd082014-03-17 22:33:49 +0100296- Issue #13119: `sys.stdout` and `sys.stderr` are now using "\r\n" newline on
Georg Brandl86dc7322012-10-01 18:58:45 +0200297 Windows, as Python 2.
298
299- Issue #15534: Fix the fast-search function for non-ASCII Unicode strings.
300
Victor Stinner554fd082014-03-17 22:33:49 +0100301- Issue #15508: Fix the docstring for `__import__()` to have the proper default
Georg Brandl86dc7322012-10-01 18:58:45 +0200302 value of 0 for 'level' and to not mention negative levels since they are not
303 supported.
304
305- Issue #15425: Eliminated traceback noise from more situations involving
306 importlib.
307
308- Issue #14578: Support modules registered in the Windows registry again.
309
310- Issue #15466: Stop using TYPE_INT64 in marshal, to make importlib.h (and other
311 byte code files) equal between 32-bit and 64-bit systems.
312
313- Issue #1692335: Move initial exception args assignment to
Victor Stinner554fd082014-03-17 22:33:49 +0100314 `BaseException.__new__()` to help pickling of naive subclasses.
Georg Brandl86dc7322012-10-01 18:58:45 +0200315
Victor Stinner554fd082014-03-17 22:33:49 +0100316- Issue #12834: Fix `PyBuffer_ToContiguous()` for non-contiguous arrays.
Georg Brandl86dc7322012-10-01 18:58:45 +0200317
Victor Stinner554fd082014-03-17 22:33:49 +0100318- Issue #15456: Fix code `__sizeof__()` after #12399 change. Patch by Serhiy
Georg Brandl86dc7322012-10-01 18:58:45 +0200319 Storchaka.
320
321- Issue #15404: Refleak in PyMethodObject repr.
322
Victor Stinner554fd082014-03-17 22:33:49 +0100323- Issue #15394: An issue in `PyModule_Create()` that caused references to be
324 leaked on some error paths has been fixed. Patch by Julia Lawall.
Georg Brandl86dc7322012-10-01 18:58:45 +0200325
326- Issue #15368: An issue that caused bytecode generation to be non-deterministic
327 has been fixed.
328
329- Issue #15202: Consistently use the name "follow_symlinks" for new parameters
330 in os and shutil functions.
331
Victor Stinner554fd082014-03-17 22:33:49 +0100332- Issue #15314: ``__main__.__loader__`` is now set correctly during interpreter
Georg Brandl86dc7322012-10-01 18:58:45 +0200333 startup.
334
335- Issue #15111: When a module imported using 'from import' has an ImportError
336 inside itself, don't mask that fact behind a generic ImportError for the
337 module itself.
338
339- Issue #15293: Add GC support to the AST base node type.
340
341- Issue #15291: Fix a memory leak where AST nodes where not properly
342 deallocated.
343
344- Issue #15110: Fix the tracebacks generated by "import xxx" to not show the
345 importlib stack frames.
346
Victor Stinner554fd082014-03-17 22:33:49 +0100347- Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
348
Georg Brandl86dc7322012-10-01 18:58:45 +0200349- Issue #15020: The program name used to search for Python's path is now
350 "python3" under Unix, not "python".
351
Victor Stinner554fd082014-03-17 22:33:49 +0100352- Issue #15897: zipimport.c doesn't check return value of fseek().
353 Patch by Felipe Cruz.
354
355- Issue #15033: Fix the exit status bug when modules invoked using -m switch,
Georg Brandl86dc7322012-10-01 18:58:45 +0200356 return the proper failure return value (1). Patch contributed by Jeff Knupp.
357
Victor Stinner554fd082014-03-17 22:33:49 +0100358- Issue #15229: An `OSError` subclass whose __init__ doesn't call back
Georg Brandl86dc7322012-10-01 18:58:45 +0200359 OSError.__init__ could produce incomplete instances, leading to crashes when
360 calling str() on them.
361
Victor Stinner554fd082014-03-17 22:33:49 +0100362- Issue #15307: Virtual environments now use symlinks with framework builds on
Georg Brandl86dc7322012-10-01 18:58:45 +0200363 Mac OS X, like other POSIX builds.
364
365Library
366-------
367
Victor Stinner554fd082014-03-17 22:33:49 +0100368- Issue #14590: configparser now correctly strips inline comments when delimiter
369 occurs earlier without preceding space.
370
371- Issue #15424: Add a `__sizeof__()` implementation for array objects. Patch by
Georg Brandl86dc7322012-10-01 18:58:45 +0200372 Ludwig Hähne.
373
374- Issue #15576: Allow extension modules to act as a package's __init__ module.
375
Victor Stinner554fd082014-03-17 22:33:49 +0100376- Issue #15502: Have `importlib.invalidate_caches()` work on `sys.meta_path`
377 instead of `sys.path_importer_cache`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200378
379- Issue #15163: Pydoc shouldn't list __loader__ as module data.
380
381- Issue #15471: Do not use mutable objects as defaults for
Victor Stinner554fd082014-03-17 22:33:49 +0100382 `importlib.__import__()`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200383
384- Issue #15559: To avoid a problematic failure mode when passed to the bytes
Victor Stinner554fd082014-03-17 22:33:49 +0100385 constructor, objects in the ipaddress module no longer implement `__index__()`
386 (they still implement `__int__()` as appropriate).
Georg Brandl86dc7322012-10-01 18:58:45 +0200387
388- Issue #15546: Fix handling of pathological input data in the peek() and
389 read1() methods of the BZ2File, GzipFile and LZMAFile classes.
390
Victor Stinner554fd082014-03-17 22:33:49 +0100391- Issue #12655: Instead of requiring a custom type, `os.sched_getaffinity()` and
392 `os.sched_setaffinity()` now use regular sets of integers to represent the
393 CPUs a process is restricted to.
Georg Brandl86dc7322012-10-01 18:58:45 +0200394
Victor Stinner554fd082014-03-17 22:33:49 +0100395- Issue #15538: Fix compilation of the `socket.getnameinfo()` /
396 `socket.getaddrinfo()` emulation code. Patch by Philipp Hagemeister.
Georg Brandl86dc7322012-10-01 18:58:45 +0200397
398- Issue #15519: Properly expose WindowsRegistryFinder in importlib (and use the
Victor Stinner554fd082014-03-17 22:33:49 +0100399 correct term for it). Original patch by Eric Snow.
Georg Brandl86dc7322012-10-01 18:58:45 +0200400
401- Issue #15502: Bring the importlib ABCs into line with the current state of the
Victor Stinner554fd082014-03-17 22:33:49 +0100402 import protocols given PEP 420. Original patch by Eric Snow.
Georg Brandl86dc7322012-10-01 18:58:45 +0200403
404- Issue #15499: Launching a webbrowser in Unix used to sleep for a few seconds.
405 Original patch by Anton Barkovsky.
406
407- Issue #15463: The faulthandler module truncates strings to 500 characters,
408 instead of 100, to be able to display long file paths.
409
Victor Stinner554fd082014-03-17 22:33:49 +0100410- Issue #6056: Make `multiprocessing` use setblocking(True) on the sockets it
Georg Brandl86dc7322012-10-01 18:58:45 +0200411 uses. Original patch by J Derek Wilson.
412
413- Issue #15364: Fix sysconfig.get_config_var('srcdir') to be an absolute path.
414
Victor Stinner554fd082014-03-17 22:33:49 +0100415- Issue #15413: `os.times()` had disappeared under Windows.
Georg Brandl86dc7322012-10-01 18:58:45 +0200416
Victor Stinner554fd082014-03-17 22:33:49 +0100417- Issue #15402: An issue in the struct module that caused `sys.getsizeof()` to
Georg Brandl86dc7322012-10-01 18:58:45 +0200418 return incorrect results for struct.Struct instances has been fixed. Initial
419 patch by Serhiy Storchaka.
420
Victor Stinner554fd082014-03-17 22:33:49 +0100421- Issue #15232: When mangle_from is True, `email.Generator` now correctly
422 mangles lines that start with 'From ' that occur in a MIME preamble or
423 epilogue.
Georg Brandl86dc7322012-10-01 18:58:45 +0200424
425- Issue #15094: Incorrectly placed #endif in _tkinter.c. Patch by Serhiy
426 Storchaka.
427
Victor Stinner554fd082014-03-17 22:33:49 +0100428- Issue #13922: `argparse` no longer incorrectly strips '--'s that appear after
Georg Brandl86dc7322012-10-01 18:58:45 +0200429 the first one.
430
Victor Stinner554fd082014-03-17 22:33:49 +0100431- Issue #12353: `argparse` now correctly handles null argument values.
Georg Brandl86dc7322012-10-01 18:58:45 +0200432
433- Issue #10017, issue #14998: Fix TypeError using pprint on dictionaries with
434 user-defined types as keys or other unorderable keys.
435
Victor Stinner554fd082014-03-17 22:33:49 +0100436- Issue #15397: `inspect.getmodulename()` is now based directly on importlib via
437 a new `importlib.machinery.all_suffixes()` API.
Georg Brandl86dc7322012-10-01 18:58:45 +0200438
Victor Stinner554fd082014-03-17 22:33:49 +0100439- Issue #14635: `telnetlib` will use poll() rather than select() when possible to
Georg Brandl86dc7322012-10-01 18:58:45 +0200440 avoid failing due to the select() file descriptor limit.
441
442- Issue #15180: Clarify posixpath.join() error message when mixing str & bytes.
443
444- Issue #15343: pkgutil now includes an iter_importer_modules implementation for
445 importlib.machinery.FileFinder (similar to the way it already handled
446 zipimport.zipimporter).
447
448- Issue #15314: runpy now sets __main__.__loader__ correctly.
449
450- Issue #15357: The import emulation in pkgutil is now deprecated. pkgutil uses
451 importlib internally rather than the emulation.
452
453- Issue #15233: Python now guarantees that callables registered with the atexit
454 module will be called in a deterministic order.
455
Victor Stinner554fd082014-03-17 22:33:49 +0100456- Issue #15238: `shutil.copystat()` now copies Linux "extended attributes".
Georg Brandl86dc7322012-10-01 18:58:45 +0200457
458- Issue #15230: runpy.run_path now correctly sets __package__ as described in
459 the documentation.
460
461- Issue #15315: Support VS 2010 in distutils cygwincompiler.
462
463- Issue #15294: Fix a regression in pkgutil.extend_path()'s handling of nested
464 namespace packages.
465
Victor Stinner554fd082014-03-17 22:33:49 +0100466- Issue #15056: `imp.cache_from_source()` and `imp.source_from_cache()` raise
467 NotImplementedError when `sys.implementation.cache_tag` is set to None.
Georg Brandl86dc7322012-10-01 18:58:45 +0200468
Victor Stinner554fd082014-03-17 22:33:49 +0100469- Issue #15256: Grammatical mistake in exception raised by `imp.find_module()`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200470
Victor Stinner554fd082014-03-17 22:33:49 +0100471- Issue #5931: `wsgiref` environ variable SERVER_SOFTWARE will specify an
Georg Brandl86dc7322012-10-01 18:58:45 +0200472 implementation specific term like CPython, Jython instead of generic "Python".
473
474- Issue #13248: Remove obsolete argument "max_buffer_size" of BufferedWriter and
475 BufferedRWPair, from the io module.
476
Victor Stinner554fd082014-03-17 22:33:49 +0100477- Issue #13248: Remove obsolete argument "version" of `argparse.ArgumentParser`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200478
479- Issue #14814: Implement more consistent ordering and sorting behaviour for
480 ipaddress objects.
481
Victor Stinner554fd082014-03-17 22:33:49 +0100482- Issue #14814: `ipaddress` network objects correctly return NotImplemented when
Georg Brandl86dc7322012-10-01 18:58:45 +0200483 compared to arbitrary objects instead of raising TypeError.
484
485- Issue #14990: Correctly fail with SyntaxError on invalid encoding declaration.
486
Victor Stinner554fd082014-03-17 22:33:49 +0100487- Issue #14814: `ipaddress` now provides more informative error messages when
Georg Brandl86dc7322012-10-01 18:58:45 +0200488 constructing instances directly (changes permitted during beta due to
489 provisional API status).
490
Victor Stinner554fd082014-03-17 22:33:49 +0100491- Issue #15247: `io.FileIO` now raises an error when given a file descriptor
492 pointing to a directory.
Georg Brandl86dc7322012-10-01 18:58:45 +0200493
494- Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
495
Victor Stinner554fd082014-03-17 22:33:49 +0100496- Issue #15166: Implement `imp.get_tag()` using `sys.implementation.cache_tag`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200497
Victor Stinner554fd082014-03-17 22:33:49 +0100498- Issue #15210: Catch KeyError when `importlib.__init__()` can't find
Georg Brandl86dc7322012-10-01 18:58:45 +0200499 _frozen_importlib in sys.modules, not ImportError.
500
Victor Stinner554fd082014-03-17 22:33:49 +0100501- Issue #15030: `importlib.abc.PyPycLoader` now supports the new source size
Georg Brandl86dc7322012-10-01 18:58:45 +0200502 header field in .pyc files.
503
504- Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on
505 flush().
506
507- Issue #10571: Fix the "--sign" option of distutils' upload command. Patch by
508 Jakub Wilk.
509
510- Issue #9559: If messages were only added, a new file is no longer created and
511 renamed over the old file when flush() is called on an mbox, MMDF or Babyl
512 mailbox.
513
Victor Stinner554fd082014-03-17 22:33:49 +0100514- Issue #10924: Fixed `crypt.mksalt()` to use a RNG that is suitable for
Georg Brandl86dc7322012-10-01 18:58:45 +0200515 cryptographic purpose.
516
517- Issue #15184: Ensure consistent results of OS X configuration tailoring for
518 universal builds by factoring out common OS X-specific customizations from
519 sysconfig, distutils.sysconfig, distutils.util, and distutils.unixccompiler
520 into a new module _osx_support.
521
522C API
523-----
524
Victor Stinner554fd082014-03-17 22:33:49 +0100525- Issue #15610: `PyImport_ImportModuleEx()` now uses a 'level' of 0 instead of -1.
Georg Brandl86dc7322012-10-01 18:58:45 +0200526
Victor Stinner554fd082014-03-17 22:33:49 +0100527- Issue #15169, issue #14599: Strip out the C implementation of
528 `imp.source_from_cache()` used by PyImport_ExecCodeModuleWithPathnames() and
Georg Brandl86dc7322012-10-01 18:58:45 +0200529 used the Python code instead. Leads to PyImport_ExecCodeModuleObject() to not
530 try to infer the source path from the bytecode path as
531 PyImport_ExecCodeModuleWithPathnames() does.
532
533Extension Modules
534-----------------
535
Victor Stinner554fd082014-03-17 22:33:49 +0100536- Issue #6493: An issue in ctypes on Windows that caused structure bitfields of
537 type `ctypes.c_uint32` and width 32 to incorrectly be set has been fixed.
Georg Brandl86dc7322012-10-01 18:58:45 +0200538
539- Issue #15194: Update libffi to the 3.0.11 release.
540
Victor Stinner554fd082014-03-17 22:33:49 +0100541IDLE
542----
543
544- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog
545 ended with ``\``. Patch by Roger Serwy.
546
Georg Brandl86dc7322012-10-01 18:58:45 +0200547Tools/Demos
548-----------
549
550- Issue #15458: python-config gets a new option --configdir to print the $LIBPL
551 value.
552
553- Move importlib.test.benchmark to Tools/importbench.
554
555- Issue #12605: The gdb hooks for debugging CPython (within Tools/gdb) have been
556 enhanced to show information on more C frames relevant to CPython within the
557 "py-bt" and "py-bt-full" commands:
558
559 * C frames that are waiting on the GIL
560 * C frames that are garbage-collecting
561 * C frames that are due to the invocation of a PyCFunction
562
563Documentation
564-------------
565
Victor Stinner554fd082014-03-17 22:33:49 +0100566- Issue #15041: Update "see also" list in tkinter documentation.
567
568- Issue #15444: Use proper spelling for non-ASCII contributor names. Patch by
569 Serhiy Storchaka.
Georg Brandl86dc7322012-10-01 18:58:45 +0200570
571- Issue #15295: Reorganize and rewrite the documentation on the import system.
572
573- Issue #15230: Clearly document some of the limitations of the runpy module and
574 nudge readers towards importlib when appropriate.
575
576- Issue #15053: Copy Python 3.3 import lock change notice to all relevant
577 functions in imp instead of just at the top of the relevant section.
578
579- Issue #15288: Link to the term "loader" in notes in pkgutil about how things
580 won't work as expected in Python 3.3 and mark the requisite functions as
581 "changed" since they will no longer work with modules directly imported by
582 import itself.
583
Victor Stinner554fd082014-03-17 22:33:49 +0100584- Issue #13557: Clarify effect of giving two different namespaces to `exec()` or
585 `execfile()`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200586
Victor Stinner554fd082014-03-17 22:33:49 +0100587- Issue #15250: Document that `filecmp.dircmp()` compares files shallowly. Patch
Georg Brandl86dc7322012-10-01 18:58:45 +0200588 contributed by Chris Jerdonek.
589
Victor Stinner554fd082014-03-17 22:33:49 +0100590- Issue #15442: Expose the default list of directories ignored by
591 `filecmp.dircmp()` as a module attribute, and expand the list to more modern
592 values.
593
Georg Brandl86dc7322012-10-01 18:58:45 +0200594Tests
595-----
596
Victor Stinner554fd082014-03-17 22:33:49 +0100597- Issue #15467: Move helpers for `__sizeof__()` tests into test_support. Patch
598 by Serhiy Storchaka.
Georg Brandl86dc7322012-10-01 18:58:45 +0200599
600- Issue #15320: Make iterating the list of tests thread-safe when running tests
601 in multiprocess mode. Patch by Chris Jerdonek.
602
Victor Stinner554fd082014-03-17 22:33:49 +0100603- Issue #15168: Move `importlib.test` to `test.test_importlib`.
Georg Brandl86dc7322012-10-01 18:58:45 +0200604
605- Issue #15091: Reactivate a test on UNIX which was failing thanks to a
Victor Stinner554fd082014-03-17 22:33:49 +0100606 forgotten `importlib.invalidate_caches()` call.
Georg Brandl86dc7322012-10-01 18:58:45 +0200607
608- Issue #15230: Adopted a more systematic approach in the runpy tests.
609
610- Issue #15300: Ensure the temporary test working directories are in the same
611 parent folder when running tests in multiprocess mode from a Python build.
612 Patch by Chris Jerdonek.
613
614- Issue #15284: Skip {send,recv}msg tests in test_socket when IPv6 is not
615 enabled. Patch by Brian Brazil.
616
617- Issue #15277: Fix a resource leak in support.py when IPv6 is disabled. Patch
618 by Brian Brazil.
619
620Build
621-----
622
623- Issue #11715: Fix multiarch detection without having Debian development tools
624 (dpkg-dev) installed.
625
626- Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
627 to avoid curses.unget_wch bug present in older versions of ncurses such as
628 those shipped with OS X.
629
630- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK. Also, for
631 OS X installers, ensure consistent sqlite3 behavior and feature availability
632 by building a local copy of libsqlite3 rather than depending on the wide range
633 of versions supplied with various OS X releases.
634
635- Issue #8847: Disable COMDAT folding in Windows PGO builds.
636
637- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
638
Victor Stinner554fd082014-03-17 22:33:49 +0100639- Issue #16256: OS X installer now sets correct permissions for doc directory.
640
Georg Brandl86dc7322012-10-01 18:58:45 +0200641- Issue #15431: Add _freeze_importlib project to regenerate importlib.h on
642 Windows. Patch by Kristján Valur Jónsson.
643
644- Issue #14197: For OS X framework builds, ensure links to the shared library
645 are created with the proper ABI suffix.
646
647- Issue #14330: For cross builds, don't use host python, use host search paths
648 for host compiler.
649
650- Issue #15235: Allow Berkley DB versions up to 5.3 to build the dbm module.
651
652- Issue #15268: Search curses.h in /usr/include/ncursesw.
653
654
655What's New in Python 3.3.0 Beta 1?
656==================================
657
658*Release date: 27-Jun-2012*
659
660Core and Builtins
661-----------------
662
663- Fix a (most likely) very rare memory leak when calling main() and not being
664 able to decode a command-line argument.
665
666- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
667 preserve all 64 bits of hash on Win64.
668
669- Issue #12268: File readline, readlines and read() or readall() methods
670 no longer lose data when an underlying read system call is interrupted.
671 IOError is no longer raised due to a read system call returning EINTR
672 from within these methods.
673
674- Issue #11626: Add _SizeT functions to stable ABI.
675
Georg Brandl86dc7322012-10-01 18:58:45 +0200676- Issue #15142: Fix reference leak when deallocating instances of types
677 created using PyType_FromSpec().
678
Georg Brandl86dc7322012-10-01 18:58:45 +0200679- Issue #10053: Don't close FDs when FileIO.__init__ fails. Loosely based on
680 the work by Hirokazu Yamamoto.
681
682- Issue #15096: Removed support for ur'' as the raw notation isn't
683 compatible with Python 2.x's raw unicode strings.
684
685- Issue #13783: Generator objects now use the identifier APIs internally
686
687- Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
688 Patch by Serhiy Storchaka.
689
690- Issue #15026: utf-16 encoding is now significantly faster (up to 10x).
691 Patch by Serhiy Storchaka.
692
693- Issue #11022: open() and io.TextIOWrapper are now calling
694 locale.getpreferredencoding(False) instead of locale.getpreferredencoding()
695 in text mode if the encoding is not specified. Don't change temporary the
696 locale encoding using locale.setlocale(), use the current locale encoding
697 instead of the user preferred encoding.
698
699- Issue #14673: Add Eric Snow's sys.implementation implementation.
700
701- Issue #15038: Optimize python Locks on Windows.
702
703Library
704-------
705
Georg Brandl86dc7322012-10-01 18:58:45 +0200706- Issue #12288: Consider '0' and '0.0' as valid initialvalue
707 for tkinter SimpleDialog.
708
709- Issue #15512: Add a __sizeof__ implementation for parser.
710 Patch by Serhiy Storchaka.
711
712- Issue #15469: Add a __sizeof__ implementation for deque objects.
713 Patch by Serhiy Storchaka.
714
715- Issue #15489: Add a __sizeof__ implementation for BytesIO objects.
716 Patch by Serhiy Storchaka.
717
718- Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
719 Patch by Serhiy Storchaka.
720
721- Issue #15514: Correct __sizeof__ support for cpu_set.
722 Patch by Serhiy Storchaka.
723
Georg Brandl86dc7322012-10-01 18:58:45 +0200724- Issue #15177: Added dir_fd parameter to os.fwalk().
725
Georg Brandl86dc7322012-10-01 18:58:45 +0200726- Issue #15061: Re-implemented hmac.compare_digest() in C to prevent further
727 timing analysis and to support all buffer protocol aware objects as well as
728 ASCII only str instances safely.
729
730- Issue #15164: Change return value of platform.uname() from a
731 plain tuple to a collections.namedtuple.
732
733- Support Mageia Linux in the platform module.
734
735- Issue #11678: Support Arch linux in the platform module.
736
737- Issue #15118: Change return value of os.uname() and os.times() from
738 plain tuples to immutable iterable objects with named attributes
739 (structseq objects).
740
741- Speed up _decimal by another 10-15% by caching the thread local context
742 that was last accessed. In the pi benchmark (64-bit platform, prec=9),
743 _decimal is now only 1.5x slower than float.
744
745- Remove the packaging module, which is not ready for prime time.
746
747- Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
748 parameter from os.remove / os.unlink.
749
750- Issue #4489: Add a shutil.rmtree that isn't susceptible to symlink attacks.
751 It is used automatically on platforms supporting the necessary os.openat()
752 and os.unlinkat() functions. Main code by Martin von Löwis.
753
754- Issue #15156: HTMLParser now uses the new "html.entities.html5" dictionary.
755
756- Issue #11113: add a new "html5" dictionary containing the named character
757 references defined by the HTML5 standard and the equivalent Unicode
758 character(s) to the html.entities module.
759
760- Issue #15114: the strict mode of HTMLParser and the HTMLParseError exception
761 are deprecated now that the parser is able to parse invalid markup.
762
763- Issue #3665: \u and \U escapes are now supported in unicode regular
764 expressions. Patch by Serhiy Storchaka.
765
766- Issue #15153: Added inspect.getgeneratorlocals to simplify white box
767 testing of generator state updates
768
769- Issue #13062: Added inspect.getclosurevars to simplify testing stateful
770 closures
771
772- Issue #11024: Fixes and additional tests for Time2Internaldate.
773
774- Issue #14626: Large refactoring of functions / parameters in the os module.
775 Many functions now support "dir_fd" and "follow_symlinks" parameters;
Terry Jan Reedy8e7586b2013-03-11 18:38:13 -0400776 some also support accepting an open file descriptor in place of a path
Georg Brandl86dc7322012-10-01 18:58:45 +0200777 string. Added os.support_* collections as LBYL helpers. Removed many
778 functions only previously seen in 3.3 alpha releases (often starting with
779 "f" or "l", or ending with "at"). Originally suggested by Serhiy Storchaka;
780 implemented by Larry Hastings.
781
782- Issue #15008: Implement PEP 362 "Signature Objects".
783 Patch by Yury Selivanov.
784
Martin Panter4e525582016-05-22 03:01:52 +0000785- Issue #15138: base64.urlsafe_{en,de}code() are now 3-4x faster.
Georg Brandl86dc7322012-10-01 18:58:45 +0200786
787- Issue #444582: Add shutil.which, for finding programs on the system path.
788 Original patch by Erik Demaine, with later iterations by Jan Killian
789 and Brian Curtin.
790
791- Issue #14837: SSL errors now have ``library`` and ``reason`` attributes
792 describing precisely what happened and in which OpenSSL submodule. The
793 str() of a SSLError is also enhanced accordingly.
794
795- Issue #9527: datetime.astimezone() method will now supply a class
796 timezone instance corresponding to the system local timezone when
797 called with no arguments.
798
799- Issue #14653: email.utils.mktime_tz() no longer relies on system
800 mktime() when timezone offest is supplied.
801
802- Issue #14684: zlib.compressobj() and zlib.decompressobj() now support the use
803 of predefined compression dictionaries. Original patch by Sam Rushing.
804
805- Fix GzipFile's handling of filenames given as bytes objects.
806
807- Issue #14772: Return destination values from some shutil functions.
808
Serhiy Storchaka14867992014-09-10 23:43:41 +0300809- Issue #15064: Implement context management protocol for multiprocessing types
Georg Brandl86dc7322012-10-01 18:58:45 +0200810
811- Issue #15101: Make pool finalizer avoid joining current thread.
812
813- Issue #14657: The frozen instance of importlib used for bootstrap is now
814 also the module imported as importlib._bootstrap.
815
816- Issue #14055: Add __sizeof__ support to _elementtree.
817
818- Issue #15054: A bug in tokenize.tokenize that caused string literals
819 with 'b' prefixes to be incorrectly tokenized has been fixed.
820 Patch by Serhiy Storchaka.
821
822- Issue #15006: Allow equality comparison between naive and aware
823 time or datetime objects.
824
Georg Brandl86dc7322012-10-01 18:58:45 +0200825- Issue #15036: Mailbox no longer throws an error if a flush is done
826 between operations when removing or changing multiple items in mbox,
827 MMDF, or Babyl mailboxes.
828
829- Issue #14059: Implement multiprocessing.Barrier.
830
831- Issue #15061: The inappropriately named hmac.secure_compare has been
832 renamed to hmac.compare_digest, restricted to operating on bytes inputs
833 only and had its documentation updated to more accurately reflect both its
834 intent and its limitations
835
836- Issue #13841: Make child processes exit using sys.exit() on Windows.
837
838- Issue #14936: curses_panel was converted to PEP 3121 and PEP 384 API.
839 Patch by Robin Schreiber.
840
841- Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
842 in struct tm, time.struct_time objects returned by time.gmtime(),
843 time.localtime() and time.strptime() functions now have tm_zone and
844 tm_gmtoff attributes. Original patch by Paul Boddie.
845
846- Rename adjusted attribute to adjustable in time.get_clock_info() result.
847
848- Issue #3518: Remove references to non-existent BaseManager.from_address()
849 method.
850
851- Issue #13857: Added textwrap.indent() function (initial patch by Ezra
852 Berch)
853
854- Issue #2736: Added datetime.timestamp() method.
855
856- Issue #13854: Make multiprocessing properly handle non-integer
857 non-string argument to SystemExit.
858
859- Issue #12157: Make pool.map() empty iterables correctly. Initial
860 patch by mouad.
861
862- Issue #11823: disassembly now shows argument counts on calls with keyword args.
863
864- Issue #14711: os.stat_float_times() has been deprecated.
865
866- LZMAFile now accepts the modes "rb"/"wb"/"ab" as synonyms of "r"/"w"/"a".
867
868- The bz2 and lzma modules now each contain an open() function, allowing
869 compressed files to readily be opened in text mode as well as binary mode.
870
871- BZ2File.__init__() and LZMAFile.__init__() now accept a file object as their
872 first argument, rather than requiring a separate "fileobj" argument.
873
874- gzip.open() now accepts file objects as well as filenames.
875
876- Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
877 when the path existed and had the S_ISGID mode bit set when it was
878 not explicitly asked for. This is no longer an exception as mkdir
879 cannot control if the OS sets that bit for it or not.
880
881- Issue #14989: Make the CGI enable option to http.server available via command
882 line.
883
884- Issue #14987: Add a missing import statement to inspect.
885
886- Issue #1079: email.header.decode_header now correctly parses all the examples
887 in RFC2047. There is a necessary visible behavior change: the leading and/or
888 trailing whitespace on ASCII parts is now preserved.
889
890- Issue #14969: Better handling of exception chaining in contextlib.ExitStack
891
Georg Brandl86dc7322012-10-01 18:58:45 +0200892- Issue #14963: Convert contextlib.ExitStack.__exit__ to use an iterative
893 algorithm (Patch by Alon Horev)
894
895- Issue #14785: Add sys._debugmallocstats() to help debug low-level memory
896 allocation issues
897
898- Issue #14443: Ensure that .py files are byte-compiled with the correct Python
899 executable within bdist_rpm even on older versions of RPM
900
901C-API
902-----
903
Victor Stinner554fd082014-03-17 22:33:49 +0100904- Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
905
906- Issue #15042: Add PyState_AddModule and PyState_RemoveModule. Add version
907 guard for Py_LIMITED_API additions. Patch by Robin Schreiber.
908
Georg Brandl86dc7322012-10-01 18:58:45 +0200909- Issue #13783: Inadvertent additions to the public C API in the PEP 380
910 implementation have either been removed or marked as private interfaces.
911
912Extension Modules
913-----------------
914
915- Issue #15000: Support the "unique" x32 architecture in _posixsubprocess.c.
916
Victor Stinner554fd082014-03-17 22:33:49 +0100917IDLE
918----
919
920- Issue #9803: Don't close IDLE on saving if breakpoint is open.
921 Patch by Roger Serwy.
922
923- Issue #14962: Update text coloring in IDLE shell window after changing
924 options. Patch by Roger Serwy.
925
Georg Brandl86dc7322012-10-01 18:58:45 +0200926Documentation
927-------------
928
Victor Stinner554fd082014-03-17 22:33:49 +0100929- Issue #15176: Clarified behavior, documentation, and implementation
930 of os.listdir().
931
932- Issue #14982: Document that pkgutil's iteration functions require the
933 non-standard iter_modules() method to be defined by an importer (something
934 the importlib importers do not define).
935
Georg Brandl86dc7322012-10-01 18:58:45 +0200936- Issue #15081: Document PyState_FindModule.
937 Patch by Robin Schreiber.
938
939- Issue #14814: Added first draft of ipaddress module API reference
940
941Tests
942-----
943
Victor Stinner554fd082014-03-17 22:33:49 +0100944- Issue #15187: Bugfix: remove temporary directories test_shutil was leaving
945 behind.
946
Georg Brandl86dc7322012-10-01 18:58:45 +0200947- Issue #14769: test_capi now has SkipitemTest, which cleverly checks
948 for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
949 function skipitem() for all possible "format units".
950
951- test_nntplib now tolerates being run from behind NNTP gateways that add
952 "X-Antivirus" headers to articles
953
954- Issue #15043: test_gdb is now skipped entirely if gdb security settings
955 block loading of the gdb hooks
956
957- Issue #14963: Add test cases for exception handling behaviour
958 in contextlib.ExitStack (Initial patch by Alon Horev)
959
960Build
961-----
962
963- Issue #13590: Improve support for OS X Xcode 4:
964 * Try to avoid building Python or extension modules with problematic
965 llvm-gcc compiler.
966 * Since Xcode 4 removes ppc support, extension module builds now
967 check for ppc compiler support and automatically remove ppc and
968 ppc64 archs when not available.
969 * Since Xcode 4 no longer install SDKs in default locations,
970 extension module builds now revert to using installed headers
971 and libs if the SDK used to build the interpreter is not
972 available.
973 * Update ./configure to use better defaults for universal builds;
974 in particular, --enable-universalsdk=yes uses the Xcode default
975 SDK and --with-universal-archs now defaults to "intel" if ppc
976 not available.
977
978- Issue #14225: Fix Unicode support for curses (#12567) on OS X
979
980- Issue #14928: Fix importlib bootstrap issues by using a custom executable
981 (Modules/_freeze_importlib) to build Python/importlib.h.
982
983
984What's New in Python 3.3.0 Alpha 4?
985===================================
986
987*Release date: 31-May-2012*
988
989Core and Builtins
990-----------------
991
992- Issue #14835: Make plistlib output empty arrays & dicts like OS X.
993 Patch by Sidney San Martín.
994
995- Issue #14744: Use the new _PyUnicodeWriter internal API to speed up
996 str%args and str.format(args).
997
998- Issue #14930: Make memoryview objects weakrefable.
999
1000- Issue #14775: Fix a potential quadratic dict build-up due to the garbage
1001 collector repeatedly trying to untrack dicts.
1002
1003- Issue #14857: fix regression in references to PEP 3135 implicit __class__
1004 closure variable (Reopens issue #12370)
1005
1006- Issue #14712 (PEP 405): Virtual environments. Implemented by Vinay Sajip.
1007
1008- Issue #14660 (PEP 420): Namespace packages. Implemented by Eric Smith.
1009
1010- Issue #14494: Fix __future__.py and its documentation to note that
1011 absolute imports are the default behavior in 3.0 instead of 2.7.
1012 Patch by Sven Marnach.
1013
1014- Issue #9260: A finer-grained import lock. Most of the import sequence
1015 now uses per-module locks rather than the global import lock, eliminating
1016 well-known issues with threads and imports.
1017
1018- Issue #14624: UTF-16 decoding is now 3x to 4x faster on various inputs.
1019 Patch by Serhiy Storchaka.
1020
1021- asdl_seq and asdl_int_seq are now Py_ssize_t sized.
1022
1023- Issue #14133 (PEP 415): Implement suppression of __context__ display with an
1024 attribute on BaseException. This replaces the original mechanism of PEP 409.
1025
1026- Issue #14417: Mutating a dict during lookup now restarts the lookup instead
1027 of raising a RuntimeError (undoes issue #14205).
1028
1029- Issue #14738: Speed-up UTF-8 decoding on non-ASCII data. Patch by Serhiy
1030 Storchaka.
1031
1032- Issue #14700: Fix two broken and undefined-behaviour-inducing overflow checks
1033 in old-style string formatting.
1034
Georg Brandl86dc7322012-10-01 18:58:45 +02001035Library
1036-------
1037
1038- Issue #14690: Use monotonic clock instead of system clock in the sched,
1039 subprocess and trace modules.
1040
Georg Brandl86dc7322012-10-01 18:58:45 +02001041- Issue #14443: Tell rpmbuild to use the correct version of Python in
1042 bdist_rpm. Initial patch by Ross Lagerwall.
1043
Georg Brandl86dc7322012-10-01 18:58:45 +02001044- 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
Georg Brandl86dc7322012-10-01 18:58:45 +02001047- Issue #1672568: email now always decodes base64 payloads, adding padding and
1048 ignoring non-base64-alphabet characters if needed, and registering defects
1049 for any such problems.
1050
1051- Issue #14925: email now registers a defect when the parser decides that there
1052 is a missing header/body separator line. MalformedHeaderDefect, which the
1053 existing code would never actually generate, is deprecated.
1054
1055- Issue #10365: File open dialog now works instead of crashing even when
1056 the parent window is closed before the dialog. Patch by Roger Serwy.
1057
1058- Issue #8739: Updated smtpd to support RFC 5321, and added support for the
1059 RFC 1870 SIZE extension.
1060
1061- Issue #665194: Added a localtime function to email.utils to provide an
1062 aware local datetime for use in setting Date headers.
1063
1064- Issue #12586: Added new provisional policies that implement convenient
1065 unicode support for email headers. See What's New for details.
1066
1067- Issue #14731: Refactored email Policy framework to support full backward
1068 compatibility with Python 3.2 by default yet allow for the introduction of
1069 new features through new policies. Note that Policy.must_be_7bit is renamed
1070 to cte_type.
1071
1072- Issue #14876: Use user-selected font for highlight configuration.
1073
1074- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
1075 Have ascii characters in help.
1076
1077- Issue #14548: Make multiprocessing finalizers check pid before
1078 running to cope with possibility of gc running just after fork.
1079
Georg Brandl86dc7322012-10-01 18:58:45 +02001080- Issue #14036: Add an additional check to validate that port in urlparse does
1081 not go in illegal range and returns None.
1082
1083- Issue #14862: Add missing names to os.__all__
1084
1085- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
1086
1087- Issue #13585: Added contextlib.ExitStack
1088
1089- PEP 3144, Issue #14814: Added the ipaddress module
1090
1091- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
1092 Header in Cookie.py.
1093
1094- Issue #14588: The types module now provide new_class() and prepare_class()
1095 functions to support PEP 3115 compliant dynamic class creation. Patch by
1096 Daniel Urban and Nick Coghlan.
1097
Martin Panterc04fb562016-02-10 05:44:01 +00001098- Issue #13152: Allow specifying a custom tabsize for expanding tabs in
Georg Brandl86dc7322012-10-01 18:58:45 +02001099 textwrap. Patch by John Feuerstein.
1100
1101- Issue #14721: Send the correct 'Content-length: 0' header when the body is an
1102 empty string ''. Initial Patch contributed by Arve Knudsen.
1103
1104- Issue #14072: Fix parsing of 'tel' URIs in urlparse by making the check for
1105 ports stricter.
1106
1107- Issue #9374: Generic parsing of query and fragment portions of url for any
1108 scheme. Supported both by RFC3986 and RFC2396.
1109
1110- Issue #14798: Fix the functions in pyclbr to raise an ImportError
1111 when the first part of a dotted name is not a package. Patch by
1112 Xavier de Gaye.
1113
1114- Issue #12098: multiprocessing on Windows now starts child processes
1115 using the same sys.flags as the current process. Initial patch by
1116 Sergey Mezentsev.
1117
1118- Issue #13031: Small speed-up for tarfile when unzipping tarfiles.
1119 Patch by Justin Peel.
1120
1121- Issue #14780: urllib.request.urlopen() now has a ``cadefault`` argument
1122 to use the default certificate store. Initial patch by James Oakley.
1123
1124- Issue #14829: Fix bisect and range() indexing with large indices
1125 (>= 2 ** 32) under 64-bit Windows.
1126
1127- Issue #14732: The _csv module now uses PEP 3121 module initialization.
1128 Patch by Robin Schreiber.
1129
1130- Issue #14809: Add HTTP status codes introduced by RFC 6585 to http.server
1131 and http.client. Patch by EungJun Yi.
1132
1133- Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when
1134 accessing the Tk clipboard. Modify clipboad_get() to first request type
1135 UTF8_STRING when no specific type is requested in an X11 windowing
1136 environment, falling back to the current default type STRING if that fails.
1137 Original patch by Thomas Kluyver.
1138
1139- Issue #14773: Fix os.fwalk() failing on dangling symlinks.
1140
1141- Issue #12541: Be lenient with quotes around Realm field of HTTP Basic
1142 Authentation in urllib2.
1143
1144- Issue #14807: move undocumented tarfile.filemode() to stat.filemode() and add
1145 doc entry. Add tarfile.filemode alias with deprecation warning.
1146
1147- Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
1148
1149- Issue #14532: Add a secure_compare() helper to the hmac module, to mitigate
1150 timing attacks. Patch by Jon Oberheide.
1151
1152- Add importlib.util.resolve_name().
1153
1154- Issue #14366: Support lzma compression in zip files.
1155 Patch by Serhiy Storchaka.
1156
1157- Issue #13959: Introduce importlib.find_loader() and document
1158 imp.find_module/load_module as deprecated.
1159
1160- Issue #14082: shutil.copy2() now copies extended attributes, if possible.
1161 Patch by Hynek Schlawack.
1162
1163- Issue #13959: Make importlib.abc.FileLoader.load_module()/get_filename() and
1164 importlib.machinery.ExtensionFileLoader.load_module() have their single
1165 argument be optional. Allows for the replacement (and thus deprecation) of
1166 imp.load_source()/load_package()/load_compiled().
1167
1168- Issue #13959: imp.get_suffixes() has been deprecated in favour of the new
1169 attributes on importlib.machinery: SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
1170 OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, and EXTENSION_SUFFIXES. This
1171 led to an indirect deprecation of inspect.getmoduleinfo().
1172
1173- Issue #14662: Prevent shutil failures on OS X when destination does not
1174 support chflag operations. Patch by Hynek Schlawack.
1175
1176- Issue #14157: Fix time.strptime failing without a year on February 29th.
1177 Patch by Hynek Schlawack.
1178
1179- Issue #14753: Make multiprocessing's handling of negative timeouts
1180 the same as it was in Python 3.2.
1181
1182- Issue #14583: Fix importlib bug when a package's __init__.py would first
1183 import one of its modules then raise an error.
1184
1185- Issue #14741: Fix missing support for Ellipsis ('...') in parser module.
1186
1187- Issue #14697: Fix missing support for set displays and set comprehensions in
1188 parser module.
1189
1190- Issue #14701: Fix missing support for 'raise ... from' in parser module.
1191
1192- Add support for timeouts to the acquire() methods of
1193 multiprocessing's lock/semaphore/condition proxies.
1194
1195- Issue #13989: Add support for text mode to gzip.open().
1196
1197- Issue #14127: The os.stat() result object now provides three additional
1198 fields: st_ctime_ns, st_mtime_ns, and st_atime_ns, providing those times as an
1199 integer with nanosecond resolution. The functions os.utime(), os.lutimes(),
1200 and os.futimes() now accept a new parameter, ns, which accepts mtime and atime
1201 as integers with nanosecond resolution.
1202
1203- Issue #14127 and #10148: shutil.copystat now preserves exact mtime and atime
1204 on filesystems providing nanosecond resolution.
1205
Victor Stinner554fd082014-03-17 22:33:49 +01001206IDLE
1207----
1208
1209- Issue #14958: Change IDLE systax highlighting to recognize all string and
1210 byte literals supported in Python 3.3.
1211
1212- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
1213
1214- Issue #14929: Stop IDLE 3.x from closing on Unicode decode errors when
1215 grepping. Patch by Roger Serwy.
1216
1217- Issue #12510: Attempting to get invalid tooltip no longer closes IDLE.
1218 Other tooltipss have been corrected or improved and the number of tests
1219 has been tripled. Original patch by Roger Serwy.
1220
Georg Brandl86dc7322012-10-01 18:58:45 +02001221Tools/Demos
1222-----------
1223
1224- Issue #14695: Bring Tools/parser/unparse.py support up to date with
1225 the Python 3.3 Grammar.
1226
1227Build
1228-----
1229
1230- Issue #14472: Update .gitignore. Patch by Matej Cepl.
1231
1232- Upgrade Windows library versions: bzip 1.0.6, OpenSSL 1.0.1c.
1233
1234- Issue #14693: Under non-Windows platforms, hashlib's fallback modules are
1235 always compiled, even if OpenSSL is present at build time.
1236
1237- Issue #13210: Windows build now uses VS2010, ported from VS2008.
1238
Victor Stinner554fd082014-03-17 22:33:49 +01001239C-API
1240-----
1241
1242- Issue #14705: The PyArg_Parse() family of functions now support the 'p' format
1243 unit, which accepts a "boolean predicate" argument. It converts any Python
1244 value into an integer--0 if it is "false", and 1 otherwise.
1245
Georg Brandl86dc7322012-10-01 18:58:45 +02001246Documentation
1247-------------
1248
Victor Stinner554fd082014-03-17 22:33:49 +01001249- Issue #14863: Update the documentation of os.fdopen() to reflect the
1250 fact that it's only a thin wrapper around open() anymore.
1251
Georg Brandl86dc7322012-10-01 18:58:45 +02001252- Issue #14588: The language reference now accurately documents the Python 3
1253 class definition process. Patch by Nick Coghlan.
1254
1255- Issue #14943: Correct a default argument value for winreg.OpenKey
1256 and correctly list the argument names in the function's explanation.
1257
1258
1259What's New in Python 3.3.0 Alpha 3?
1260===================================
1261
1262*Release date: 01-May-2012*
1263
1264Core and Builtins
1265-----------------
1266
1267- Issue #14699: Fix calling the classmethod descriptor directly.
1268
1269- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin is closed.
1270
1271- Issue #14521: Make result of float('nan') and float('-nan') more consistent
1272 across platforms.
1273
1274- Issue #14646: __import__() sets __loader__ if the loader did not.
1275
1276- Issue #14605: No longer have implicit entries in sys.meta_path. If
1277 sys.meta_path is found to be empty, raise ImportWarning.
1278
1279- Issue #14605: No longer have implicit entries in sys.path_hooks. If
1280 sys.path_hooks is found to be empty, a warning will be raised. None is now
1281 inserted into sys.path_importer_cache if no finder was discovered. This also
1282 means imp.NullImporter is no longer implicitly used.
1283
1284- Issue #13903: Implement PEP 412. Individual dictionary instances can now share
1285 their keys with other dictionaries. Classes take advantage of this to share
1286 their instance dictionary keys for improved memory and performance.
1287
1288- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
1289 when repr() or str() is called on such an object.
1290
1291- Issue #14658: Fix binding a special method to a builtin implementation of a
1292 special method with a different name.
1293
1294- Issue #14630: Fix a memory access bug for instances of a subclass of int
1295 with value 0.
1296
1297- Issue #14339: Speed improvements to bin, oct and hex functions. Patch by
1298 Serhiy Storchaka.
1299
Georg Brandl86dc7322012-10-01 18:58:45 +02001300- Issue #14385: It is now possible to use a custom type for the __builtins__
1301 namespace, instead of a dict. It can be used for sandboxing for example.
1302 Raise also a NameError instead of ImportError if __build_class__ name if not
1303 found in __builtins__.
1304
1305- Issue #12599: Be more strict in accepting None compared to a false-like
1306 object for importlib.util.module_for_loader and
1307 importlib.machinery.PathFinder.
1308
1309- Issue #14612: Fix jumping around with blocks by setting f_lineno.
1310
1311- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
1312 globals raises a KeyError.
1313
1314- Issue #14607: Fix keyword-only arguments which started with ``__``.
1315
1316- Issue #10854: The ImportError raised when an extension module on Windows
1317 fails to import now uses the new path and name attributes from
1318 Issue #1559549.
1319
1320- Issue #13889: Check and (if necessary) set FPU control word before calling
1321 any of the dtoa.c string <-> float conversion functions, on MSVC builds of
1322 Python. This fixes issues when embedding Python in a Delphi app.
1323
1324- __import__() now matches PEP 328 and documentation by defaulting 'index' to 0
1325 instead of -1 and removing support for negative values.
1326
1327- Issue #2377: Make importlib the implementation of __import__().
1328
1329- Issue #1559549: ImportError now has 'name' and 'path' attributes that are set
1330 using keyword arguments to its constructor. They are currently not set by
1331 import as they are meant for use by importlib.
1332
1333- Issue #14474: Save and restore exception state in thread.start_new_thread()
Martin Panter7462b6492015-11-02 03:37:02 +00001334 while writing error message if the thread leaves an unhandled exception.
Georg Brandl86dc7322012-10-01 18:58:45 +02001335
1336- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
1337 by Suman Saha.
1338
1339Library
1340-------
1341
1342- Issue #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'.
1343
1344- Issue #14371: Support bzip2 in zipfile module. Patch by Serhiy Storchaka.
1345
1346- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
1347 step. Patch by Xavier de Gaye.
1348
1349- Issue #14696: Fix parser module to understand 'nonlocal' declarations.
1350
1351- Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
1352 the DST transition. Patch by Joe Peterson.
1353
1354- Issue #9154: Fix parser module to understand function annotations.
1355
1356- Issue #6085: In http.server.py SimpleHTTPServer.address_string returns the
1357 client ip address instead client hostname. Patch by Charles-François Natali.
1358
1359- Issue #14309: Deprecate time.clock(), use time.perf_counter() or
1360 time.process_time() instead.
1361
1362- Issue #14428: Implement the PEP 418. Add time.get_clock_info(),
1363 time.perf_counter() and time.process_time() functions, and rename
1364 time.steady() to time.monotonic().
1365
1366- Issue #14646: importlib.util.module_for_loader() now sets __loader__ and
1367 __package__ (when possible).
1368
1369- Issue #14664: It is now possible to use @unittest.skip{If,Unless} on a
1370 test class that doesn't inherit from TestCase (i.e. a mixin).
1371
1372- Issue #4892: multiprocessing Connections can now be transferred over
1373 multiprocessing Connections. Patch by Richard Oudkerk (sbt).
1374
1375- Issue #14160: TarFile.extractfile() failed to resolve symbolic links when
1376 the links were not located in an archive subdirectory.
1377
1378- Issue #14638: pydoc now treats non-string __name__ values as if they
1379 were missing, instead of raising an error.
1380
1381- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites
1382 which send EOF without trailing \r\n.
1383
1384- Issue #14605: Add importlib.abc.FileLoader, importlib.machinery.(FileFinder,
1385 SourceFileLoader, SourcelessFileLoader, ExtensionFileLoader).
1386
1387- Issue #13959: imp.cache_from_source()/source_from_cache() now follow
1388 os.path.join()/split() semantics for path manipulation instead of its prior,
1389 custom semantics of caring the right-most path separator forward in path
1390 joining.
1391
1392- Issue #2193: Allow ":" character in Cookie NAME values.
1393
1394- Issue #14629: tokenizer.detect_encoding will specify the filename in the
1395 SyntaxError exception if found at readline.__self__.name.
1396
1397- Issue #14629: Raise SyntaxError in tokenizer.detect_encoding if the
1398 first two lines have non-UTF-8 characters without an encoding declaration.
1399
1400- Issue #14308: Fix an exception when a "dummy" thread is in the threading
1401 module's active list after a fork().
1402
1403- Issue #11750: The Windows API functions scattered in the _subprocess and
1404 _multiprocessing.win32 modules now live in a single module "_winapi".
1405 Patch by sbt.
1406
1407- Issue #14087: multiprocessing: add Condition.wait_for(). Patch by sbt.
1408
1409- Issue #14538: HTMLParser can now parse correctly start tags that contain
1410 a bare '/'.
1411
1412- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message.
1413
1414- Issue #14386: Expose the dict_proxy internal type as types.MappingProxyType.
1415
1416- Issue #13959: Make imp.reload() always use a module's __loader__ to perform
1417 the reload.
1418
1419- Issue #13959: Add imp.py and rename the built-in module to _imp, allowing for
1420 re-implementing parts of the module in pure Python.
1421
1422- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied
1423 to a collection of size > sys.maxsize / 2.
1424
1425- Have importlib take advantage of ImportError's new 'name' and 'path'
1426 attributes.
1427
1428- Issue #14399: zipfile now recognizes that the archive has been modified even
1429 if only the comment is changed. In addition, the TypeError that results from
Terry Jan Reedy8e7586b2013-03-11 18:38:13 -04001430 trying to set a non-binary value as a comment is now raised at the time
Georg Brandl86dc7322012-10-01 18:58:45 +02001431 the comment is set rather than at the time the zipfile is written.
1432
1433- trace.CoverageResults.is_ignored_filename() now ignores any name that starts
1434 with "<" and ends with ">" instead of special-casing "<string>" and
1435 "<doctest ".
1436
1437- Issue #12537: The mailbox module no longer depends on knowledge of internal
1438 implementation details of the email package Message object.
1439
1440- Issue #7978: socketserver now restarts the select() call when EINTR is
1441 returned. This avoids crashing the server loop when a signal is received.
1442 Patch by Jerzy Kozera.
1443
1444- Issue #14522: Avoid duplicating socket handles in multiprocessing.connection.
1445 Patch by sbt.
1446
1447- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
1448
Georg Brandl86dc7322012-10-01 18:58:45 +02001449- Issue #3033: Add displayof parameter to tkinter font. Patch by Guilherme Polo.
1450
1451- Issue #14482: Raise a ValueError, not a NameError, when trying to create
1452 a multiprocessing Client or Listener with an AF_UNIX type address under
1453 Windows. Patch by Popa Claudiu.
1454
1455- Issue #802310: Generate always unique tkinter font names if not directly passed.
1456
1457- Issue #14151: Raise a ValueError, not a NameError, when trying to create
1458 a multiprocessing Client or Listener with an AF_PIPE type address under
1459 non-Windows platforms. Patch by Popa Claudiu.
1460
1461- Issue #14493: Use gvfs-open or xdg-open in webbrowser.
1462
1463Build
1464-----
1465
1466- "make touch" will now touch generated files that are checked into Mercurial,
1467 after a "hg update" which failed to bring the timestamps into the right order.
1468
1469Tests
1470-----
1471
1472- Issue #14026: In test_cmd_line_script, check that sys.argv is populated
1473 correctly for the various invocation approaches (Patch by Jason Yeo)
1474
1475- Issue #14032: Fix incorrect variable name in test_cmd_line_script debugging
1476 message (Patch by Jason Yeo)
1477
1478- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing
1479 a test failure in test_ssl.
1480
1481- Issue #14355: Regrtest now supports the standard unittest test loading, and
1482 will use it if a test file contains no `test_main` method.
1483
Victor Stinner554fd082014-03-17 22:33:49 +01001484IDLE
1485----
1486
1487- Issue #8515: Set __file__ when run file in IDLE.
1488 Initial patch by Bruce Frederiksen.
1489
1490- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
1491 Patch by Popa Claudiu.
1492
Georg Brandl86dc7322012-10-01 18:58:45 +02001493Tools / Demos
1494-------------
1495
1496- Issue #3561: The Windows installer now has an option, off by default, for
1497 placing the Python installation into the system "Path" environment variable.
1498
1499- Issue #13165: stringbench is now available in the Tools/stringbench folder.
1500 It used to live in its own SVN project.
1501
Victor Stinner554fd082014-03-17 22:33:49 +01001502C-API
1503-----
1504
1505- Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.
1506 Patch by Stefan Behnel.
1507
Georg Brandl86dc7322012-10-01 18:58:45 +02001508
1509What's New in Python 3.3.0 Alpha 2?
1510===================================
1511
1512*Release date: 01-Apr-2012*
1513
1514Core and Builtins
1515-----------------
1516
1517- Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
1518 are passed arguments and their complementary method is not overridden.
1519
1520- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
1521 the module name that was not interned.
1522
1523- Issue #14331: Use significantly less stack space when importing modules by
1524 allocating path buffers on the heap instead of the stack.
1525
1526- Issue #14334: Prevent in a segfault in type.__getattribute__ when it was not
1527 passed strings.
1528
1529- Issue #1469629: Allow cycles through an object's __dict__ slot to be
1530 collected. (For example if ``x.__dict__ is x``).
1531
1532- Issue #14205: dict lookup raises a RuntimeError if the dict is modified
1533 during a lookup.
1534
1535- Issue #14220: When a generator is delegating to another iterator with the
1536 yield from syntax, it needs to have its ``gi_running`` flag set to True.
1537
1538- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
1539 on the PyObject_Malloc() api like all other objects.
1540
1541- Issue #14471: Fix a possible buffer overrun in the winreg module.
1542
1543- Issue #14288: Allow the serialization of builtin iterators
1544
1545Library
1546-------
1547
1548- Issue #14300: Under Windows, sockets created using socket.dup() now allow
1549 overlapped I/O. Patch by sbt.
1550
1551- Issue #13872: socket.detach() now marks the socket closed (as mirrored
1552 in the socket repr()). Patch by Matt Joiner.
1553
1554- Issue #14406: Fix a race condition when using ``concurrent.futures.wait(
1555 return_when=ALL_COMPLETED)``. Patch by Matt Joiner.
1556
1557- Issue #5136: deprecate old, unused functions from tkinter.
1558
Georg Brandl86dc7322012-10-01 18:58:45 +02001559- Issue #14416: syslog now defines the LOG_ODELAY and LOG_AUTHPRIV constants
1560 if they are defined in <syslog.h>.
1561
Georg Brandl86dc7322012-10-01 18:58:45 +02001562- Issue #14295: Add unittest.mock
1563
1564- Issue #7652: Add --with-system-libmpdec option to configure for linking
1565 the _decimal module against an installed libmpdec.
1566
1567- Issue #14380: MIMEText now defaults to utf-8 when passed non-ASCII unicode
1568 with no charset specified.
1569
1570- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
1571 OSX; avoid to call handle_connect in case of a disconnected socket which
1572 was not meant to connect.
1573
1574- Issue #14204: The ssl module now has support for the Next Protocol
1575 Negotiation extension, if available in the underlying OpenSSL library.
1576 Patch by Colin Marc.
1577
1578- Issue #3035: Unused functions from tkinter are marked as pending deprecated.
1579
1580- Issue #12757: Fix the skipping of doctests when python is run with -OO so
1581 that it works in unittest's verbose mode as well as non-verbose mode.
1582
1583- Issue #7652: Integrate the decimal floating point libmpdec library to speed
1584 up the decimal module. Performance gains of the new C implementation are
1585 between 10x and 100x, depending on the application.
1586
Georg Brandl86dc7322012-10-01 18:58:45 +02001587- Issue #14269: SMTPD now conforms to the RFC and requires a HELO command
1588 before MAIL, RCPT, or DATA.
1589
1590- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
1591 attribute.
1592
1593- Issue #14344: fixed the repr of email.policy objects.
1594
1595- Issue #11686: Added missing entries to email package __all__ lists
1596 (mostly the new Bytes classes).
1597
1598- Issue #14335: multiprocessing's custom Pickler subclass now inherits from
1599 the C-accelerated implementation. Patch by sbt.
1600
1601- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem.
1602
1603- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
1604
1605- Improve the memory utilization and speed of functools.lru_cache.
1606
1607- Issue #14222: Use the new time.steady() function instead of time.time() for
1608 timeout in queue and threading modules to not be affected of system time
1609 update.
1610
1611- Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix.
1612
1613- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash
1614 table internal to the pyexpat module's copy of the expat library to avoid a
1615 denial of service due to hash collisions. Patch by David Malcolm with some
1616 modifications by the expat project.
1617
Georg Brandl86dc7322012-10-01 18:58:45 +02001618- Issue #12818: format address no longer needlessly \ escapes ()s in names when
1619 the name ends up being quoted.
1620
1621- Issue #14062: BytesGenerator now correctly folds Header objects,
1622 including using linesep when folding.
1623
1624- Issue #13839: When invoked on the command-line, the pstats module now
1625 accepts several filenames of profile stat files and merges them all.
1626 Patch by Matt Joiner.
1627
1628- Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers
1629 instead of raising an error. This fixes a regression relative to 2.7.
1630
1631- Issue #989712: Support using Tk without a mainloop.
1632
Georg Brandl86dc7322012-10-01 18:58:45 +02001633- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
1634
1635- Issue #2843: Add new Tk API to Tkinter.
1636
1637- Issue #14184: Increase the default stack size for secondary threads on
1638 Mac OS X to avoid interpreter crashes when using threads on 10.7.
1639
1640- Issue #14180: datetime.date.fromtimestamp(),
1641 datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp()
1642 now raise an OSError instead of ValueError if localtime() or gmtime() failed.
1643
1644- Issue #14180: time.ctime(), gmtime(), time.localtime(),
1645 datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and
1646 datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of
1647 a ValueError, if the timestamp does not fit in time_t.
1648
1649- Issue #14180: datetime.datetime.fromtimestamp() and
1650 datetime.datetime.utcfromtimestamp() now round microseconds towards zero
1651 instead of rounding to nearest with ties going away from zero.
1652
1653- Issue #10543: Fix unittest test discovery with Jython bytecode files.
1654
1655- Issue #1178863: Separate initialisation from setting when initializing
1656 Tkinter.Variables; harmonize exceptions to ValueError; only delete variables
1657 that have not been deleted; assert that variable names are strings.
1658
1659- Issue #14104: Implement time.monotonic() on Mac OS X, patch written by
1660 Nicholas Riley.
1661
1662- Issue #13394: the aifc module now uses warnings.warn() to signal warnings.
1663
1664- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
1665 Windows when the child process has already exited.
1666
1667- Issue #14223: curses.addch() is no more limited to the range 0-255 when the
1668 Python curses is not linked to libncursesw. It was a regression introduced
1669 in Python 3.3a1.
1670
1671- Issue #14168: Check for presence of Element._attrs in minidom before
1672 accessing it.
1673
1674- Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
1675 Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
1676 for polling multiple objects at once. Patch by sbt.
1677
1678- Issue #14007: Accept incomplete TreeBuilder objects (missing start, end,
1679 data or close method) for the Python implementation as well.
1680 Drop the no-op TreeBuilder().xml() method from the C implementation.
1681
1682- Issue #14210: pdb now has tab-completion not only for command names, but
1683 also for their arguments, wherever possible.
1684
1685- Issue #14310: Sockets can now be with other processes on Windows using
1686 the api socket.socket.share() and socket.fromshare().
1687
1688- Issue #10576: The gc module now has a 'callbacks' member that will get
1689 called when garbage collection takes place.
1690
1691Build
1692-----
1693
1694- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban.
1695
1696- Issue #14387: Do not include accu.h from Python.h.
1697
1698- Issue #14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
1699 Based on patch from Hervé Coatanhay.
1700
1701- Issue #14321: Do not run pgen during the build if files are up to date.
1702
1703Documentation
1704-------------
1705
1706- Issue #14034: added the argparse tutorial.
1707
1708- Issue #14324: Fix configure tests for cross builds.
1709
1710- Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in
1711 config.{guess,sub}. Don't use uname calls for cross builds.
1712
1713Extension Modules
1714-----------------
1715
1716- Issue #9041: An issue in ctypes.c_longdouble, ctypes.c_double, and
1717 ctypes.c_float that caused an incorrect exception to be returned in the
1718 case of overflow has been fixed.
1719
1720- Issue #14212: The re module didn't retain a reference to buffers it was
1721 scanning, resulting in segfaults.
1722
1723- Issue #14259: The finditer() method of re objects did not take any
1724 keyword arguments, contrary to the documentation.
1725
1726- Issue #10142: Support for SEEK_HOLE/SEEK_DATA (for example, under ZFS).
1727
1728Tests
1729-----
1730
1731- Issue #14442: Add missing errno import in test_smtplib.
1732
1733- Issue #8315: (partial fix) python -m unittest test.test_email now works.
1734
1735
1736What's New in Python 3.3.0 Alpha 1?
1737===================================
1738
1739*Release date: 05-Mar-2012*
1740
1741Core and Builtins
1742-----------------
1743
1744- Issue #14172: Fix reference leak when marshalling a buffer-like object
1745 (other than a bytes object).
1746
1747- Issue #13521: dict.setdefault() now does only one lookup for the given key,
1748 making it "atomic" for many purposes. Patch by Filip Gruszczyński.
1749
1750- PEP 409, Issue #6210: "raise X from None" is now supported as a means of
1751 suppressing the display of the chained exception context. The chained
1752 context still remains available as the __context__ attribute.
1753
1754- Issue #10181: New memoryview implementation fixes multiple ownership
1755 and lifetime issues of dynamically allocated Py_buffer members (#9990)
1756 as well as crashes (#8305, #7433). Many new features have been added
1757 (See whatsnew/3.3), and the documentation has been updated extensively.
1758 The ndarray test object from _testbuffer.c implements all aspects of
1759 PEP-3118, so further development towards the complete implementation
1760 of the PEP can proceed in a test-driven manner.
1761
1762 Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
1763 and many ideas.
1764
1765- Issue #12834: Fix incorrect results of memoryview.tobytes() for
1766 non-contiguous arrays.
1767
1768- Issue #5231: Introduce memoryview.cast() method that allows changing
1769 format and shape without making a copy of the underlying memory.
1770
1771- Issue #14084: Fix a file descriptor leak when importing a module with a
1772 bad encoding.
1773
1774- Upgrade Unicode data to Unicode 6.1.
1775
1776- Issue #14040: Remove rarely used file name suffixes for C extensions
1777 (under POSIX mainly).
1778
1779- Issue #14051: Allow arbitrary attributes to be set of classmethod and
1780 staticmethod.
1781
1782- Issue #13703: oCERT-2011-003: Randomize hashes of str and bytes to protect
1783 against denial of service attacks due to hash collisions within the dict and
1784 set types. Patch by David Malcolm, based on work by Victor Stinner.
1785
1786- Issue #13020: Fix a reference leak when allocating a structsequence object
1787 fails. Patch by Suman Saha.
1788
1789- Issue #13908: Ready types returned from PyType_FromSpec.
1790
1791- Issue #11235: Fix OverflowError when trying to import a source file whose
1792 modification time doesn't fit in a 32-bit timestamp.
1793
1794- Issue #12705: A SyntaxError exception is now raised when attempting to
1795 compile multiple statements as a single interactive statement.
1796
1797- Fix the builtin module initialization code to store the init function for
1798 future reinitialization.
1799
1800- Issue #8052: The posix subprocess module would take a long time closing
1801 all possible file descriptors in the child process rather than just open
1802 file descriptors. It now closes only the open fds if possible for the
1803 default close_fds=True behavior.
1804
1805- Issue #13629: Renumber the tokens in token.h so that they match the indexes
1806 into _PyParser_TokenNames.
1807
1808- Issue #13752: Add a casefold() method to str.
1809
1810- Issue #13761: Add a "flush" keyword argument to the print() function,
1811 used to ensure flushing the output stream.
1812
1813- Issue #13645: pyc files now contain the size of the corresponding source
1814 code, to avoid timestamp collisions (especially on filesystems with a low
1815 timestamp resolution) when checking for freshness of the bytecode.
1816
1817- PEP 380, Issue #11682: Add "yield from <x>" to support easy delegation to
1818 subgenerators (initial patch by Greg Ewing, integration into 3.3 by
1819 Renaud Blanch, Ryan Kelly, Zbigniew Jędrzejewski-Szmek and Nick Coghlan)
1820
1821- Issue #13748: Raw bytes literals can now be written with the ``rb`` prefix
1822 as well as ``br``.
1823
1824- Issue #12736: Use full unicode case mappings for upper, lower, and title case.
1825
1826- Issue #12760: Add a create mode to open(). Patch by David Townshend.
1827
1828- Issue #13738: Simplify implementation of bytes.lower() and bytes.upper().
1829
1830- Issue #13577: Built-in methods and functions now have a __qualname__.
1831 Patch by sbt.
1832
1833- Issue #6695: Full garbage collection runs now clear the freelist of set
1834 objects. Initial patch by Matthias Troffaes.
1835
1836- Fix OSError.__init__ and OSError.__new__ so that each of them can be
Martin Pantere26da7c2016-06-02 10:07:09 +00001837 overridden and take additional arguments (followup to issue #12555).
Georg Brandl86dc7322012-10-01 18:58:45 +02001838
1839- Fix the fix for issue #12149: it was incorrect, although it had the side
1840 effect of appearing to resolve the issue. Thanks to Mark Shannon for
1841 noticing.
1842
1843- Issue #13505: Pickle bytes objects in a way that is compatible with
1844 Python 2 when using protocols <= 2.
1845
1846- Issue #11147: Fix an unused argument in _Py_ANNOTATE_MEMORY_ORDER. (Fix
1847 given by Campbell Barton).
1848
1849- Issue #13503: Use a more efficient reduction format for bytearrays with
1850 pickle protocol >= 3. The old reduction format is kept with older protocols
1851 in order to allow unpickling under Python 2. Patch by Irmen de Jong.
1852
1853- Issue #7111: Python can now be run without a stdin, stdout or stderr
1854 stream. It was already the case with Python 2. However, the corresponding
1855 sys module entries are now set to None (instead of an unusable file object).
1856
1857- Issue #11849: Ensure that free()d memory arenas are really released
1858 on POSIX systems supporting anonymous memory mappings. Patch by
1859 Charles-François Natali.
1860
Georg Brandl86dc7322012-10-01 18:58:45 +02001861- PEP 3155 / issue #13448: Qualified name for classes and functions.
1862
1863- Issue #13436: Fix a bogus error message when an AST object was passed
1864 an invalid integer value.
1865
1866- Issue #13411: memoryview objects are now hashable when the underlying
1867 object is hashable.
1868
1869- Issue #13338: Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER
1870 to allow compiling extension modules with -Wswitch-enum on gcc.
1871 Initial patch by Floris Bruynooghe.
1872
1873- Issue #10227: Add an allocation cache for a single slice object. Patch by
1874 Stefan Behnel.
1875
1876- Issue #13393: BufferedReader.read1() now asks the full requested size to
1877 the raw stream instead of limiting itself to the buffer size.
1878
1879- Issue #13392: Writing a pyc file should now be atomic under Windows as well.
1880
1881- Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
1882 already accepts them).
1883
1884- Issue #13389: Full garbage collection passes now clear the freelists for
1885 list and dict objects. They already cleared other freelists in the
1886 interpreter.
1887
1888- Issue #13327: Remove the need for an explicit None as the second argument
1889 to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in
1890 order to update to the current time. Also added keyword argument
1891 handling to os.utimensat in order to remove the need for explicit None.
1892
1893- Issue #13350: Simplify some C code by replacing most usages of
1894 PyUnicode_Format by PyUnicode_FromFormat.
1895
1896- Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
1897 error handler in interactive mode (when calling into PyOS_Readline()).
1898
1899- Issue #9896: Add start, stop, and step attributes to range objects.
1900
1901- Issue #13343: Fix a SystemError when a lambda expression uses a global
1902 variable in the default value of a keyword-only argument: ``lambda *,
1903 arg=GLOBAL_NAME: None``
1904
1905- Issue #12797: Added custom opener parameter to builtin open() and
1906 FileIO.open().
1907
1908- Issue #10519: Avoid unnecessary recursive function calls in
1909 setobject.c.
1910
1911- Issue #10363: Deallocate global locks in Py_Finalize().
1912
1913- Issue #13018: Fix reference leaks in error paths in dictobject.c.
1914 Patch by Suman Saha.
1915
1916- Issue #13201: Define '==' and '!=' to compare range objects based on
1917 the sequence of values they define (instead of comparing based on
1918 object identity).
1919
1920- Issue #1294232: In a few cases involving metaclass inheritance, the
1921 interpreter would sometimes invoke the wrong metaclass when building a new
1922 class object. These cases now behave correctly. Patch by Daniel Urban.
1923
1924- Issue #12753: Add support for Unicode name aliases and named sequences.
1925 Both ``unicodedata.lookup()`` and '\N{...}' now resolve aliases,
1926 and ``unicodedata.lookup()`` resolves named sequences too.
1927
1928- Issue #12170: The count(), find(), rfind(), index() and rindex() methods
1929 of bytes and bytearray objects now accept an integer between 0 and 255
1930 as their first argument. Patch by Petri Lehtinen.
1931
1932- Issue #12604: VTRACE macro expanded to no-op in _sre.c to avoid compiler
1933 warnings. Patch by Josh Triplett and Petri Lehtinen.
1934
1935- Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
1936 error handlers on all Windows versions. The MBCS codec is now supporting all
1937 error handlers, instead of only replace to encode and ignore to decode.
1938
1939- Issue #13188: When called without an explicit traceback argument,
1940 generator.throw() now gets the traceback from the passed exception's
1941 ``__traceback__`` attribute. Patch by Petri Lehtinen.
1942
1943- Issue #13146: Writing a pyc file is now atomic under POSIX.
1944
1945- Issue #7833: Extension modules built using distutils on Windows will no
1946 longer include a "manifest" to prevent them failing at import time in some
1947 embedded situations.
1948
1949- PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
1950
1951- Add internal API for static strings (_Py_identifier et al.).
1952
1953- Issue #13063: the Windows error ERROR_NO_DATA (numbered 232 and described
1954 as "The pipe is being closed") is now mapped to POSIX errno EPIPE
1955 (previously EINVAL).
1956
1957- Issue #12911: Fix memory consumption when calculating the repr() of huge
1958 tuples or lists.
1959
1960- PEP 393: flexible string representation. Thanks to Torsten Becker for the
1961 initial implementation, and Victor Stinner for various bug fixes.
1962
1963- Issue #14081: The 'sep' and 'maxsplit' parameter to str.split, bytes.split,
1964 and bytearray.split may now be passed as keyword arguments.
1965
1966- Issue #13012: The 'keepends' parameter to str.splitlines may now be passed
1967 as a keyword argument: "my_string.splitlines(keepends=True)". The same
1968 change also applies to bytes.splitlines and bytearray.splitlines.
1969
1970- Issue #7732: Don't open a directory as a file anymore while importing a
Martin Panter1f1177d2015-10-31 11:48:53 +00001971 module. Ignore the directory if its name matches the module name (e.g.
Martin Panter7462b6492015-11-02 03:37:02 +00001972 "__init__.py") and raise an ImportError instead.
Georg Brandl86dc7322012-10-01 18:58:45 +02001973
1974- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for
1975 finding the bug and providing a patch.
1976
1977- Issue #12973: Fix overflow checks that relied on undefined behaviour in
1978 list_repeat (listobject.c) and islice_next (itertoolsmodule.c). These bugs
1979 caused test failures with recent versions of Clang.
1980
1981- Issue #12904: os.utime, os.futimes, os.lutimes, and os.futimesat now write
1982 atime and mtime with nanosecond precision on modern POSIX platforms.
1983
1984- Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now
1985 mapped to POSIX errno ENOTDIR (previously EINVAL).
1986
1987- Issue #9200: The str.is* methods now work with strings that contain non-BMP
1988 characters even in narrow Unicode builds.
1989
1990- Issue #12791: Break reference cycles early when a generator exits with
1991 an exception.
1992
1993- Issue #12773: Make __doc__ mutable on user-defined classes.
1994
1995- Issue #12766: Raise a ValueError when creating a class with a class variable
1996 that conflicts with a name in __slots__.
1997
1998- Issue #12266: Fix str.capitalize() to correctly uppercase/lowercase
1999 titlecased and cased non-letter characters.
2000
2001- Issue #12732: In narrow unicode builds, allow Unicode identifiers which fall
2002 outside the BMP.
2003
2004- Issue #12575: Validate user-generated AST before it is compiled.
2005
2006- Make type(None), type(Ellipsis), and type(NotImplemented) callable. They
2007 return the respective singleton instances.
2008
2009- Forbid summing bytes with sum().
2010
2011- Verify the types of AST strings and identifiers provided by the user before
2012 compiling them.
2013
2014- Issue #12647: The None object now has a __bool__() method that returns False.
2015 Formerly, bool(None) returned False only because of special case logic
2016 in PyObject_IsTrue().
2017
2018- Issue #12579: str.format_map() now raises a ValueError if used on a
2019 format string that contains positional fields. Initial patch by
2020 Julian Berman.
2021
2022- Issue #10271: Allow warnings.showwarning() be any callable.
2023
Martin Panter7462b6492015-11-02 03:37:02 +00002024- Issue #11627: Fix segfault when __new__ on an exception returns a
Georg Brandl86dc7322012-10-01 18:58:45 +02002025 non-exception class.
2026
2027- Issue #12149: Update the method cache after a type's dictionary gets
2028 cleared by the garbage collector. This fixes a segfault when an instance
2029 and its type get caught in a reference cycle, and the instance's
2030 deallocator calls one of the methods on the type (e.g. when subclassing
2031 IOBase). Diagnosis and patch by Davide Rizzo.
2032
Victor Stinner554fd082014-03-17 22:33:49 +01002033- Issue #9611, Issue #9015: FileIO.read() clamps the length to INT_MAX on Windows.
Georg Brandl86dc7322012-10-01 18:58:45 +02002034
2035- Issue #9642: Uniformize the tests on the availability of the mbcs codec, add
2036 a new HAVE_MBCS define.
2037
2038- Issue #9642: Fix filesystem encoding initialization: use the ANSI code page
2039 on Windows if the mbcs codec is not available, and fail with a fatal error if
2040 we cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
2041 instead of using UTF-8.
2042
2043- When a generator yields, do not retain the caller's exception state on the
2044 generator.
2045
2046- Issue #12475: Prevent generators from leaking their exception state into the
2047 caller's frame as they return for the last time.
2048
2049- Issue #12291: You can now load multiple marshalled objects from a stream,
2050 with other data interleaved between marshalled objects.
2051
2052- Issue #12356: When required positional or keyword-only arguments are not
Martin Panter7462b6492015-11-02 03:37:02 +00002053 given, produce an informative error message which includes the name(s) of the
Georg Brandl86dc7322012-10-01 18:58:45 +02002054 missing arguments.
2055
Martin Pantere26da7c2016-06-02 10:07:09 +00002056- Issue #12370: Fix super with no arguments when __class__ is overridden in the
Georg Brandl86dc7322012-10-01 18:58:45 +02002057 class body.
2058
2059- Issue #12084: os.stat on Windows now works properly with relative symbolic
2060 links when called from any directory.
2061
2062- Loosen type restrictions on the __dir__ method. __dir__ can now return any
2063 sequence, which will be converted to a list and sorted by dir().
2064
2065- Issue #12265: Make error messages produced by passing an invalid set of
2066 arguments to a function more informative.
2067
2068- Issue #12225: Still allow Python to build if Python is not in its hg repo or
2069 mercurial is not installed.
2070
2071- Issue #1195: my_fgets() now always clears errors before calling fgets(). Fix
2072 the following case: sys.stdin.read() stopped with CTRL+d (end of file),
2073 raw_input() interrupted by CTRL+c.
2074
2075- Issue #12216: Allow unexpected EOF errors to happen on any line of the file.
2076
2077- Issue #12199: The TryExcept and TryFinally and AST nodes have been unified
2078 into a Try node.
2079
2080- Issue #9670: Increase the default stack size for secondary threads on
2081 Mac OS X and FreeBSD to reduce the chances of a crash instead of a
2082 "maximum recursion depth" RuntimeError exception.
2083 (patch by Ronald Oussoren)
2084
2085- Issue #12106: The use of the multiple-with shorthand syntax is now reflected
2086 in the AST.
2087
2088- Issue #12190: Try to use the same filename object when compiling unmarshalling
2089 a code objects in the same file.
2090
2091- Issue #12166: Move implementations of dir() specialized for various types into
2092 the __dir__() methods of those types.
2093
2094- Issue #5715: In socketserver, close the server socket in the child process.
2095
2096- Correct lookup of __dir__ on objects. Among other things, this causes errors
2097 besides AttributeError found on lookup to be propagated.
2098
2099- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
2100 module. Patch written by Charles-François Natali.
2101
2102- Issue #1746656: Added the if_nameindex, if_indextoname, if_nametoindex
2103 methods to the socket module.
2104
2105- Issue #12044: Fixed subprocess.Popen when used as a context manager to
2106 wait for the process to end when exiting the context to avoid unintentionally
2107 leaving zombie processes around.
2108
2109- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
2110 clear the end-of-file indicator after CTRL+d.
2111
2112- Issue #1856: Avoid crashes and lockups when daemon threads run while the
2113 interpreter is shutting down; instead, these threads are now killed when
2114 they try to take the GIL.
2115
2116- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
2117 the check of the object type doesn't read the __class__ attribute anymore.
2118 Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
2119 str type). Patch written by Andreas Stührk.
2120
2121- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
2122 APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch
2123 by Charles-François Natali.
2124
2125- Issue #10914: Initialize correctly the filesystem codec when creating a new
2126 subinterpreter to fix a bootstrap issue with codecs implemented in Python, as
2127 the ISO-8859-15 codec.
2128
2129- Issue #11918: OS/2 and VMS are no more supported because of the lack of
2130 maintainer.
2131
2132- Issue #6780: fix starts/endswith error message to mention that tuples are
2133 accepted too.
2134
2135- Issue #5057: fix a bug in the peepholer that led to non-portable pyc files
2136 between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
2137 chars (e.g. "\U00012345"[0]).
2138
2139- Issue #11845: Fix typo in rangeobject.c that caused a crash in
2140 compute_slice_indices. Patch by Daniel Urban.
2141
2142- Issue #5673: Added a `timeout` keyword argument to subprocess.Popen.wait,
2143 subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and
2144 subprocess.check_output. If the blocking operation takes more than `timeout`
2145 seconds, the `subprocess.TimeoutExpired` exception is raised.
2146
2147- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
2148 (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
2149 written by Charles-Francois Natali.
2150
2151- Issue #9319: Include the filename in "Non-UTF8 code ..." syntax error.
2152
2153- Issue #10785: Store the filename as Unicode in the Python parser.
2154
2155- Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytes
2156 on Windows.
2157
2158- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and
2159 Py_DivisionWarningFlag left over from Python 2.
2160
2161- Issue #11244: Remove an unnecessary peepholer check that was preventing
2162 negative zeros from being constant-folded properly.
2163
2164- Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on
2165 Windows if the file is a TTY to workaround a Windows bug. The Windows console
2166 returns an error (12: not enough space error) on writing into stdout if
2167 stdout mode is binary and the length is greater than 66,000 bytes (or less,
2168 depending on heap usage).
2169
2170- Issue #11320: fix bogus memory management in Modules/getpath.c, leading to
2171 a possible crash when calling Py_SetPath().
2172
2173- Issue #11432: A bug was introduced in subprocess.Popen on posix systems with
2174 3.2.0 where the stdout or stderr file descriptor being the same as the stdin
2175 file descriptor would raise an exception. webbrowser.open would fail. fixed.
2176
2177- Issue #9856: Change object.__format__ with a non-empty format string
2178 to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning.
2179 In 3.4 it will be a TypeError.
2180
2181- Issue #11244: The peephole optimizer is now able to constant-fold
2182 arbitrarily complex expressions. This also fixes a 3.2 regression where
2183 operations involving negative numbers were not constant-folded.
2184
2185- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
2186 there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
2187
2188- Issue #11335: Fixed a memory leak in list.sort when the key function
2189 throws an exception.
2190
2191- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is
2192 cached into the object. Examples: str.encode(), str.encode('utf-8'),
2193 PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8",
2194 NULL).
2195
Georg Brandl86dc7322012-10-01 18:58:45 +02002196- Issue #10829: Refactor PyUnicode_FromFormat(), use the same function to parse
2197 the format string in the 3 steps, fix crashs on invalid format strings.
2198
2199- Issue #13007: whichdb should recognize gdbm 1.9 magic numbers.
2200
Georg Brandl86dc7322012-10-01 18:58:45 +02002201- 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
R David Murray4d289a22012-10-16 21:54:12 -04002207- Issue #11828: startswith and endswith now accept None as slice index.
Georg Brandl86dc7322012-10-01 18:58:45 +02002208 Patch by Torsten Becker.
2209
Georg Brandl86dc7322012-10-01 18:58:45 +02002210- Issue #11168: Remove filename debug variable from PyEval_EvalFrameEx().
2211 It encoded the Unicode filename to UTF-8, but the encoding fails on
2212 undecodable filename (on surrogate characters) which raises an unexpected
2213 UnicodeEncodeError on recursion limit.
2214
2215- Issue #11187: Remove bootstrap code (use ASCII) of
2216 PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the
2217 locale encoding) in PyUnicode_EncodeFSDefault().
2218
2219- Check for NULL result in PyType_FromSpec.
2220
2221- Issue #10516: New copy() and clear() methods for lists and bytearrays.
2222
2223- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is
2224 empty, instead of OverflowError.
2225
2226- Issue #12380: The rjust, ljust and center methods of bytes and bytearray
2227 now accept a bytearray argument.
2228
2229Library
2230-------
2231
2232- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
2233 return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
2234 fixed.
2235
2236- Issue #14166: Pickler objects now have an optional ``dispatch_table``
Martin Panterc04fb562016-02-10 05:44:01 +00002237 attribute which allows setting custom per-pickler reduction functions.
Georg Brandl86dc7322012-10-01 18:58:45 +02002238 Patch by sbt.
2239
Martin Panter6245cb32016-04-15 02:14:19 +00002240- Issue #14177: marshal.loads() now raises TypeError when given a unicode
Georg Brandl86dc7322012-10-01 18:58:45 +02002241 string. Patch by Guilherme Gonçalves.
2242
2243- Issue #13550: Remove the debug machinery from the threading module: remove
2244 verbose arguments from all threading classes and functions.
2245
2246- Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary,
2247 WeakValueDictionary) to return a better approximation when some objects
2248 are dead or dying. Moreover, the implementation is now O(1) rather than
2249 O(n).
2250
Georg Brandl86dc7322012-10-01 18:58:45 +02002251- Issue #11841: Fix comparison bug with 'rc' versions in packaging.version.
2252 Patch by Filip Gruszczyński.
2253
Georg Brandl86dc7322012-10-01 18:58:45 +02002254- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
2255 on Windows. Also fixed in packaging.
2256
2257- Issue #8033: sqlite3: Fix 64-bit integer handling in user functions
2258 on 32-bit architectures. Initial patch by Philippe Devalkeneer.
2259
2260- HTMLParser is now able to handle slashes in the start tag.
2261
2262- Issue #13641: Decoding functions in the base64 module now accept ASCII-only
2263 unicode strings. Patch by Catalin Iacob.
2264
2265- Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a
2266 new importlib.invalidate_caches() function.
2267
2268- Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in
2269 SimpleXMLRPCServer upon malformed POST request.
2270
2271- Issue #13961: Move importlib over to using os.replace() for atomic renaming.
2272
2273- Do away with ambiguous level values (as suggested by PEP 328) in
2274 importlib.__import__() by raising ValueError when level < 0.
2275
2276- Issue #2489: pty.spawn could consume 100% cpu when it encountered an EOF.
2277
2278- Issue #13014: Fix a possible reference leak in SSLSocket.getpeercert().
2279
2280- Issue #13777: Add PF_SYSTEM sockets on OS X.
2281 Patch by Michael Goderbauer.
2282
2283- Issue #13015: Fix a possible reference leak in defaultdict.__repr__.
2284 Patch by Suman Saha.
2285
2286- Issue #1326113: distutils' and packaging's build_ext commands option now
2287 correctly parses multiple values (separated by whitespace or commas) given
2288 to their --libraries option.
2289
2290- Issue #10287: nntplib now queries the server's CAPABILITIES first before
2291 sending MODE READER, and only sends it if not already in READER mode.
2292 Patch by Hynek Schlawack.
2293
2294- Issue #13993: HTMLParser is now able to handle broken end tags when
2295 strict=False.
2296
2297- Issue #13930: lib2to3 now supports writing converted output files to another
2298 directory tree as well as copying unchanged files and altering the file
2299 suffix.
2300
2301- Issue #9750: Fix sqlite3.Connection.iterdump on tables and fields
2302 with a name that is a keyword or contains quotes. Patch by Marko
2303 Kohtala.
2304
2305- Issue #10287: nntplib now queries the server's CAPABILITIES again after
2306 authenticating (since the result may change, according to RFC 4643).
2307 Patch by Hynek Schlawack.
2308
Georg Brandl86dc7322012-10-01 18:58:45 +02002309- Issue #13590: On OS X 10.7 and 10.6 with Xcode 4.2, building
2310 Distutils-based packages with C extension modules may fail because
2311 Apple has removed gcc-4.2, the version used to build python.org
2312 64-bit/32-bit Pythons. If the user does not explicitly override
2313 the default C compiler by setting the CC environment variable,
2314 Distutils will now attempt to compile extension modules with clang
2315 if gcc-4.2 is required but not found. Also as a convenience, if
2316 the user does explicitly set CC, substitute its value as the default
2317 compiler in the Distutils LDSHARED configuration variable for OS X.
2318 (Note, the python.org 32-bit-only Pythons use gcc-4.0 and the 10.4u
2319 SDK, neither of which are available in Xcode 4. This change does not
2320 attempt to override settings to support their use with Xcode 4.)
2321
2322- Issue #13960: HTMLParser is now able to handle broken comments when
2323 strict=False.
2324
Georg Brandl86dc7322012-10-01 18:58:45 +02002325- When '' is a path (e.g. in sys.path), make sure __file__ uses the current
2326 working directory instead of '' in importlib.
2327
2328- Issue #13609: Add two functions to query the terminal size:
2329 os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
2330 Patch by Zbigniew Jędrzejewski-Szmek.
2331
2332- Issue #13845: On Windows, time.time() now uses GetSystemTimeAsFileTime()
2333 instead of ftime() to have a resolution of 100 ns instead of 1 ms (the clock
2334 accuracy is between 0.5 ms and 15 ms).
2335
2336- Issue #13846: Add time.monotonic(), monotonic clock.
2337
2338- Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on
2339 Connection sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to
2340 make sure two listeners can't bind to the same socket/pipe (or any existing
2341 socket/pipe).
2342
Georg Brandl86dc7322012-10-01 18:58:45 +02002343- Issue #10811: Fix recursive usage of cursors. Instead of crashing,
2344 raise a ProgrammingError now.
2345
Georg Brandl86dc7322012-10-01 18:58:45 +02002346- Issue #13734: Add os.fwalk(), a directory walking function yielding file
2347 descriptors.
2348
2349- Issue #2945: Make the distutils upload command aware of bdist_rpm products.
2350
2351- Issue #13712: pysetup create should not convert package_data to extra_files.
2352
2353- Issue #11805: package_data in setup.cfg should allow more than one value.
2354
Georg Brandl86dc7322012-10-01 18:58:45 +02002355- Issue #13676: Handle strings with embedded zeros correctly in sqlite3.
2356
Georg Brandl86dc7322012-10-01 18:58:45 +02002357- Issue #8828: Add new function os.replace(), for cross-platform renaming
2358 with overwriting.
2359
2360- Issue #13848: open() and the FileIO constructor now check for NUL
2361 characters in the file name. Patch by Hynek Schlawack.
2362
2363- Issue #13806: The size check in audioop decompression functions was too
2364 strict and could reject valid compressed data. Patch by Oleg Plakhotnyuk.
2365
2366- Issue #13812: When a multiprocessing Process child raises an exception,
2367 flush stderr after printing the exception traceback.
2368
2369- Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
2370 IV attack countermeasure.
2371
2372- Issue #13847: time.localtime() and time.gmtime() now raise an OSError instead
2373 of ValueError on failure. time.ctime() and time.asctime() now raises an
2374 OSError if localtime() failed. time.clock() now raises a RuntimeError if the
2375 processor time used is not available or its value cannot be represented
2376
Georg Brandl86dc7322012-10-01 18:58:45 +02002377- Issue #13772: In os.symlink() under Windows, do not try to guess the link
2378 target's type (file or directory). The detection was buggy and made the
2379 call non-atomic (therefore prone to race conditions).
2380
2381- Issue #6631: Disallow relative file paths in urllib urlopen methods.
2382
2383- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
2384 registry.
2385
2386- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
2387 opening for writing using a fileobj returned by os.fdopen().
2388
2389- Issue #13803: Under Solaris, distutils doesn't include bitness
2390 in the directory name.
2391
2392- Issue #10278: Add time.wallclock() function, monotonic clock.
2393
2394- Issue #13809: Fix regression where bz2 module wouldn't work when threads are
2395 disabled. Original patch by Amaury Forgeot d'Arc.
2396
2397- Issue #13589: Fix some serialization primitives in the aifc module.
2398 Patch by Oleg Plakhotnyuk.
2399
2400- Issue #13642: Unquote before b64encoding user:password during Basic
2401 Authentication. Patch contributed by Joonas Kuorilehto.
2402
Georg Brandl86dc7322012-10-01 18:58:45 +02002403- Issue #12364: Fix a hang in concurrent.futures.ProcessPoolExecutor.
2404 The hang would occur when retrieving the result of a scheduled future after
2405 the executor had been shut down.
2406
2407- Issue #13502: threading: Fix a race condition in Event.wait() that made it
2408 return False when the event was set and cleared right after.
2409
2410- Issue #9993: When the source and destination are on different filesystems,
2411 and the source is a symlink, shutil.move() now recreates a symlink on the
2412 destination instead of copying the file contents. Patch by Jonathan Niehof
2413 and Hynek Schlawack.
2414
2415- Issue #12926: Fix a bug in tarfile's link extraction.
2416
2417- Issue #13696: Fix the 302 Relative URL Redirection problem.
2418
2419- Issue #13636: Weak ciphers are now disabled by default in the ssl module
2420 (except when SSLv2 is explicitly asked for).
2421
2422- Issue #12715: Add an optional symlinks argument to shutil functions
2423 (copyfile, copymode, copystat, copy, copy2). When that parameter is
2424 true, symlinks aren't dereferenced and the operation instead acts on the
2425 symlink itself (or creates one, if relevant). Patch by Hynek Schlawack.
2426
2427- Add a flags parameter to select.epoll.
2428
Georg Brandl86dc7322012-10-01 18:58:45 +02002429- Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
2430 SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
2431
2432- Issue #11006: Don't issue low level warning in subprocess when pipe2() fails.
2433
2434- Issue #13620: Support for Chrome browser in webbrowser. Patch contributed
2435 by Arnaud Calmettes.
2436
2437- Issue #11829: Fix code execution holes in inspect.getattr_static for
2438 metaclasses with metaclasses. Patch by Andreas Stührk.
2439
2440- Issue #12708: Add starmap() and starmap_async() methods (similar to
2441 itertools.starmap()) to multiprocessing.Pool. Patch by Hynek Schlawack.
2442
2443- Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
2444
2445- Issue #13637: "a2b" functions in the binascii module now accept ASCII-only
2446 unicode strings.
2447
2448- Issue #13634: Add support for querying and disabling SSL compression.
2449
2450- Issue #13627: Add support for SSL Elliptic Curve-based Diffie-Hellman
2451 key exchange, through the SSLContext.set_ecdh_curve() method and the
2452 ssl.OP_SINGLE_ECDH_USE option.
2453
2454- Issue #13635: Add ssl.OP_CIPHER_SERVER_PREFERENCE, so that SSL servers
2455 choose the cipher based on their own preferences, rather than on the
2456 client's.
2457
2458- Issue #11813: Fix inspect.getattr_static for modules. Patch by Andreas
2459 Stührk.
2460
2461- Issue #7502: Fix equality comparison for DocTestCase instances. Patch by
2462 Cédric Krier.
2463
2464- Issue #11870: threading: Properly reinitialize threads internal locks and
2465 condition variables to avoid deadlocks in child processes.
2466
2467- Issue #8035: urllib: Fix a bug where the client could remain stuck after a
2468 redirection or an error.
2469
2470- Issue #13560: os.strerror() now uses the current locale encoding instead of
2471 UTF-8.
2472
Georg Brandl86dc7322012-10-01 18:58:45 +02002473- Issue #8373: The filesystem path of AF_UNIX sockets now uses the filesystem
2474 encoding and the surrogateescape error handler, rather than UTF-8. Patch
2475 by David Watson.
2476
2477- Issue #10350: Read and save errno before calling a function which might
2478 overwrite it. Original patch by Hallvard B Furuseth.
2479
2480- Issue #11610: Introduce a more general way to declare abstract properties.
2481
2482- Issue #13591: A bug in importlib has been fixed that caused import_module
2483 to load a module twice.
2484
Martin Panter4e525582016-05-22 03:01:52 +00002485- Issue #13449: sched.scheduler.run() method has a new "blocking" parameter which
Georg Brandl86dc7322012-10-01 18:58:45 +02002486 when set to False makes run() execute the scheduled events due to expire
2487 soonest (if any) and then return. Patch by Giampaolo Rodolà.
2488
Martin Panter4e525582016-05-22 03:01:52 +00002489- Issue #8684: sched.scheduler class can be safely used in multi-threaded
Georg Brandl86dc7322012-10-01 18:58:45 +02002490 environments. Patch by Josiah Carlson and Giampaolo Rodolà.
2491
2492- Alias resource.error to OSError ala PEP 3151.
2493
2494- Issue #5689: Add support for lzma compression to the tarfile module.
2495
2496- Issue #13248: Turn 3.2's PendingDeprecationWarning into 3.3's
2497 DeprecationWarning. It covers 'cgi.escape', 'importlib.abc.PyLoader',
2498 'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
2499 and private attributes of 'smtpd.SMTPChannel'.
2500
Victor Stinner554fd082014-03-17 22:33:49 +01002501- Issue #5905, Issue #13560: time.strftime() is now using the current locale
Georg Brandl86dc7322012-10-01 18:58:45 +02002502 encoding, instead of UTF-8, if the wcsftime() function is not available.
2503
Georg Brandl86dc7322012-10-01 18:58:45 +02002504- Issue #13464: Add a readinto() method to http.client.HTTPResponse. Patch
2505 by Jon Kuhn.
2506
2507- tarfile.py: Correctly detect bzip2 compressed streams with blocksizes
2508 other than 900k.
2509
2510- Issue #13439: Fix many errors in turtle docstrings.
2511
2512- Issue #6715: Add a module 'lzma' for compression using the LZMA algorithm.
2513 Thanks to Per Øyvind Karlsen for the initial implementation.
2514
2515- Issue #13487: Make inspect.getmodule robust against changes done to
2516 sys.modules while it is iterating over it.
2517
2518- Issue #12618: Fix a bug that prevented py_compile from creating byte
2519 compiled files in the current directory. Initial patch by Sjoerd de Vries.
2520
2521- Issue #13444: When stdout has been closed explicitly, we should not attempt
2522 to flush it at shutdown and print an error.
2523
2524- Issue #12567: The curses module uses Unicode functions for Unicode arguments
2525 when it is linked to the ncurses library. It encodes also Unicode strings to
2526 the locale encoding instead of UTF-8.
2527
2528- Issue #12856: Ensure child processes do not inherit the parent's random
2529 seed for filename generation in the tempfile module. Patch by Brian
2530 Harring.
2531
2532- Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size
2533 parameter, as other file-like objects. Patch by Ryan Kelly.
2534
2535- Issue #13458: Fix a memory leak in the ssl module when decoding a
2536 certificate with a subjectAltName. Patch by Robert Xiao.
2537
2538- Issue #13415: os.unsetenv() doesn't ignore errors anymore.
2539
2540- Issue #13245: sched.scheduler class constructor's timefunc and
2541 delayfunct parameters are now optional.
2542 scheduler.enter and scheduler.enterabs methods gained a new kwargs parameter.
2543 Patch contributed by Chris Clark.
2544
2545- Issue #12328: Under Windows, refactor handling of Ctrl-C events and
2546 make _multiprocessing.win32.WaitForMultipleObjects interruptible when
2547 the wait_flag parameter is false. Patch by sbt.
2548
2549- Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
2550 raised when the wrapped raw file is non-blocking and the write would block.
2551 Previous code assumed that the raw write() would raise BlockingIOError, but
2552 RawIOBase.write() is defined to returned None when the call would block.
2553 Patch by sbt.
2554
2555- Issue #13358: HTMLParser now calls handle_data only once for each CDATA.
2556
2557- Issue #4147: minidom's toprettyxml no longer adds whitespace around a text
2558 node when it is the only child of an element. Initial patch by Dan
2559 Kenigsberg.
2560
2561- Issue #13374: The Windows bytes API has been deprecated in the os module. Use
2562 Unicode filenames instead of bytes filenames to not depend on the ANSI code
2563 page anymore and to support any filename.
2564
2565- Issue #13297: Use bytes type to send and receive binary data through XMLRPC.
2566
2567- Issue #6397: Support "/dev/poll" polling objects in select module,
2568 under Solaris & derivatives.
2569
2570- Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
2571 handles non-valid attributes, including adjacent and unquoted attributes.
2572
2573- Issue #13193: Fix distutils.filelist.FileList and packaging.manifest.Manifest
2574 under Windows.
2575
2576- Issue #13384: Remove unnecessary __future__ import in Lib/random.py
2577
2578- Issue #13149: Speed up append-only StringIO objects.
2579
2580- Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
2581 when called with a timeout. Patch by Arnaud Ysmal.
2582
2583- Issue #13254: Fix Maildir initialization so that maildir contents
2584 are read correctly.
2585
2586- Issue #3067: locale.setlocale() now raises TypeError if the second
2587 argument is an invalid iterable. Its documentation and docstring
2588 were also updated. Initial patch by Jyrki Pulliainen.
2589
2590- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.
2591
2592- Issue #13339: Fix compile error in posixmodule.c due to missing semicolon.
2593 Thanks to Robert Xiao.
2594
2595- Byte compilation in packaging is now isolated from the calling Python -B or
2596 -O options, instead of being disallowed under -B or buggy under -O.
2597
2598- Issue #10570: curses.putp() and curses.tparm() are now expecting a byte
2599 string, instead of a Unicode string.
2600
2601- Issue #13295: http.server now produces valid HTML 4.01 strict.
2602
2603- Issue #2892: preserve iterparse events in case of SyntaxError.
2604
2605- Issue #13287: urllib.request and urllib.error now contains an __all__
2606 attribute to expose only relevant classes and functions. Patch by Florent
2607 Xicluna.
2608
2609- Issue #670664: Fix HTMLParser to correctly handle the content of
2610 ``<script>...</script>`` and ``<style>...</style>``.
2611
2612- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even
2613 when reporthook is None. Patch by Jyrki Pulliainen.
2614
Georg Brandl86dc7322012-10-01 18:58:45 +02002615- Fix the xmlrpc.client user agent to return something similar to
2616 urllib.request user agent: "Python-xmlrpc/3.3".
2617
2618- Issue #13293: Better error message when trying to marshal bytes using
2619 xmlrpc.client.
2620
2621- Issue #13291: NameError in xmlrpc package.
2622
2623- Issue #13258: Use callable() built-in in the standard library.
2624
2625- Issue #13273: fix a bug that prevented HTMLParser to properly detect some
2626 tags when strict=False.
2627
2628- Issue #11183: Add finer-grained exceptions to the ssl module, so that
2629 you don't have to inspect the exception's attributes in the common case.
2630
2631- Issue #13216: Add cp65001 codec, the Windows UTF-8 (CP_UTF8).
2632
2633- Issue #13226: Add RTLD_xxx constants to the os module. These constants can be
2634 used with sys.setdlopenflags().
2635
2636- Issue #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to
2637 the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a
2638 monotonic clock
2639
2640- Issue #10332: multiprocessing: fix a race condition when a Pool is closed
2641 before all tasks have completed.
2642
2643- Issue #13255: wrong docstrings in array module.
2644
2645- Issue #8540: Remove deprecated Context._clamp attribute in Decimal module.
2646
R David Murray435ee1f2012-10-06 18:20:08 -04002647- Issue #13235: Added DeprecationWarning to logging.warn() method and function.
Georg Brandl86dc7322012-10-01 18:58:45 +02002648
2649- Issue #9168: now smtpd is able to bind privileged port.
2650
2651- Issue #12529: fix cgi.parse_header issue on strings with double-quotes and
2652 semicolons together. Patch by Ben Darnell and Petri Lehtinen.
2653
Martin Panter7462b6492015-11-02 03:37:02 +00002654- Issue #13227: functools.lru_cache() now has an option to distinguish
Georg Brandl86dc7322012-10-01 18:58:45 +02002655 calls with different argument types.
2656
2657- Issue #6090: zipfile raises a ValueError when a document with a timestamp
2658 earlier than 1980 is provided. Patch contributed by Petri Lehtinen.
2659
2660- Issue #13150: sysconfig no longer parses the Makefile and config.h files
2661 when imported, instead doing it at build time. This makes importing
2662 sysconfig faster and reduces Python startup time by 20%.
2663
2664- Issue #12448: smtplib now flushes stdout while running ``python -m smtplib``
2665 in order to display the prompt correctly.
2666
2667- Issue #12454: The mailbox module is now using ASCII, instead of the locale
R David Murray435ee1f2012-10-06 18:20:08 -04002668 encoding, to read and write .mh_sequences files.
Georg Brandl86dc7322012-10-01 18:58:45 +02002669
2670- Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
2671 now available on Windows.
2672
R David Murray435ee1f2012-10-06 18:20:08 -04002673- Issue #1673007: urllib.request now supports HEAD request via new method argument.
Georg Brandl86dc7322012-10-01 18:58:45 +02002674 Patch contributions by David Stanek, Patrick Westerhoff and Ezio Melotti.
2675
2676- Issue #12386: packaging does not fail anymore when writing the RESOURCES
2677 file.
2678
2679- Issue #13158: Fix decoding and encoding of GNU tar specific base-256 number
2680 fields in tarfile.
2681
2682- Issue #13025: mimetypes is now reading MIME types using the UTF-8 encoding,
2683 instead of the locale encoding.
2684
2685- Issue #10653: On Windows, use strftime() instead of wcsftime() because
2686 wcsftime() doesn't format time zone correctly.
2687
2688- Issue #13150: The tokenize module doesn't compile large regular expressions
2689 at startup anymore.
2690
2691- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was
2692 configured with different prefix and exec-prefix.
2693
2694- Issue #11254: Teach distutils and packaging to compile .pyc and .pyo files in
2695 PEP 3147-compliant __pycache__ directories.
2696
2697- Issue #7367: Fix pkgutil.walk_paths to skip directories whose
2698 contents cannot be read.
2699
2700- Issue #3163: The struct module gets new format characters 'n' and 'N'
2701 supporting C integer types ``ssize_t`` and ``size_t``, respectively.
2702
2703- Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
2704 Reported and diagnosed by Thomas Kluyver.
2705
2706- Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
2707 if the underlying raw stream is unseekable, even if the seek could be
2708 satisfied using the internal buffer. Patch by John O'Connor.
2709
2710- Issue #7689: Allow pickling of dynamically created classes when their
2711 metaclass is registered with copyreg. Patch by Nicolas M. Thiéry and Craig
2712 Citro.
2713
Georg Brandl86dc7322012-10-01 18:58:45 +02002714- Issue #13034: When decoding some SSL certificates, the subjectAltName
2715 extension could be unreported.
2716
Georg Brandl86dc7322012-10-01 18:58:45 +02002717- Issue #12306: Expose the runtime version of the zlib C library as a constant,
2718 ZLIB_RUNTIME_VERSION, in the zlib module. Patch by Torsten Landschoff.
2719
2720- Issue #12959: Add collections.ChainMap to collections.__all__.
2721
2722- Issue #8933: distutils' PKG-INFO files and packaging's METADATA files will
2723 now correctly report Metadata-Version: 1.1 instead of 1.0 if a Classifier or
2724 Download-URL field is present.
2725
2726- Issue #12567: Add curses.unget_wch() function. Push a character so the next
2727 get_wch() will return it.
2728
2729- Issue #9561: distutils and packaging now writes egg-info files using UTF-8,
2730 instead of the locale encoding.
2731
2732- Issue #8286: The distutils command sdist will print a warning message instead
2733 of crashing when an invalid path is given in the manifest template.
2734
2735- Issue #12841: tarfile unnecessarily checked the existence of numerical user
2736 and group ids on extraction. If one of them did not exist the respective id
2737 of the current user (i.e. root) was used for the file and ownership
2738 information was lost.
2739
2740- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
2741 more than 128 entities. Patch by Peter Otten.
2742
2743- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
2744
Georg Brandl86dc7322012-10-01 18:58:45 +02002745- Issue #12494: On error, call(), check_call(), check_output() and
2746 getstatusoutput() functions of the subprocess module now kill the process,
2747 read its status (to avoid zombis) and close pipes.
2748
2749- Issue #12720: Expose low-level Linux extended file attribute functions in os.
2750
2751- Issue #10946: The distutils commands bdist_dumb, bdist_wininst and bdist_msi
2752 now respect a --skip-build option given to bdist. The packaging commands
2753 were fixed too.
2754
2755- Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
2756 the C pickle implementation.
2757
2758- Issue #11564: Avoid crashes when trying to pickle huge objects or containers
2759 (more than 2**31 items). Instead, in most cases, an OverflowError is raised.
2760
2761- Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
2762 greater than FD_SETSIZE.
2763
2764- Issue #12839: Fix crash in zlib module due to version mismatch.
2765 Fix by Richard M. Tew.
2766
2767- Issue #9923: The mailcap module now correctly uses the platform path
2768 separator for the MAILCAP environment variable on non-POSIX platforms.
2769
2770- Issue #12835: Follow up to #6560 that unconditionally prevents use of the
2771 unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets. Patch by David
2772 Watson.
2773
2774- Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
2775 to be used if the private key is encrypted. Patch by Adam Simpkins.
2776
2777- Issue #11657: Fix sending file descriptors over 255 over a multiprocessing
2778 Pipe.
2779
2780- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by
2781 Anthony Briggs.
2782
2783- Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module
2784 when provided by the underlying platform, supporting processing of
2785 ancillary data in pure Python code. Patch by David Watson and Heiko Wundram.
2786
2787- Issue #12326: On Linux, sys.platform doesn't contain the major version
2788 anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending
2789 on the Linux version used to build Python.
2790
2791- Issue #12213: Fix a buffering bug with interleaved reads and writes that
2792 could appear on BufferedRandom streams.
2793
2794- Issue #12778: Reduce memory consumption when JSON-encoding a large
2795 container of many small objects.
2796
2797- Issue #12650: Fix a race condition where a subprocess.Popen could leak
2798 resources (FD/zombie) when killed at the wrong time.
2799
2800- Issue #12744: Fix inefficient representation of integers between 2**31 and
2801 2**63 on systems with a 64-bit C "long".
2802
2803- Issue #12646: Add an 'eof' attribute to zlib.Decompress, to make it easier to
2804 detect truncated input streams.
2805
2806- Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when
2807 the file cannot be opened.
2808
2809- Issue #12687: Fix a possible buffering bug when unpickling text mode
2810 (protocol 0, mostly) pickles.
2811
2812- Issue #10087: Fix the html output format of the calendar module.
2813
R David Murray3dc23d42012-10-06 16:30:46 -04002814- Issue #13121: add support for inplace math operators to collections.Counter.
2815
2816- Add support for unary plus and unary minus to collections.Counter.
Georg Brandl86dc7322012-10-01 18:58:45 +02002817
2818- Issue #12683: urlparse updated to include svn as schemes that uses relative
2819 paths. (svn from 1.5 onwards support relative path).
2820
2821- Issue #12655: Expose functions from sched.h in the os module: sched_yield(),
2822 sched_setscheduler(), sched_getscheduler(), sched_setparam(),
2823 sched_get_min_priority(), sched_get_max_priority(), sched_rr_get_interval(),
2824 sched_getaffinity(), sched_setaffinity().
2825
2826- Add ThreadError to threading.__all__.
2827
2828- Issues #11104, #8688: Fix the behavior of distutils' sdist command with
2829 manually-maintained MANIFEST files.
2830
2831- Issue #11281: smtplib.STMP gets source_address parameter, which adds the
2832 ability to bind to specific source address on a machine with multiple
2833 interfaces. Patch by Paulo Scardine.
2834
2835- Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow
2836 symlinks: fix it. Patch by Petri Lehtinen.
2837
2838- Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
2839 in Python code) now finds the doc of the method.
2840
R David Murrayd9c6ab42012-10-06 14:38:17 -04002841- Issue #10968: Remove indirection in threading. The public names (Event,
Georg Brandl86dc7322012-10-01 18:58:45 +02002842 Condition, etc.) used to be factory functions returning instances of hidden
R David Murrayd9c6ab42012-10-06 14:38:17 -04002843 classes (_Event, _Condition, etc.), because (if Guido recalls correctly) this
2844 code pre-dates the ability to subclass extension types. It is now possible
Victor Stinner554fd082014-03-17 22:33:49 +01002845 to inherit from these classes, without having to import the private
Georg Brandl86dc7322012-10-01 18:58:45 +02002846 underscored names like multiprocessing did.
2847
2848- Issue #9723: Add shlex.quote functions, to escape filenames and command
2849 lines.
2850
2851- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
2852
2853- Issue #12514: Use try/finally to assure the timeit module restores garbage
2854 collections when it is done.
2855
2856- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
2857 given as a low fd, it gets overwritten.
2858
Georg Brandl86dc7322012-10-01 18:58:45 +02002859- Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates)
Victor Stinner554fd082014-03-17 22:33:49 +01002860 ``Connection: close`` header.
Georg Brandl86dc7322012-10-01 18:58:45 +02002861
2862- Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling.
2863
2864- Issue #1813: Fix codec lookup under Turkish locales.
2865
2866- Issue #12591: Improve support of "universal newlines" in the subprocess
2867 module: the piped streams can now be properly read from or written to.
2868
2869- Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
2870 a read1() method), and add a *write_through* parameter to mandate
2871 unbuffered writes.
2872
2873- Issue #10883: Fix socket leaks in urllib.request when using FTP.
2874
2875- Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
2876
2877- Issue #12372: POSIX semaphores are broken on AIX: don't use them.
2878
2879- Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
2880 to get channel binding data for the current SSL session (only the
2881 "tls-unique" channel binding is implemented). This allows the implementation
2882 of certain authentication mechanisms such as SCRAM-SHA-1-PLUS. Patch by
2883 Jacek Konieczny.
2884
2885- Issue #665194: email.utils now has format_datetime and parsedate_to_datetime
2886 functions, allowing for round tripping of RFC2822 format dates.
2887
2888- Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2
2889 directory, so that "import DLFCN" and other similar imports work on
2890 Linux 3.0.
2891
2892- Issue #7484: smtplib no longer puts <> around addresses in VRFY and EXPN
2893 commands; they aren't required and in fact postfix doesn't support that form.
2894
2895- Issue #12273: Remove ast.__version__. AST changes can be accounted for by
2896 checking sys.version_info or sys._mercurial.
2897
2898- Silence spurious "broken pipe" tracebacks when shutting down a
2899 ProcessPoolExecutor.
2900
2901- Fix potential resource leaks in concurrent.futures.ProcessPoolExecutor
2902 by joining all queues and processes when shutdown() is called.
2903
2904- Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by
2905 Andreas Stührk.
2906
2907- Issue #11321: Fix a crash with multiple imports of the _pickle module when
2908 embedding Python. Patch by Andreas Stührk.
2909
2910- Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo
2911 Serna.
2912
2913- Add cgi.closelog() function to close the log file.
2914
2915- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
2916
Martin Panter7462b6492015-11-02 03:37:02 +00002917- Issue #4376: ctypes now supports nested structures in an endian different than
Georg Brandl86dc7322012-10-01 18:58:45 +02002918 the parent structure. Patch by Vlad Riscutia.
2919
2920- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
2921 TextIOWrapper to a huge value, not TypeError.
2922
2923- Issue #12504: Close file handles in a timely manner in packaging.database.
2924 This fixes a bug with the remove (uninstall) feature on Windows.
2925
2926- Issues #12169 and #10510: Factor out code used by various packaging commands
2927 to make HTTP POST requests, and make sure it uses CRLF.
2928
2929- Issue #12016: Multibyte CJK decoders now resynchronize faster. They only
2930 ignore the first byte of an invalid byte sequence. For example,
2931 b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of '\ufffd'.
2932
2933- Issue #12459: time.sleep() now raises a ValueError if the sleep length is
2934 negative, instead of an infinite sleep on Windows or raising an IOError on
2935 Linux for example, to have the same behaviour on all platforms.
2936
2937- Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support
Martin Panter7462b6492015-11-02 03:37:02 +00002938 Python scripts using an encoding different than UTF-8 (read the coding cookie
Georg Brandl86dc7322012-10-01 18:58:45 +02002939 of the script).
2940
2941- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
2942 if the process has only one pipe.
2943
2944- Issue #12467: warnings: fix a race condition if a warning is emitted at
2945 shutdown, if globals()['__file__'] is None.
2946
2947- Issue #12451: pydoc: importfile() now opens the Python script in binary mode,
2948 instead of text mode using the locale encoding, to avoid encoding issues.
2949
2950- Issue #12451: runpy: run_path() now opens the Python script in binary mode,
2951 instead of text mode using the locale encoding, to support other encodings
2952 than UTF-8 (scripts using the coding cookie).
2953
2954- Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead
2955 of the text mode (using the locale encoding) to avoid encoding issues.
2956
2957- Issue #12147: Adjust the new-in-3.2 smtplib.send_message method for better
2958 conformance to the RFCs: correctly handle Sender and Resent- headers.
2959
2960- Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
2961 the garbage collector while the Heap lock is held.
2962
R David Murray8155ff42012-10-02 18:26:31 -04002963- Issue #12462: time.sleep() now immediately calls the (Python) signal handler
Georg Brandl86dc7322012-10-01 18:58:45 +02002964 if it is interrupted by a signal, instead of having to wait until the next
2965 instruction.
2966
2967- Issue #12442: new shutil.disk_usage function, providing total, used and free
2968 disk space statistics.
2969
2970- Issue #12451: The XInclude default loader of xml.etree now decodes files from
2971 UTF-8 instead of the locale encoding if the encoding is not specified. It now
2972 also opens XML files for the parser in binary mode instead of the text mode
2973 to avoid encoding issues.
2974
2975- Issue #12451: doctest.debug_script() doesn't create a temporary file
2976 anymore to avoid encoding issues.
2977
2978- Issue #12451: pydoc.synopsis() now reads the encoding cookie if available,
2979 to read the Python script from the right encoding.
2980
2981- Issue #12451: distutils now opens the setup script in binary mode to read the
2982 encoding cookie, instead of opening it in UTF-8.
2983
2984- Issue #9516: On Mac OS X, change Distutils to no longer globally attempt to
2985 check or set the MACOSX_DEPLOYMENT_TARGET environment variable for the
2986 interpreter process. This could cause failures in non-Distutils subprocesses
2987 and was unreliable since tests or user programs could modify the interpreter
Terry Jan Reedy8e7586b2013-03-11 18:38:13 -04002988 environment after Distutils set it. Instead, have Distutils set the
Georg Brandl86dc7322012-10-01 18:58:45 +02002989 deployment target only in the environment of each build subprocess. It is
2990 still possible to globally override the default by setting
2991 MACOSX_DEPLOYMENT_TARGET before launching the interpreter; its value must be
2992 greater or equal to the default value, the value with which the interpreter
2993 was built. Also, implement the same handling in packaging.
2994
2995- Issue #12422: In the copy module, don't store objects that are their own copy
2996 in the memo dict.
2997
2998- Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.
2999
3000- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
3001 Kitada.
3002
3003- Issue #1874: email now detects and reports as a defect the presence of
3004 any CTE other than 7bit, 8bit, or binary on a multipart.
3005
3006- Issue #12383: Fix subprocess module with env={}: don't copy the environment
3007 variables, start with an empty environment.
3008
3009- Issue #11637: Fix support for importing packaging setup hooks from the
3010 project directory.
3011
3012- Issue #6771: Moved the curses.wrapper function from the single-function
3013 wrapper module into __init__, eliminating the module. Since __init__ was
3014 already importing the function to curses.wrapper, there is no API change.
3015
3016- Issue #11584: email.header.decode_header no longer fails if the header
3017 passed to it is a Header object, and Header/make_header no longer fail
3018 if given binary unknown-8bit input.
3019
3020- Issue #11700: mailbox proxy object close methods can now be called multiple
3021 times without error.
3022
3023- Issue #11767: Correct file descriptor leak in mailbox's __getitem__ method.
3024
3025- Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
3026 connection if its getresponse() method fails with a socket error. Patch
3027 written by Ezio Melotti.
3028
3029- Issue #12240: Allow multiple setup hooks in packaging's setup.cfg files.
3030 Original patch by Erik Bray.
3031
3032- Issue #9284: Allow inspect.findsource() to find the source of doctest
3033 functions.
3034
3035- Issue #11595: Fix assorted bugs in packaging.util.cfg_to_args, a
3036 compatibility helper for the distutils-packaging transition. Original patch
3037 by Erik Bray.
3038
3039- Issue #12287: In ossaudiodev, check that the device isn't closed in several
3040 methods.
3041
3042- Issue #12009: Fixed regression in netrc file comment handling.
3043
3044- Issue #12246: Warn and fail when trying to install a third-party project from
3045 an uninstalled Python (built in a source checkout). Original patch by
3046 Tshepang Lekhonkhobe.
3047
3048- Issue #10694: zipfile now ignores garbage at the end of a zipfile.
3049
3050- Issue #12283: Fixed regression in smtplib quoting of leading dots in DATA.
3051
3052- Issue #10424: Argparse now includes the names of the missing required
3053 arguments in the missing arguments error message.
3054
3055- Issue #12168: SysLogHandler now allows NUL termination to be controlled using
3056 a new 'append_nul' attribute on the handler.
3057
3058- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
3059 instead of os.stat.
3060
3061- Issue #12021: Make mmap's read() method argument optional. Patch by Petri
3062 Lehtinen.
3063
3064- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
3065 children and raises BrokenProcessPool in such a situation. Previously it
3066 would reliably freeze/deadlock.
3067
3068- Issue #12040: Expose a new attribute ``sentinel`` on instances of
3069 ``multiprocessing.Process``. Also, fix Process.join() to not use polling
3070 anymore, when given a timeout.
3071
3072- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the
3073 smtplib module. Patch by Catalin Iacob.
3074
3075- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time
3076 to compute.
3077
3078- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile,
3079 pydoc, tkinter, and xml.parsers.expat. This were useless version constants
3080 left over from the Mercurial transition
3081
3082- Named tuples now work correctly with vars().
3083
3084- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
3085 constructor has failed, e.g. because of an undeclared keyword argument. Patch
3086 written by Oleg Oshmyan.
3087
3088- Issue #12028: Make threading._get_ident() public, rename it to
3089 threading.get_ident() and document it. This function was already used using
3090 _thread.get_ident().
3091
3092- Issue #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
3093 encreset() instead of decreset().
3094
3095- Issue #12218: Removed wsgiref.egg-info.
3096
3097- Issue #12196: Add pipe2() to the os module.
3098
3099- Issue #985064: Make plistlib more resilient to faulty input plists.
3100 Patch by Mher Movsisyan.
3101
3102- Issue #1625: BZ2File and bz2.decompress() now support multi-stream files.
3103 Initial patch by Nir Aides.
3104
3105- Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available.
3106
3107- Issue #12175: FileIO.readall() now only reads the file position and size
3108 once.
3109
3110- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
3111
3112- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
3113 if the file is closed.
3114
Victor Stinner554fd082014-03-17 22:33:49 +01003115- Issue #11109: New service_action method for BaseServer, used by ForkingMixin
R David Murray6e7bd652012-10-01 21:47:57 -04003116 class for cleanup. Initial Patch by Justin Warkentin.
Georg Brandl86dc7322012-10-01 18:58:45 +02003117
3118- Issue #12045: Avoid duplicate execution of command in
3119 ctypes.util._get_soname(). Patch by Sijin Joseph.
3120
3121- Issue #10818: Remove the Tk GUI and the serve() function of the pydoc module,
3122 pydoc -g has been deprecated in Python 3.2 and it has a new enhanced web
3123 server.
3124
3125- Issue #1441530: In imaplib, read the data in one chunk to speed up large
3126 reads and simplify code.
3127
3128- Issue #12070: Fix the Makefile parser of the sysconfig module to handle
3129 correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
3130
3131- Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
3132 their encode() method anymore, but continue to call the reset() method if the
3133 final argument is True.
3134
3135- Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
3136 module.
3137
3138- Issue #6501: os.device_encoding() returns None on Windows if the application
3139 has no console.
3140
3141- Issue #12105: Add O_CLOEXEC to the os module.
3142
3143- Issue #12079: Decimal('Infinity').fma(Decimal('0'), (3.91224318126786e+19+0j))
3144 now raises TypeError (reflecting the invalid type of the 3rd argument) rather
3145 than Decimal.InvalidOperation.
3146
3147- Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
3148 to be able to unload the module.
3149
3150- Add the packaging module, an improved fork of distutils (also known as
3151 distutils2).
3152
3153- Issue #12065: connect_ex() on an SSL socket now returns the original errno
3154 when the socket's timeout expires (it used to return None).
3155
3156- Issue #8809: The SMTP_SSL constructor and SMTP.starttls() now support
3157 passing a ``context`` argument pointing to an ssl.SSLContext instance.
3158 Patch by Kasun Herath.
3159
Georg Brandl86dc7322012-10-01 18:58:45 +02003160- Issue #9516: Issue #9516: avoid errors in sysconfig when MACOSX_DEPLOYMENT_TARGET
3161 is set in shell.
3162
3163- Issue #8650: Make zlib module 64-bit clean. compress(), decompress() and
3164 their incremental counterparts now raise OverflowError if given an input
3165 larger than 4GB, instead of silently truncating the input and returning
3166 an incorrect result.
3167
3168- Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
3169 attribute when called without a max_length argument.
3170
3171- Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
3172 on a file opened in read+write mode (namely: reading, seeking a bit forward,
3173 writing, then seeking before the previous write but still within buffered
3174 data, and writing again).
3175
3176- Issue #9971: Write an optimized implementation of BufferedReader.readinto().
3177 Patch by John O'Connor.
3178
Georg Brandl86dc7322012-10-01 18:58:45 +02003179- Issue #11799: urllib.request Authentication Handlers will raise a ValueError
3180 when presented with an unsupported Authentication Scheme. Patch contributed
3181 by Yuval Greenfield.
3182
3183- Issue #10419, #6011: build_scripts command of distutils handles correctly
3184 non-ASCII path (path to the Python executable). Open and write the script in
3185 binary mode, but ensure that the shebang is decodable from UTF-8 and from the
3186 encoding of the script.
3187
Martin Panterc04fb562016-02-10 05:44:01 +00003188- Issue #8498: In socket.accept(), allow specifying 0 as a backlog value in
Georg Brandl86dc7322012-10-01 18:58:45 +02003189 order to accept exactly one connection. Patch by Daniel Evers.
3190
3191- Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
3192 instead of a RuntimeError: OSError has an errno attribute.
3193
3194- Issue #3709: add a flush_headers method to BaseHTTPRequestHandler, which
3195 manages the sending of headers to output stream and flushing the internal
3196 headers buffer. Patch contribution by Andrew Schaaf
3197
3198- Issue #11743: Rewrite multiprocessing connection classes in pure Python.
3199
3200- Issue #11164: Stop trying to use _xmlplus in the xml module.
3201
3202- Issue #11888: Add log2 function to math module. Patch written by Mark
3203 Dickinson.
3204
3205- Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional.
3206
3207- Issue #8407: The signal handler writes the signal number as a single byte
3208 instead of a nul byte into the wakeup file descriptor. So it is possible to
3209 wait more than one signal and know which signals were raised.
3210
3211- Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to the
3212 signal module.
3213
3214- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
3215 by Kasun Herath.
3216
3217- Issue #12002: ftplib's abort() method raises TypeError.
3218
3219- Issue #11916: Add a number of MacOSX specific definitions to the errno module.
3220 Patch by Pierre Carrier.
3221
3222- Issue #11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
3223 detect mtime changes by comparing to the system clock instead of to the
3224 previous value of the mtime.
3225
3226- Issue #11072: added MLSD command (RFC-3659) support to ftplib.
3227
3228- Issue #8808: The IMAP4_SSL constructor now allows passing an SSLContext
3229 parameter to control parameters of the secure channel. Patch by Sijin
3230 Joseph.
3231
3232- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
3233 file on Windows XP. As noticed in issue #10684.
3234
3235- Issue #12000: When a SSL certificate has a subjectAltName without any
3236 dNSName entry, ssl.match_hostname() should use the subject's commonName.
3237 Patch by Nicolas Bareil.
3238
3239- Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and
3240 assertWarnsRegex now accept a keyword argument 'msg' when used as context
3241 managers. Initial patch by Winston Ewert.
3242
3243- Issue #10684: shutil.move used to delete a folder on case insensitive
3244 filesystems when the source and destination name where the same except
3245 for the case.
3246
3247- Issue #11647: objects created using contextlib.contextmanager now support
3248 more than one call to the function when used as a decorator. Initial patch
3249 by Ysj Ray.
3250
3251- Issue #11930: Removed deprecated time.accept2dyear variable.
3252 Removed year >= 1000 restriction from datetime.strftime.
3253
3254- logging: don't define QueueListener if Python has no thread support.
3255
3256- functools.cmp_to_key() now works with collections.Hashable().
3257
3258- Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get
3259 around a mmap bug with sparse files. Patch written by Steffen Daode Nurpmeso.
3260
3261- Issue #8407: Add signal.pthread_sigmask() function to fetch and/or change the
3262 signal mask of the calling thread.
3263
3264- Issue #11858: configparser.ExtendedInterpolation expected lower-case section
3265 names.
3266
3267- Issue #11324: ConfigParser(interpolation=None) now works correctly.
3268
3269- Issue #11811: ssl.get_server_certificate() is now IPv6-compatible. Patch
3270 by Charles-François Natali.
3271
3272- Issue #11763: don't use difflib in TestCase.assertMultiLineEqual if the
3273 strings are too long.
3274
3275- Issue #11236: getpass.getpass responds to ctrl-c or ctrl-z on terminal.
3276
3277- Issue #11856: Speed up parsing of JSON numbers.
3278
3279- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the
3280 lock was not acquired.
3281
3282- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor
3283 of 5 to 10. Initial patch by Jonas H.
3284
3285- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
3286 release the GIL. Patch by Charles-François Natali.
3287
3288- Issue #11223: Add threading._info() function providing informations about
3289 the thread implementation.
3290
3291- Issue #11731: simplify/enhance email parser/generator API by introducing
3292 policy objects.
3293
3294- Issue #11768: The signal handler of the signal module only calls
3295 Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or
3296 parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
3297
3298- Issue #11492: fix several issues with header folding in the email package.
3299
3300- Issue #11852: Add missing imports and update tests.
3301
3302- Issue #11875: collections.OrderedDict's __reduce__ was temporarily
3303 mutating the object instead of just working on a copy.
3304
3305- Issue #11467: Fix urlparse behavior when handling urls which contains scheme
3306 specific part only digits. Patch by Santoso Wijaya.
3307
3308- collections.Counter().copy() now works correctly for subclasses.
3309
3310- Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows.
3311 Patch by Santoso Wijaya.
3312
3313- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser.
3314
3315- The bz2 module now handles 4GiB+ input buffers correctly.
3316
3317- Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when
3318 _json is not available.
3319
3320- Issue #11830: Remove unnecessary introspection code in the decimal module.
3321
3322- Issue #11703: urllib2.geturl() does not return correct url when the original
3323 url contains #fragment.
3324
3325- Issue #10019: Fixed regression in json module where an indent of 0 stopped
3326 adding newlines and acted instead like 'None'.
3327
3328- Issue #11186: pydoc ignores a module if its name contains a surrogate
3329 character in the index of modules.
3330
3331- Issue #11815: Use a light-weight SimpleQueue for the result queue in
3332 concurrent.futures.ProcessPoolExecutor.
3333
3334- Issue #5162: Treat services like frozen executables to allow child spawning
3335 from multiprocessing.forking on Windows.
3336
3337- logging.basicConfig now supports an optional 'handlers' argument taking an
3338 iterable of handlers to be added to the root logger. Additional parameter
3339 checks were also added to basicConfig.
3340
3341- Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
3342
3343- Issue #11747: Fix range formatting in difflib.context_diff() and
3344 difflib.unified_diff().
3345
3346- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
3347 worker processes: new processes would be spawned while the pool is being
3348 shut down. Patch by Charles-François Natali.
3349
3350- Issue #2650: re.escape() no longer escapes the '_'.
3351
3352- Issue #11757: select.select() now raises ValueError when a negative timeout
3353 is passed (previously, a select.error with EINVAL would be raised). Patch
3354 by Charles-François Natali.
3355
3356- Issue #7311: fix html.parser to accept non-ASCII attribute values.
3357
3358- Issue #11605: email.parser.BytesFeedParser was incorrectly converting
3359 multipart subparts with an 8-bit CTE into unicode instead of preserving the
3360 bytes.
3361
3362- Issue #1690608: email.util.formataddr is now RFC 2047 aware: it now has a
3363 charset parameter that defaults to utf-8 and is used as the charset for RFC
3364 2047 encoding when the realname contains non-ASCII characters.
3365
3366- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
3367
3368- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile
3369 to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda.
3370
3371- Issue #11707: Added a fast C version of functools.cmp_to_key().
3372 Patch by Filip Gruszczyński.
3373
3374- Issue #11688: Add sqlite3.Connection.set_trace_callback(). Patch by
3375 Torsten Landschoff.
3376
3377- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
3378 private keys.
3379
3380- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept
3381 file-like objects using a new ``fileobj`` constructor argument. Patch by
3382 Nadeem Vawda.
3383
3384- unittest.TestCase.assertSameElements has been removed.
3385
3386- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
3387 called yet: detect bootstrap (startup) issues earlier.
3388
3389- Issue #11393: Add the new faulthandler module.
3390
3391- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
3392
3393- Removed the 'strict' argument to email.parser.Parser, which has been
3394 deprecated since Python 2.4.
3395
3396- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
3397 arguments.
3398
3399- Issue #11696: Fix ID generation in msilib.
3400
3401- itertools.accumulate now supports an optional *func* argument for
3402 a user-supplied binary function.
3403
3404- Issue #11692: Remove unnecessary demo functions in subprocess module.
3405
3406- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
3407 trying to pack a negative (in-range) integer.
3408
3409- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
3410 are now zeroed on creation. This matches the behaviour specified by the
3411 documentation.
3412
3413- Issue #7639: Fix short file name generation in bdist_msi
3414
Georg Brandl86dc7322012-10-01 18:58:45 +02003415- Issue #11635: Don't use polling in worker threads and processes launched by
3416 concurrent.futures.
3417
Victor Stinner554fd082014-03-17 22:33:49 +01003418- Issue #5845: Automatically read readline configuration to enable completion
3419 in interactive mode.
3420
Georg Brandl86dc7322012-10-01 18:58:45 +02003421- Issue #6811: Allow importlib to change a code object's co_filename attribute
3422 to match the path to where the source code currently is, not where the code
3423 object originally came from.
3424
3425- Issue #8754: Have importlib use the repr of a module name in error messages.
3426
3427- Issue #11591: Prevent "import site" from modifying sys.path when python
3428 was started with -S.
3429
3430- collections.namedtuple() now adds a _source attribute to the generated
3431 class. This make the source more accessible than the outdated
3432 "verbose" option which prints to stdout but doesn't make the source
3433 string available.
3434
3435- Issue #11371: Mark getopt error messages as localizable. Patch by Filip
3436 Gruszczyński.
3437
3438- Issue #11333: Add __slots__ to collections ABCs.
3439
3440- Issue #11628: cmp_to_key generated class should use __slots__.
3441
3442- Issue #11666: let help() display named tuple attributes and methods
3443 that start with a leading underscore.
3444
3445- Issue #11662: Make urllib and urllib2 ignore redirections if the
3446 scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
3447
3448- Issue #5537: Fix time2isoz() and time2netscape() functions of
3449 httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
3450
3451- Issue #4391: Use proper gettext plural forms in optparse.
3452
3453- Issue #11127: Raise a TypeError when trying to pickle a socket object.
3454
Victor Stinner554fd082014-03-17 22:33:49 +01003455- Issue #11563: ``Connection: close`` header is sent by requests using URLOpener
Georg Brandl86dc7322012-10-01 18:58:45 +02003456 class which helps in closing of sockets after connection is over. Patch
3457 contributions by Jeff McNeil and Nadeem Vawda.
3458
3459- Issue #11459: A ``bufsize`` value of 0 in subprocess.Popen() really creates
3460 unbuffered pipes, such that select() works properly on them.
3461
3462- Issue #5421: Fix misleading error message when one of socket.sendto()'s
3463 arguments has the wrong type. Patch by Nikita Vetoshkin.
3464
3465- Issue #10812: Add some extra posix functions to the os module.
3466
3467- Issue #10979: unittest stdout buffering now works with class and module
3468 setup and teardown.
3469
Georg Brandl86dc7322012-10-01 18:58:45 +02003470- Issue #11243: fix the parameter querying methods of Message to work if
3471 the headers contain un-encoded non-ASCII data.
3472
3473- Issue #11401: fix handling of headers with no value; this fixes a regression
3474 relative to Python2 and the result is now the same as it was in Python2.
3475
3476- Issue #9298: base64 bodies weren't being folded to line lengths less than 78,
3477 which was a regression relative to Python2. Unlike Python2, the last line
3478 of the folded body now ends with a carriage return.
3479
3480- Issue #11560: shutil.unpack_archive now correctly handles the format
3481 parameter. Patch by Evan Dandrea.
3482
3483- Issue #5870: Add `subprocess.DEVNULL` constant.
3484
3485- Issue #11133: fix two cases where inspect.getattr_static can trigger code
3486 execution. Patch by Andreas Stührk.
3487
3488- Issue #11569: use absolute path to the sysctl command in multiprocessing to
3489 ensure that it will be found regardless of the shell PATH. This ensures
3490 that multiprocessing.cpu_count works on default installs of MacOSX.
3491
3492- Issue #11501: disutils.archive_utils.make_zipfile no longer fails if zlib is
3493 not installed. Instead, the zipfile.ZIP_STORED compression is used to create
3494 the ZipFile. Patch by Natalia B. Bidart.
3495
3496- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
3497 in a `with` statement. Contributed by Giampaolo Rodola.
3498
3499- Issue #11554: Fixed support for Japanese codecs; previously the body output
3500 encoding was not done if euc-jp or shift-jis was specified as the charset.
3501
Georg Brandl86dc7322012-10-01 18:58:45 +02003502- Issue #11407: `TestCase.run` returns the result object used or created.
3503 Contributed by Janathan Hartley.
3504
3505- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
3506 IP addresses in the proxy exception list.
3507
3508- Issue #11491: dbm.error is no longer raised when dbm.open is called with
3509 the "n" as the flag argument and the file exists. The behavior matches
3510 the documentation and general logic.
3511
3512- Issue #1162477: Postel Principle adjustment to email date parsing: handle the
3513 fact that some non-compliant MUAs use '.' instead of ':' in time specs.
3514
3515- Issue #11131: Fix sign of zero in decimal.Decimal plus and minus
3516 operations when the rounding mode is ROUND_FLOOR.
3517
3518- Issue #9935: Speed up pickling of instances of user-defined classes.
3519
3520- Issue #5622: Fix curses.wrapper to raise correct exception if curses
3521 initialization fails.
3522
3523- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
3524 really necessary. Patch by Charles-François Natali.
3525
3526- Issue #11391: Writing to a mmap object created with
3527 ``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
3528 TypeError. Patch by Charles-François Natali.
3529
Serhiy Storchaka14867992014-09-10 23:43:41 +03003530- Issue #9795: add context management protocol support for nntplib.NNTP class.
Georg Brandl86dc7322012-10-01 18:58:45 +02003531
3532- Issue #11306: mailbox in certain cases adapts to an inability to open
3533 certain files in read-write mode. Previously it detected this by
3534 checking for EACCES, now it also checks for EROFS.
3535
3536- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
3537 on accept(), send() and recv().
3538
3539- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().
3540
3541- Issue #8513: On UNIX, subprocess supports bytes command string.
3542
3543- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall.
3544
3545- Issue #11140: Lock.release() now raises a RuntimeError when attempting
3546 to release an unacquired lock, as claimed in the threading documentation.
3547 The _thread.error exception is now an alias of RuntimeError. Patch by
3548 Filip Gruszczyński. Patch for _dummy_thread by Aymeric Augustin.
3549
3550- Issue #8594: ftplib now provides a source_address parameter to specify which
3551 (address, port) to bind to before connecting.
3552
3553- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
3554 and make it work for non-blocking connects.
3555
3556- Issue #11297: Add collections.ChainMap().
3557
3558- Issue #10755: Add the posix.flistdir() function. Patch by Ross Lagerwall.
3559
3560- Issue #4761: Add the ``*at()`` family of functions (openat(), etc.) to the
3561 posix module. Patch by Ross Lagerwall.
3562
3563- Issue #7322: Trying to read from a socket's file-like object after a timeout
3564 occurred now raises an error instead of silently losing data.
3565
3566- Issue #11291: poplib.POP no longer suppresses errors on quit().
3567
3568- Issue #11177: asyncore's create_socket() arguments can now be omitted.
3569
3570- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread
3571 and multiprocessing.Process constructors in order to override the
3572 default behaviour of inheriting the daemonic property from the current
3573 thread/process.
3574
3575- Issue #10956: Buffered I/O classes retry reading or writing after a signal
3576 has arrived and the handler returned successfully.
3577
3578- Issue #10784: New os.getpriority() and os.setpriority() functions.
3579
3580- Issue #11114: Fix catastrophic performance of tell() on text files (up
3581 to 1000x faster in some cases). It is still one to two order of magnitudes
3582 slower than binary tell().
3583
3584- Issue #10882: Add os.sendfile function.
3585
3586- Issue #10868: Allow usage of the register method of an ABC as a class
3587 decorator.
3588
3589- Issue #11224: Fixed a regression in tarfile that affected the file-like
3590 objects returned by TarFile.extractfile() regarding performance, memory
3591 consumption and failures with the stream interface.
3592
3593- Issue #10924: Adding salt and Modular Crypt Format to crypt library.
3594 Moved old C wrapper to _crypt, and added a Python wrapper with
3595 enhanced salt generation and simpler API for password generation.
3596
3597- Issue #11074: Make 'tokenize' so it can be reloaded.
3598
3599- Issue #11085: Moved collections abstract base classes into a separate
3600 module called collections.abc, following the pattern used by importlib.abc.
3601 For backwards compatibility, the names are imported into the collections
3602 module.
3603
3604- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
3605 4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
3606 32-bit Windows.
3607
3608- Issue #11169: compileall module uses repr() to format filenames and paths to
3609 escape surrogate characters and show spaces.
3610
3611- Issue #11089: Fix performance issue limiting the use of ConfigParser()
3612 with large config files.
3613
3614- Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
3615 larger than 4GB. Patch by Nadeem Vawda.
3616
3617- Issue #11388: Added a clear() method to MutableSequence
3618
3619- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names
3620 for the names of optional and positional arguments in help messages.
3621
3622- Issue #9348: Raise an early error if argparse nargs and metavar don't match.
3623
Georg Brandl86dc7322012-10-01 18:58:45 +02003624- Issue #9026: Fix order of argparse sub-commands in help messages.
3625
3626- Issue #9347: Fix formatting for tuples in argparse type= error messages.
3627
3628- Issue #12191: Added shutil.chown() to change user and/or group owner of a
3629 given path also specifying their names.
3630
3631- Issue #13988: The _elementtree accelerator is used whenever available.
3632 Now xml.etree.cElementTree becomes a deprecated alias to ElementTree.
3633
3634Build
3635-----
3636
3637- Issue #6807: Run msisupport.mak earlier.
3638
3639- Issue #10580: Minor grammar change in Windows installer.
3640
3641- Issue #13326: Clean __pycache__ directories correctly on OpenBSD.
3642
3643- PEP 393: the configure option --with-wide-unicode is removed.
3644
3645- Issue #12852: Set _XOPEN_SOURCE to 700, instead of 600, to get POSIX 2008
3646 functions on OpenBSD (e.g. fdopendir).
3647
3648- Issue #11863: Remove support for legacy systems deprecated in Python 3.2
3649 (following PEP 11). These systems are systems using Mach C Threads,
3650 SunOS lightweight processes, GNU pth threads and IRIX threads.
3651
3652- Issue #8746: Correct faulty configure checks so that os.chflags() and
3653 os.lchflags() are once again built on systems that support these
3654 functions (BSD and OS X). Also add new stat file flags for OS X
3655 (UF_HIDDEN and UF_COMPRESSED).
3656
3657- Issue #10645: Installing Python no longer creates a
3658 Python-X.Y.Z-pyX.Y.egg-info file in the lib-dynload directory.
3659
3660- Do not accidentally include the directory containing sqlite.h twice when
3661 building sqlite3.
3662
3663- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
3664 ensure "make install" creates symlinks in --prefix bin for the "-32"
3665 files in the framework bin directory like the installer does.
3666
3667- Issue #11347: Use --no-as-needed when linking libpython3.so.
3668
3669- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
3670
3671- Issue #11268: Prevent Mac OS X Installer failure if Documentation
3672 package had previously been installed.
3673
3674- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2.
3675
Georg Brandl86dc7322012-10-01 18:58:45 +02003676IDLE
3677----
3678
Victor Stinner554fd082014-03-17 22:33:49 +01003679- Issue #14409: IDLE now properly executes commands in the Shell window
3680 when it cannot read the normal config files on startup and
3681 has to use the built-in default key bindings.
3682 There was previously a bug in one of the defaults.
3683
3684- IDLE can be launched as python -m idlelib
3685
3686- Issue #3573: IDLE hangs when passing invalid command line args
3687 (directory(ies) instead of file(s)) (Patch by Guilherme Polo)
3688
3689- Issue #14200: IDLE shell crash on printing non-BMP unicode character.
3690
3691- Issue #5219: Prevent event handler cascade in IDLE.
3692
3693- Issue #964437: Make IDLE help window non-modal.
3694 Patch by Guilherme Polo and Roger Serwy.
3695
3696- Issue #13933: IDLE auto-complete did not work with some imported
3697 module, like hashlib. (Patch by Roger Serwy)
3698
3699- Issue #13506: Add '' to path for IDLE Shell when started and restarted with Restart Shell.
3700 Original patches by Marco Scataglini and Roger Serwy.
3701
3702- Issue #4625: If IDLE cannot write to its recent file or breakpoint files,
3703 display a message popup and continue rather than crash. Original patch by
3704 Roger Serwy.
3705
3706- Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
3707 Patch by Tal Einat.
3708
3709- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart.
3710 (Patch by Roger Serwy)
3711
3712- Issue #9871: Prevent IDLE 3 crash when given byte stings
3713 with invalid hex escape sequences, like b'\x0'.
3714 (Original patch by Claudiu Popa.)
3715
3716- Issue #12636: IDLE reads the coding cookie when executing a Python script.
3717
3718- Issue #12540: Prevent zombie IDLE processes on Windows due to changes
3719 in os.kill().
3720
3721- Issue #12590: IDLE editor window now always displays the first line
3722 when opening a long file. With Tk 8.5, the first line was hidden.
3723
3724- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
3725 with Tk 8.5.
3726
3727- Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
3728 With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused
3729 IDLE to exit. Converted to valid Unicode null in PythonCmd().
3730
Georg Brandl86dc7322012-10-01 18:58:45 +02003731- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
3732 file in a package.
3733
3734Tools/Demos
3735-----------
3736
3737- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
3738 Patch by Francisco Martín Brugué.
3739
3740- Issue #13930: 2to3 is now able to write its converted output files to another
3741 directory tree as well as copying unchanged files and altering the file
3742 suffix. See its new -o, -W and --add-suffix options. This makes it more
3743 useful in many automated code translation workflows.
3744
3745- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
3746 traceback if Python is optimized.
3747
3748- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
3749 add a smarter "py-bt" command printing a classic Python traceback.
3750
3751- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
3752
3753- Issue #10639: reindent.py no longer converts newlines and will raise
3754 an error if attempting to convert a file with mixed newlines.
3755 "--newline" option added to specify new line character.
3756
3757Extension Modules
3758-----------------
3759
Victor Stinner554fd082014-03-17 22:33:49 +01003760- Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
3761 non-pydebug builds. Several extension modules now compile cleanly when
3762 assert()s are enabled in standard builds (-DDEBUG flag).
3763
Georg Brandl86dc7322012-10-01 18:58:45 +02003764- Issue #13840: The error message produced by ctypes.create_string_buffer
3765 when given a Unicode string has been fixed.
3766
3767- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
3768 Vilmos Nebehaj.
3769
3770- Issue #7777: socket: Add Reliable Datagram Sockets (PF_RDS) support.
3771
3772- Issue #13159: FileIO and BZ2Compressor/BZ2Decompressor now use a linear-time
3773 buffer growth strategy instead of a quadratic-time one.
3774
3775- Issue #10141: socket: Add SocketCAN (PF_CAN) support. Initial patch by
3776 Matthias Fuchs, updated by Tiago Gonçalves.
3777
3778- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
3779 would be finalized after the reference to its underlying BufferedRWPair's
3780 writer got cleared by the GC.
3781
3782- Issue #12881: ctypes: Fix segfault with large structure field names.
3783
3784- Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by
3785 Thomas Jarosch.
3786
3787- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
3788 Thanks to Suman Saha for finding the bug and providing a patch.
3789
3790- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
3791 file descriptor was actually received.
3792
3793- Issue #1172711: Add 'long long' support to the array module.
3794 Initial patch by Oren Tirosh and Hirokazu Yamamoto.
3795
3796- Issue #12483: ctypes: Fix a crash when the destruction of a callback
3797 object triggers the garbage collector.
3798
3799- Issue #12950: Fix passing file descriptors in multiprocessing, under
3800 OpenIndiana/Illumos.
3801
3802- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
3803 a string.
3804
3805- Issue #11241: subclasses of ctypes.Array can now be subclassed.
3806
3807- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
3808 some functions like file.write().
3809
3810- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
3811 signature. Without this, architectures where sizeof void* != sizeof int are
3812 broken. Patch given by Hallvard B Furuseth.
3813
3814- Issue #12051: Fix segfault in json.dumps() while encoding highly-nested
3815 objects using the C accelerations.
3816
3817- Issue #12017: Fix segfault in json.loads() while decoding highly-nested
3818 objects using the C accelerations.
3819
3820- Issue #1838: Prevent segfault in ctypes, when _as_parameter_ on a class is set
3821 to an instance of the class.
3822
3823Tests
3824-----
3825
Victor Stinner554fd082014-03-17 22:33:49 +01003826- Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
3827 Patch by Mikhail Novikov.
3828
3829- Issue #13447: Add a test file to host regression tests for bugs in the
3830 scripts found in the Tools directory.
3831
3832- Issue #10881: Fix test_site failure with OS X framework builds.
3833
3834- Issue #13901: Prevent test_distutils failures on OS X with --enable-shared.
3835
3836- Issue #13862: Fix spurious failure in test_zlib due to runtime/compile time
3837 minor versions not matching.
3838
3839- Issue #12804: Fix test_socket and test_urllib2net failures when running tests
3840 on a system without internet access.
3841
3842- Issue #13726: Fix the ambiguous -S flag in regrtest. It is -o/--slow for slow
3843 tests.
3844
3845- Issue #11659: Fix ResourceWarning in test_subprocess introduced by #11459.
3846 Patch by Ben Hayden.
3847
3848- Issue #11577: fix ResourceWarning triggered by improved binhex test coverage
3849
3850- Issue #11509: Significantly increase test coverage of fileinput.
3851 Patch by Denver Coneybeare at PyCon 2011 Sprints.
3852
Georg Brandl86dc7322012-10-01 18:58:45 +02003853- Issue #11689: Fix a variable scoping error in an sqlite3 test
3854
3855- Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
3856
3857- Issue #13725: Fix regrtest to recognize the documented -d flag.
3858 Patch by Erno Tukia.
3859
3860- Issue #13304: Skip test case if user site-packages disabled (-s or
3861 PYTHONNOUSERSITE). (Patch by Carl Meyer)
3862
3863- Issue #5661: Add a test for ECONNRESET/EPIPE handling to test_asyncore. Patch
3864 by Xavier de Gaye.
3865
3866- Issue #13218: Fix test_ssl failures on Debian/Ubuntu.
3867
3868- Re-enable lib2to3's test_parser.py tests, though with an expected failure
3869 (see issue 13125).
3870
3871- Issue #12656: Add tests for IPv6 and Unix sockets to test_asyncore.
3872
3873- Issue #6484: Add unit tests for mailcap module (patch by Gregory Nofi)
3874
3875- Issue #11651: Improve the Makefile test targets to run more of the test suite
3876 more quickly. The --multiprocess option is now enabled by default, reducing
3877 the amount of time needed to run the tests. "make test" and "make quicktest"
3878 now include some resource-intensive tests, but no longer run the test suite
3879 twice to check for bugs in .pyc generation. Tools/scripts/run_test.py provides
3880 an easy platform-independent way to run test suite with sensible defaults.
3881
3882- Issue #12331: The test suite for the packaging module can now run from an
3883 installed Python.
3884
3885- Issue #12331: The test suite for lib2to3 can now run from an installed
3886 Python.
3887
Martin Panterc04fb562016-02-10 05:44:01 +00003888- Issue #12626: In regrtest, allow filtering tests using a glob filter
Georg Brandl86dc7322012-10-01 18:58:45 +02003889 with the ``-m`` (or ``--match``) option. This works with all test cases
3890 using the unittest module. This is useful with long test suites
3891 such as test_io or test_subprocess.
3892
3893- Issue #12624: It is now possible to fail after the first failure when
3894 running in verbose mode (``-v`` or ``-W``), by using the ``--failfast``
3895 (or ``-G``) option to regrtest. This is useful with long test suites
3896 such as test_io or test_subprocess.
3897
3898- Issue #12587: Correct faulty test file and reference in test_tokenize.
3899 (Patch by Robert Xiao)
3900
3901- Issue #12573: Add resource checks for dangling Thread and Process objects.
3902
3903- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
3904 as the processor type on some Mac systems.
3905
3906- Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
3907 failure in name resolution.
3908
3909- Issue #11812: Solve transient socket failure to connect to 'localhost'
3910 in test_telnetlib.py.
3911
3912- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
3913
3914- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
3915 an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
3916 Web site.
3917
3918- Avoid failing in test_urllibnet.test_bad_address when some overzealous
3919 DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test
3920 is now skipped instead.
3921
3922- Issue #12440: When testing whether some bits in SSLContext.options can be
3923 reset, check the version of the OpenSSL headers Python was compiled against,
3924 rather than the runtime version of the OpenSSL library.
3925
3926- Issue #11512: Add a test suite for the cgitb module. Patch by Robbie Clemons.
3927
3928- Issue #12497: Install test/data to prevent failures of the various codecmaps
3929 tests.
3930
3931- Issue #12496: Install test/capath directory to prevent test_connect_capath
3932 testcase failure in test_ssl.
3933
3934- Issue #12469: Run wakeup and pending signal tests in a subprocess to run the
3935 test in a fresh process with only one thread and to not change signal
3936 handling of the parent process.
3937
3938- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
3939 test_tk or test_ttk_guionly under a username that is not currently logged
3940 in to the console windowserver (as may be the case under buildbot or ssh).
3941
3942- Issue #12407: Explicitly skip test_capi.EmbeddingTest under Windows.
3943
3944- Issue #12400: regrtest -W doesn't rerun the tests twice anymore, but captures
3945 the output and displays it on failure instead. regrtest -v doesn't print the
3946 error twice anymore if there is only one error.
3947
3948- Issue #12141: Install copies of template C module file so that
3949 test_build_ext of test_distutils and test_command_build_ext of
3950 test_packaging are no longer silently skipped when
3951 run outside of a build directory.
3952
3953- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
3954 Patch by Garrett Cooper.
3955
3956- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
3957 2.8 + on Mac OS X. (Patch by Ronald Oussoren)
3958
3959- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
3960 iso2022_kr).
3961
3962- Issue #12096: Fix a race condition in test_threading.test_waitfor(). Patch
3963 written by Charles-François Natali.
3964
3965- Issue #11614: import __hello__ prints "Hello World!". Patch written by
3966 Andreas Stührk.
3967
3968- Issue #5723: Improve json tests to be executed with and without accelerations.
3969
3970- Issue #12041: Make test_wait3 more robust.
3971
3972- Issue #11873: Change regex in test_compileall to fix occasional failures when
Serhiy Storchaka56a6d852014-12-01 18:28:43 +02003973 the randomly generated temporary path happened to match the regex.
Georg Brandl86dc7322012-10-01 18:58:45 +02003974
3975- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
3976 Patch written by Charles-Francois Natali.
3977
3978- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
3979 pthread_sigmask() to ensure that the SIGALRM signal is received by the main
3980 thread.
3981
3982- Issue #11811: Factor out detection of IPv6 support on the current host
3983 and make it available as ``test.support.IPV6_ENABLED``. Patch by
3984 Charles-François Natali.
3985
3986- Issue #10914: Add a minimal embedding test to test_capi.
3987
3988- Issue #11223: Skip test_lock_acquire_interruption() and
3989 test_rlock_acquire_interruption() of test_threadsignals if a thread lock is
3990 implemented using a POSIX mutex and a POSIX condition variable. A POSIX
3991 condition variable cannot be interrupted by a signal (e.g. on Linux, the
3992 futex system call is restarted).
3993
3994- Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition.
3995
3996- Fix possible "file already exists" error when running the tests in parallel.
3997
3998- Issue #11719: Fix message about unexpected test_msilib skip on non-Windows
3999 platforms. Patch by Nadeem Vawda.
4000
4001- Issue #11727: Add a --timeout option to regrtest: if a test takes more than
4002 TIMEOUT seconds, dumps the traceback of all threads and exits.
4003
4004- Issue #11653: fix -W with -j in regrtest.
4005
4006- The email test suite now lives in the Lib/test/test_email package. The test
4007 harness code has also been modernized to allow use of new unittest features.
4008
4009- regrtest now discovers test packages as well as test modules.
4010
4011- Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov.
4012
4013- New test_crashers added to exercise the scripts in the Lib/test/crashers
4014 directory and confirm they fail as expected
4015
4016- Issue #11578: added test for the timeit module. Patch by Michael Henry.
4017
4018- Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea.
4019
4020- Issue #11505: improves test coverage of string.py, increases granularity of
4021 string.Formatter tests. Initial patch by Alicia Arlen.
4022
4023- Issue #11548: Improve test coverage of the shutil module. Patch by
4024 Evan Dandrea.
4025
4026- Issue #11554: Reactivated test_email_codecs.
4027
4028- Issue #11505: improves test coverage of string.py. Patch by Alicia
4029 Arlen
4030
Victor Stinner554fd082014-03-17 22:33:49 +01004031- Issue #11490: test_subprocess.test_leaking_fds_on_error no longer gives a
Georg Brandl86dc7322012-10-01 18:58:45 +02004032 false positive if the last directory in the path is inaccessible.
4033
4034- Issue #11223: Fix test_threadsignals to fail, not hang, when the
4035 non-semaphore implementation of locks is used under POSIX.
4036
4037- Issue #10911: Add tests on CGI with non-ASCII characters. Patch written by
4038 Pierre Quentel.
4039
4040- Issue #9931: Fix hangs in GUI tests under Windows in certain conditions.
4041 Patch by Hirokazu Yamamoto.
4042
4043- Issue #10512: Properly close sockets under test.test_cgi.
4044
4045- Issue #10992: Make tests pass under coverage.
4046
4047- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due
4048 to open door files.
4049
4050- Issue #10990: Prevent tests from clobbering a set trace function.
4051
4052C-API
4053-----
4054
Victor Stinner554fd082014-03-17 22:33:49 +01004055- Issue #13452: PyUnicode_EncodeDecimal() doesn't support error handlers
4056 different than "strict" anymore. The caller was unable to compute the
4057 size of the output buffer: it depends on the error handler.
4058
4059- Issue #13560: Add PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
4060 and PyUnicode_EncodeLocale() functions to the C API to decode/encode from/to
4061 the current locale encoding.
4062
4063- Issue #10831: PyUnicode_FromFormat() supports %li, %lli and %zi formats.
4064
4065- Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from
4066 UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode).
4067 Patch written by Ray Allen.
4068
4069- Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
4070 narrow build.
4071
Georg Brandl86dc7322012-10-01 18:58:45 +02004072- Add PyObject_GenericGetDict and PyObject_GeneriSetDict. They are generic
4073 implementations for the getter and setter of a ``__dict__`` descriptor of C
4074 types.
4075
4076- Issue #13727: Add 3 macros to access PyDateTime_Delta members:
4077 PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
4078 PyDateTime_DELTA_GET_MICROSECONDS.
4079
4080- Issue #10542: Add 4 macros to work with surrogates: Py_UNICODE_IS_SURROGATE,
4081 Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE,
4082 Py_UNICODE_JOIN_SURROGATES.
4083
4084- Issue #12724: Add Py_RETURN_NOTIMPLEMENTED macro for returning NotImplemented.
4085
4086- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
4087 Mercurial.
4088
4089- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
4090 char *` instead of `char *`.
4091
4092- Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
4093
4094Documentation
4095-------------
4096
Victor Stinner554fd082014-03-17 22:33:49 +01004097- Issue #13989: Document that GzipFile does not support text mode, and give a
4098 more helpful error message when opened with an invalid mode string.
4099
4100- Issue #13921: Undocument and clean up sqlite3.OptimizedUnicode,
4101 which is obsolete in Python 3.x. It's now aliased to str for
4102 backwards compatibility.
4103
4104- Issue #12102: Document that buffered files must be flushed before being used
4105 with mmap. Patch by Steffen Daode Nurpmeso.
4106
4107- Issue #8982: Improve the documentation for the argparse Namespace object.
4108
4109- Issue #9343: Document that argparse parent parsers must be configured before
4110 their children.
4111
4112- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument. Done with
4113 great native-speaker help from R. David Murray.
4114
Georg Brandl86dc7322012-10-01 18:58:45 +02004115- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
4116 Initial patch for #13491 by Johannes Vogel.
4117
4118- Issue #13402: Document absoluteness of sys.executable.
4119
4120- Issue #13883: PYTHONCASEOK also works on OS X.
4121
R David Murray96e93672012-10-06 23:21:01 -04004122- Issue #9021: Add an introduction to the copy module documentation.
4123
4124- Issue #6005: Examples in the socket library documentation use sendall, where
4125 relevant, instead send method.
4126
4127- Issue #12798: Updated the mimetypes documentation.
4128
Georg Brandl86dc7322012-10-01 18:58:45 +02004129- Issue #12949: Document the kwonlyargcount argument for the PyCode_New
4130 C API function.
4131
4132- Issue #13513: Fix io.IOBase documentation to correctly link to the
4133 io.IOBase.readline method instead of the readline module.
4134
4135- Issue #13237: Reorganise subprocess documentation to emphasise convenience
4136 functions and the most commonly needed arguments to Popen.
4137
4138- Issue #13141: Demonstrate recommended style for socketserver examples.
4139
4140- Issue #11818: Fix tempfile examples for Python 3.
4141
4142
4143What's New in Python 3.2?
4144=========================
4145
4146*Release date: 20-Feb-2011*
4147
4148Core and Builtins
4149-----------------
4150
4151- Issue #11249: Fix potential crashes when using the limited API.
4152
4153Build
4154-----
4155
4156- Issue #11222: Fix non-framework shared library build on Mac OS X.
4157
4158- Issue #11184: Fix large-file support on AIX.
4159
4160- Issue #941346: Fix broken shared library build on AIX.
4161
4162Documentation
4163-------------
4164
4165- Issue #10709: Add updated AIX notes in Misc/README.AIX.
4166
4167
4168What's New in Python 3.2 Release Candidate 3?
4169=============================================
4170
4171*Release date: 13-Feb-2011*
4172
4173Core and Builtins
4174-----------------
4175
4176- Issue #11134: Add missing fields to typeslots.h.
4177
4178- Issue #11135: Remove redundant doc field from PyType_Spec.
4179
4180- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
4181 ABI.
4182
4183- Issue #11118: Fix bogus export of None in python3.dll.
4184
4185Library
4186-------
4187
4188- Issue #11116: any error during addition of a message to a mailbox now causes a
4189 rollback, instead of leaving the mailbox partially modified.
4190
4191- Issue #11132: Fix passing of "optimize" parameter when recursing in
4192 compileall.compile_dir().
4193
4194- Issue #11110: Fix a potential decref of a NULL in sqlite3.
4195
4196- Issue #8275: Fix passing of callback arguments with ctypes under Win64. Patch
4197 by Stan Mihai.
4198
4199Build
4200-----
4201
4202- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
4203 installers now includes a link to the installed documentation and no longer
4204 includes an Extras directory. The Tools directory is now installed in the
4205 framework under share/doc.
4206
4207- Issue #11121: Fix building with --enable-shared.
4208
4209Tests
4210-----
4211
4212- Issue #10971: test_zipimport_support is once again compatible with the refleak
4213 hunter feature of test.regrtest.
4214
4215
4216What's New in Python 3.2 Release Candidate 2?
4217=============================================
4218
4219*Release date: 30-Jan-2011*
4220
4221Core and Builtins
4222-----------------
4223
Martin Panterc04fb562016-02-10 05:44:01 +00004224- Issue #10451: memoryview objects could allow mutating a readable buffer.
Georg Brandl86dc7322012-10-01 18:58:45 +02004225 Initial patch by Ross Lagerwall.
4226
4227Library
4228-------
4229
4230- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
4231 files in binary mode, using the email package's binary support to parse
4232 arbitrary email messages. StringIO and text file input is deprecated,
4233 and string input fails early if non-ASCII characters are used, where
4234 previously it would fail when the email was processed in a later step.
4235
4236- Issue #10845: Mitigate the incompatibility between the multiprocessing
4237 module on Windows and the use of package, zipfile or directory execution
4238 by special casing main modules that actually *are* called __main__.py.
4239
4240- Issue #11045: Protect logging call against None argument.
4241
4242- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
4243 commands.
4244
4245- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
4246 preventing a confusing hung appearance on OS X with the windows
4247 obscured.
4248
4249- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
4250 menu accelerators for Open Module, Go to Line, and New Indent Width.
4251 The accelerators still work but no longer appear in the menu items.
4252
4253- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
4254
4255- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
4256 conversion.
4257
4258- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
4259 with a None body.
4260
4261- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
4262 keyword-only argument. The preceding positional argument was deprecated,
4263 so it made no sense to add filter as a positional argument.
4264
4265- Issue #11004: Repaired edge case in deque.count().
4266
4267- Issue #10974: IDLE no longer crashes if its recent files list includes files
4268 with non-ASCII characters in their path names.
4269
4270- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
4271 return sets instead of one returning a tuple and the other a frozenset.
4272
4273- Issue #10987: Fix the recursion limit handling in the _pickle module.
4274
4275- Issue #10983: Fix several bugs making tunnel requests in http.client.
4276
4277- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
4278 filenames, at bootstrap, if the codec registry is not ready yet. It is still
4279 possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
4280 for all file entries in the ZIP file.
4281
4282- Issue #10949: Improved robustness of rotating file handlers.
4283
4284- Issue #10955: Fix a potential crash when trying to mmap() a file past its
4285 length. Initial patch by Ross Lagerwall.
4286
4287- Issue #10898: Allow compiling the posix module when the C library defines
4288 a symbol named FSTAT.
4289
4290- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
4291 encoding. This is the preferred encoding of PEP 3333 and the base encoding
4292 of HTTP 1.1.
4293
4294- To match the behaviour of HTTP server, the HTTP client library now also
4295 encodes headers with iso-8859-1 (latin1) encoding. It was already doing
4296 that for incoming headers which makes this behaviour now consistent in
4297 both incoming and outgoing direction.
4298
4299- Issue #9509: argparse now properly handles IOErrors raised by
4300 argparse.FileType.
4301
4302- Issue #10961: The new pydoc server now better handles exceptions raised
4303 during request handling.
4304
4305- Issue #10680: Fix mutually exclusive arguments for argument groups in
4306 argparse.
4307
4308Build
4309-----
4310
4311- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
4312 the system-provided Python.
4313
4314
4315What's New in Python 3.2 Release Candidate 1
4316============================================
4317
4318*Release date: 16-Jan-2011*
4319
4320Core and Builtins
4321-----------------
4322
4323- Issue #10889: range indexing and slicing now works correctly on ranges with
4324 a length that exceeds sys.maxsize.
4325
4326- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
4327 class.
4328
4329- Issue #8020: Avoid a crash where the small objects allocator would read
4330 non-Python managed memory while it is being modified by another thread. Patch
4331 by Matt Bandy.
4332
4333- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
4334 io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser
4335 translates newlines (\r\n => \n).
4336
4337- Remove buffer API from stable ABI for now, see #10181.
4338
4339- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
4340 doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
4341 (length bigger than 2^31-1 bytes).
4342
4343- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
4344 stdprinter.write() clamp the length to INT_MAX on Windows.
4345
4346- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
4347 can now handle dates after 2038.
4348
4349- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
4350 PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
4351 filesystem encoding instead of UTF-8.
4352
4353- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
4354 encoding instead of UTF-8.
4355
4356- Add sys.flags attribute for the new -q command-line option.
4357
4358- Issue #11506: Trying to assign to a bytes literal should result in a
4359 SyntaxError.
4360
4361Library
4362-------
4363
4364- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
4365 and a non-zero offset, and an attempt to read past the end of file is made
4366 (IndexError is raised instead). Patch by Ross Lagerwall.
4367
4368- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
4369 of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
4370
4371- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
4372 than the currently problematic Apple-supplied one, when running with the
4373 64-/32-bit installer variant.
4374
4375- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
4376 as unicode, and accept binary files. Add encoding and errors attributes to
4377 cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
4378 Linderman).
4379
4380- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
4381
4382- Issue #10899: No function type annotations in the standard library. Removed
4383 function type annotations from _pyio.py.
4384
4385- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
4386
4387- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
4388 if available.
4389
4390- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
4391 twice.
4392
4393- Issue #5871: email.header.Header.encode now raises an error if any
4394 continuation line in the formatted value has no leading white space and looks
4395 like a header. Since Generator uses Header to format all headers, this check
4396 is made for all headers in any serialized message at serialization time. This
4397 provides protection against header injection attacks.
4398
4399- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
4400 private by renaming it to ``_GeneratorContextManager``.
4401
4402- Issue #10042: Fixed the total_ordering decorator to handle cross-type
4403 comparisons that could lead to infinite recursion.
4404
4405- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
4406 non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
4407 presentation, instead of replacing them with ?s.
4408
4409- email.header.Header was incorrectly encoding folding whitespace when
4410 rfc2047-encoding header values with embedded newlines, leaving them without
4411 folding whitespace. It now uses the continuation_ws, as it does for
4412 continuation lines that it creates itself.
4413
4414- Issue #1777412, #10827: Changed the rules for 2-digit years. The
4415 time.asctime(), time.ctime() and time.strftime() functions will now format
4416 any year when ``time.accept2dyear`` is False and will accept years >= 1000
4417 otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
4418 supported by the OS. With Visual Studio or on Solaris, the year is limited to
4419 the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
4420
4421- Issue #7858: Raise an error properly when os.utime() fails under Windows
4422 on an existing file.
4423
4424- Issue #3839: wsgiref should not override a Content-Length header set by
4425 the application. Initial patch by Clovis Fabricio.
4426
4427- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
4428 compilation (if the input is a string).
4429
4430- Issue #7995: When calling accept() on a socket with a timeout, the returned
4431 socket is now always blocking, regardless of the operating system.
4432
4433- Issue #10756: atexit normalizes the exception before displaying it. Patch by
4434 Andreas Stührk.
4435
4436- Issue #10790: email.header.Header.append's charset logic now works correctly
4437 for charsets whose output codec is different from its input codec.
4438
4439- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
4440 raising a ValueError, to fix repr().
4441
4442- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
4443 the input buffer length doesn't fit into an unsigned int (length bigger than
4444 2^32-1 bytes).
4445
4446- Issue #6643: Reinitialize locks held within the threading module after fork to
4447 avoid a potential rare deadlock or crash on some platforms.
4448
4449- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
4450 descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross
4451 Lagerwall.
4452
4453- `unittest.TestCase` can be instantiated without a method name; for simpler
4454 exploration from the interactive interpreter.
4455
4456- Issue #10798: Reject supporting concurrent.futures if the system has too
4457 few POSIX semaphores.
4458
4459- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
4460 the codec aliases. They are still accessible via codecs.lookup().
4461
4462- Issue #10801: In zipfile, support different encodings for the header and the
4463 filenames.
4464
4465- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
4466 David Daniels.
4467
4468- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
4469 define __missing__().
4470
4471- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
4472 time. `sys.stderr` now looked up at instantiation time. Fix contributed by
4473 Mark Roddy.
4474
4475- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
4476 won't be quoted when the URI is constructed by the wsgiref.util's request_uri
4477 method. According to RFC 3986, these characters can be a part of params in
4478 PATH component of URI and need not be quoted.
4479
4480- Issue #10738: Fix webbrowser.Opera.raise_opts.
4481
4482- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
4483 browsers actually parse cookies.
4484
4485- Issue #9333: os.symlink now available regardless of user privileges. The
4486 function now raises OSError on Windows >=6.0 when the user is unable to create
4487 symbolic links. XP and 2003 still raise NotImplementedError.
4488
4489- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
4490
4491- Issue #10730: Add SVG mime types to mimetypes module.
4492
4493- Issue #10768: Make the Tkinter ScrolledText widget work again.
4494
4495- Issue #10777: Fix "dictionary changed size during iteration" bug in
4496 ElementTree register_namespace().
4497
4498- Issue #10626: test_logging now preserves logger disabled states.
4499
4500- Issue #10774: test_logging now removes temp files created during tests.
4501
4502- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
4503 it now prints the filename, line number, and traceback to stderr and skips
4504 the rest of that individual file, instead of stopping processing entirely.
4505
4506- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
4507 pipes (bug specific to Windows).
4508
4509- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
4510 compliance (no "s around encoded values).
4511
4512- Improved the diff message in the unittest module's assertCountEqual().
4513
4514- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
4515 the '-' of a timezone field as well as before a '+'.
4516
4517- Issue #4871: The zipfile module now gives a more useful error message if
4518 an attempt is made to use a string to specify the archive password.
4519
4520- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
4521
4522- Deprecated assertDictContainsSubset() in the unittest module.
4523
4524C-API
4525-----
4526
4527- PyObject_CallMethod now passes along any underlying AttributeError from
4528 PyObject_GetAttr, instead of replacing it with something less informative
4529
4530- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
4531 PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
4532
4533- Issue #10333: Remove ancient GC API, which has been deprecated since Python
4534 2.2.
4535
4536Build
4537-----
4538
4539- Issue #10843: Update third-party library versions used in OS X 32-bit
4540 installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
4541 and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
4542
4543- Issue #10820: Fix OS X framework installs to support version-specific
4544 scripts (#10679).
4545
4546- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
4547 the configure script but use $GREP instead. Patch by Fabian Groffen.
4548
4549- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
4550 and DragonFly BSD. Patch by Nicolas Joly.
4551
4552- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
4553 a version-specific suffix on "make altinstall".
4554
4555- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
4556 timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
4557 support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
4558 only be present on OS X; the former is the correct one for Linux with GCC.
4559
4560- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
4561 using GCC 4.0.
4562
4563Tools/Demos
4564-----------
4565
4566- Issue #10843: Install the Tools directory on OS X in the applications Extras
4567 (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
4568 installed.
4569
4570- Issue #7962: The Demo directory is gone. Most of the old and unmaintained
4571 demos have been removed, others integrated in documentation or a new
4572 Tools/demo subdirectory.
4573
4574- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
4575 Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
4576 Curtin.
4577
4578Tests
4579-----
4580
4581- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
4582
4583- Fix test_startfile to wait for child process to terminate before finishing.
4584
4585- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
4586 by Ross Lagerwall.
4587
4588- Make the --coverage flag work for test.regrtest.
4589
4590- Issue #1677694: Refactor and improve test_timeout. Original patch by
4591 Björn Lindqvist.
4592
4593- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
4594 Patch by Jean-Paul Calderone and Sandro Tosi.
4595
4596- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default in
4597 whole runs and enabled selectively using ``--header`` when running an explicit
4598 list of tests. Original patch by Collin Winter.
4599
4600
4601What's New in Python 3.2 Beta 2?
4602================================
4603
4604*Release date: 19-Dec-2010*
4605
4606Core and Builtins
4607-----------------
4608
4609- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
4610 by signals on platforms using pthreads. Patch by Reid Kleckner.
4611
4612- Issue #4236: PyModule_Create2 now checks the import machinery directly
4613 rather than the Py_IsInitialized flag, avoiding a Fatal Python
4614 error in certain circumstances when an import is done in __del__.
4615
4616- Issue #5587: add a repr to dict_proxy objects. Patch by David Stanek and
4617 Daniel Urban.
4618
4619Library
4620-------
4621
4622- Issue #3243: Support iterable bodies in httplib. Patch Contributions by
4623 Xuanji Li and Chris AtLee.
4624
4625- Issue #10611: SystemExit exception will no longer kill a unittest run.
4626
4627- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
4628 up function.
4629
4630- Issue #10573: use actual/expected consistently in unittest methods.
4631 The order of the args of assertCountEqual is also changed.
4632
4633- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
4634 words in the local part of email addresses, thereby preserving the input.
4635
4636- Issue #6791: Limit header line length (to 65535 bytes) in http.client
4637 and http.server, to avoid denial of services from the other party.
4638
4639- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
4640
4641- Issue #9907: Fix tab handling on OSX when using editline by calling
4642 rl_initialize first, then setting our custom defaults, then reading .editrc.
4643
4644- Issue #4188: Avoid creating dummy thread objects when logging operations
4645 from the threading module (with the internal verbose flag activated).
4646
4647- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
4648 parameter to HTTPConnection and friends is deprecated.
4649
4650- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
4651 ';' character. Patch by Wes Chow.
4652
4653- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
4654 for security reasons. Initial patch by Ross Lagerwall.
4655
4656- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
4657
4658- Issue #10667: Fast path for collections.Counter().
4659
4660- Issue #10695: passing the port as a string value to telnetlib no longer
4661 causes debug mode to fail.
4662
4663- Issue #1078919: add_header now automatically RFC2231 encodes parameters
4664 that contain non-ascii values.
4665
4666- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
4667 a warning on sys.stderr rather than throwing a misleading exception
4668 if cleanup fails due to nulling out of modules during shutdown.
4669 Also avoids an AttributeError when mkdtemp call fails and issues
4670 a ResourceWarning on implicit cleanup via __del__.
4671
4672- Issue #10107: Warn about unsaved files in IDLE on OSX.
4673
4674- Issue #7213: subprocess.Popen's default for close_fds has been changed.
4675 It is now True in most cases other than on Windows when input, output or
4676 error handles are provided.
4677
4678- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
4679 added in 3.2beta1) to allow specifying a specific list of file descriptors
4680 to keep open in the child process.
4681
4682- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
4683 OSError exception when The OS had been told to ignore SIGCLD in our process
4684 or otherwise not wait for exiting child processes.
4685
4686Tests
4687-----
4688
4689- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
4690 encountering them.
4691
4692Tools/Demos
4693-----------
4694
4695- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
4696 Cocoa AquaTk.
4697
4698- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
4699
4700- Issue #10706: Remove outdated script runtests.sh. Either ``make test``
4701 or ``python -m test`` should be used instead.
4702
4703Build
4704-----
4705
4706- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
4707
4708- Issue #9234: argparse supports alias names for subparsers.
4709
4710
4711What's New in Python 3.2 Beta 1?
4712================================
4713
4714*Release date: 05-Dec-2010*
4715
4716Core and Builtins
4717-----------------
4718
4719- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
4720 methods.
4721
4722- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
4723 with respect to signed zeros. -4.0 % 4.0 should be 0.0, not -0.0.
4724
4725- Issue #1772833: Add the -q command-line option to suppress copyright and
4726 version output in interactive mode.
4727
4728- Provide an *optimize* parameter in the built-in compile() function.
4729
4730- Fixed several corner case issues on Windows in os.stat/os.lstat related to
4731 reparse points.
4732
4733- PEP 384 (Defining a Stable ABI) is implemented.
4734
4735- Issue #2690: Range objects support negative indices and slicing.
4736
4737- Issue #9915: Speed up sorting with a key.
4738
4739- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
4740 larger than operand ``b``. Patch by Andrew Bennetts.
4741
4742- Issue #10518: Bring back the callable() builtin.
4743
4744- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
4745 method of float, complex, and Decimal. This allows more precise control over
4746 when decimal points are displayed.
4747
4748- Issue #10474: range.count() should return integers.
4749
4750- Issue #1574217: isinstance now catches only AttributeError, rather than
4751 masking all errors.
4752
4753Library
4754-------
4755
4756- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
4757
4758- test.support: Added TestHandler and Matcher classes for better support of
4759 assertions about logging.
4760
4761- Issue #4391: Use proper plural forms in argparse.
4762
4763- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
4764 UnicodeEncodeError.
4765
4766- Add the "display" and "undisplay" pdb commands.
4767
Martin Panterc04fb562016-02-10 05:44:01 +00004768- Issue #7245: Add a SIGINT handler in pdb that allows breaking a program again
Georg Brandl86dc7322012-10-01 18:58:45 +02004769 after a "continue" command.
4770
4771- Add the "interact" pdb command.
4772
4773- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
4774
4775- Issue #1569291: Speed up array.repeat().
4776
4777- Provide an interface to set the optimization level of compilation in
4778 py_compile, compileall and zipfile.PyZipFile.
4779
4780- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
4781 RFC3986. Anything before :// is considered a scheme and is followed by an
4782 authority (or netloc) and by '/' led path, which is optional.
4783
4784- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
4785
4786- Issue #10620: `python -m unittest` can accept file paths instead of module
4787 names for running specific tests.
4788
4789- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
4790 `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
4791 and replace them with the correct methods in the Python test suite.
4792
4793- Issue #10272: The ssl module now raises socket.timeout instead of a generic
4794 SSLError on socket timeouts.
4795
4796- Issue #10528: Allow translators to reorder placeholders in localizable
4797 messages from argparse.
4798
4799- Issue #10497: Fix incorrect use of gettext in argparse.
4800
4801- Issue #10478: Reentrant calls inside buffered IO objects (for example by
4802 way of a signal handler) now raise a RuntimeError instead of freezing the
4803 current process.
4804
4805- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
4806
4807- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
4808
4809- Issue #2001: New HTML server with enhanced Web page features. Patch by Ron
4810 Adam.
4811
4812- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
4813 of non-weakrefable objects.
4814
4815- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
4816
4817- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
4818 DoS attacks. Patch by Savio Sena.
4819
4820- Issue #4925: Add filename to error message when executable can't be found in
4821 subprocess.
4822
4823- Issue #10391: Don't dereference invalid memory in error messages in the ast
4824 module.
4825
4826- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
4827 os.lstat. Patch by Hirokazu Yamamoto.
4828
4829- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
4830 held by the user's account, i.e., when the function can actually be used.
4831
4832- Issue #8879: Add os.link support for Windows.
4833
4834- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
4835 failure messages by default. Patch by Mark Roddy.
4836
4837- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
4838 guess at the correct parsing of invalid html.
4839
Serhiy Storchaka14867992014-09-10 23:43:41 +03004840- Issue #10554: Add context management protocol support to subprocess.Popen objects.
Georg Brandl86dc7322012-10-01 18:58:45 +02004841
4842- Issue #8989: email.utils.make_msgid now has a domain parameter that can
4843 override the domain name used in the generated msgid.
4844
4845- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
4846 exists' exception when a target directory already exists with the specified
4847 mode. Patch by Ray Allen.
4848
4849- Issue #9573: os.fork() now works correctly when triggered as a side effect of
4850 a module import.
4851
4852- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
4853
4854- Added itertools.accumulate().
4855
4856- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
4857 Original patch by Daniel Urban.
4858
4859- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
4860 `assertRegex` and `assertRaisesRegex`.
4861
4862- Issue #10535: Enable silenced warnings in unittest by default.
4863
4864- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
4865 sequences as input in addition to character strings.
4866
4867- Issue #10586: The statistics API for the new functools.lru_cache has been
4868 changed to a single cache_info() method returning a named tuple.
4869
4870- Issue #10323: itertools.islice() now consumes the minimum number of inputs
4871 before stopping. Formerly, the final state of the underlying iterator was
4872 undefined.
4873
4874- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
4875 __next__.
4876
4877- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
4878 more informative name, unittest.CountEqual.
4879
4880- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
4881
4882- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
4883 be set to False to turn off the previously undocumented 'popularity'
4884 heuristic. Patch by Terry Reedy and Eli Bendersky.
4885
4886- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
4887 undocumented and now redundant isbjunk and isbpopular methods.
4888
4889- Issue #9846: zipfile is now correctly closing underlying file objects.
4890
4891- Issue #10459: Update CJK character names to Unicode 6.0.
4892
4893- Issue #4493: urllib.request adds '/' in front of path components which does not
4894 start with '/. Common behavior exhibited by browsers and other clients.
4895
4896- Issue #6378: idle.bat now runs with the appropriate Python version rather than
4897 the system default. Patch by Sridhar Ratnakumar.
4898
4899- Issue #10470: 'python -m unittest' will now run test discovery by default,
4900 when no extra arguments have been provided.
4901
4902- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
4903 output stream only when end_headers is invoked. This is a speedup and an
4904 internal optimization. Patch by Andrew Shaaf.
4905
4906- Issue #10220: Added inspect.getgeneratorstate. Initial patch by Rodolpho
4907 Eckhardt.
4908
4909- Issue #10453: compileall now uses argparse instead of getopt, and thus
4910 provides clean output when called with '-h'.
4911
4912- Issue #8078: Add constants for higher baud rates in the termios module. Patch
4913 by Rodolpho Eckhardt.
4914
4915- Issue #10407: Fix two NameErrors in distutils.
4916
4917- Issue #10371: Deprecated undocumented functions in the trace module.
4918
4919- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
4920 end of the file.
4921
4922- configparser: 100% test coverage.
4923
4924- Issue #10499: configparser supports pluggable interpolation handlers. The
4925 default classic interpolation handler is called BasicInterpolation. Another
4926 interpolation handler added (ExtendedInterpolation) which supports the syntax
4927 used by zc.buildout (e.g. interpolation between sections).
4928
4929- configparser: the SafeConfigParser class has been renamed to ConfigParser.
4930 The legacy ConfigParser class has been removed but its interpolation mechanism
4931 is still available as LegacyInterpolation.
4932
4933- configparser: Usage of RawConfigParser is now discouraged for new projects
4934 in favor of ConfigParser(interpolation=None).
4935
4936- Issue #1682942: configparser supports alternative option/value delimiters.
4937
4938- Issue #5412: configparser supports mapping protocol access.
4939
4940- Issue #9411: configparser supports specifying encoding for read operations.
4941
4942- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
4943 accept vars and default arguments just like get() does.
4944
4945- Issue #9452: configparser supports reading from strings and dictionaries
4946 (thanks to the mapping protocol API, the latter can be used to copy data
4947 between parsers).
4948
4949- configparser: accepted INI file structure is now customizable, including
4950 comment prefixes, name of the DEFAULT section, empty lines in multiline
4951 values, and indentation.
4952
4953- Issue #10326: unittest.TestCase instances can be pickled.
4954
4955- Issue #9926: Wrapped TestSuite subclass does not get __call__ executed.
4956
4957- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to complex
4958 zeros on systems where the log1p function fails to respect the sign of zero.
4959 This fixes a test failure on AIX.
4960
4961- Issue #9732: Addition of getattr_static to the inspect module.
4962
4963- Issue #10446: Module documentation generated by pydoc now links to a
4964 version-specific online reference manual.
4965
4966- Make the 'No module named' exception message from importlib consistent.
4967
4968- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
4969
4970- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
4971 Patch by Robert Collins.
4972
4973- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
4974 than strings.
4975
4976C-API
4977-----
4978
4979- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
4980 which transforms non-ASCII decimal digits in a Unicode string to their ASCII
4981 equivalents.
4982
4983- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
4984 zero-initialize all fields, fixing compiler warnings seen when building
4985 extension modules with gcc with "-Wmissing-field-initializers" (implied by
4986 "-W").
4987
4988- Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by Neil
4989 Schemenauer.
4990
4991- structseq.h is now included in Python.h.
4992
4993- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
4994
4995Tests
4996-----
4997
4998- regrtest.py once again ensures the test directory is removed from sys.path
4999 when it is invoked directly as the __main__ module.
5000
5001- `python -m test` can be used to run the test suite as well as `python -m
5002 test.regrtest`.
5003
5004- Do not fail test_socket when the IP address of the local hostname cannot be
5005 looked up.
5006
5007- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
5008 Carstensen.
5009
5010Build
5011-----
5012
5013- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
5014 PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
5015
5016Documentation
5017-------------
5018
5019- Issue #10299: List the built-in functions in a table in functions.rst.
5020
5021
5022What's New in Python 3.2 Alpha 4?
5023=================================
5024
5025*Release date: 13-Nov-2010*
5026
5027Core and Builtins
5028-----------------
5029
5030- Issue #10372: Import the warnings module only after the IO library is
5031 initialized, so as to avoid bootstrap issues with the '-W' option.
5032
5033- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
5034 undocumented value PyBUF_SHADOW, and strangely-looking code in
5035 PyMemoryView_GetContiguous.
5036
5037- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
5038
5039- If FileIO.__init__ fails, close the file descriptor.
5040
5041- Issue #10221: dict.pop(k) now has a key error message that includes the
5042 missing key (same message d[k] returns for missing keys).
5043
5044- Issue #5437: A preallocated MemoryError instance should not keep traceback
5045 data (including local variables caught in the stack trace) alive infinitely.
5046
5047- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
5048 of the offending line.
5049
5050- Issue #10089: Add support for arbitrary -X options on the command line. They
5051 can be retrieved through a new attribute ``sys._xoptions``.
5052
5053- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
5054 the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment
5055 variable is not set, the locale encoding is ISO-8859-1, whereas most programs
5056 (including Python) expect UTF-8. Python already uses UTF-8 for the filesystem
5057 encoding and to encode command line arguments on this OS.
5058
5059- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
5060 filenames encoded to the filesystem encoding with the surrogateescape error
5061 handler (to support undecodable bytes), instead of UTF-8 in strict mode.
5062
5063- Issue #9997: Don't let the name "top" have special significance in scope
5064 resolution.
5065
5066- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
5067 the default 512 when compiling on AIX.
5068
5069- Use locale encoding instead of UTF-8 to encode and decode filenames if
5070 Py_FileSystemDefaultEncoding is not set.
5071
5072- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
5073 descriptor.
5074
5075- Issue #9418: Moved private string methods ``_formatter_parser`` and
5076 ``_formatter_field_name_split`` into a new ``_string`` module.
5077
5078- Issue #9992: Remove PYTHONFSENCODING environment variable.
5079
5080Library
5081-------
5082
5083- Issue #12943: python -m tokenize support has been added to tokenize.
5084
5085- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
5086
5087- Issue #10356: Decimal.__hash__(-1) should return -2.
5088
5089- Issue #1553375: logging: Added stack_info kwarg to display stack information.
5090
5091- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
5092
5093- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2. (See also issue
5094 #10356.)
5095
5096- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
5097 IMAP4 connections. Original patch by Lorenzo M. Catucci.
5098
5099- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
5100 there are non-base64 alphabet characters in the input.
5101
5102- Issue #10386: Add __all__ to token module; this simplifies importing in
5103 tokenize module and prevents leaking of private names through ``import *``.
5104
5105- Issue #4471: Properly shutdown socket in IMAP.shutdown(). Patch by Lorenzo
5106 M. Catucci.
5107
5108- Fix IMAP.login() to work properly.
5109
5110- Issue #9244: multiprocessing pool worker processes could terminate
5111 unexpectedly if the return value of a task could not be pickled. Only the
5112 ``repr`` of such errors are now sent back, wrapped in an
5113 ``MaybeEncodingError`` exception.
5114
5115- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
Martin Panter7462b6492015-11-02 03:37:02 +00005116 ``multiprocessing.Pool`` now accepts an ``error_callback`` argument. This can
Georg Brandl86dc7322012-10-01 18:58:45 +02005117 be a callback with the signature ``callback(exc)``, which will be called if
5118 the target raises an exception.
5119
5120- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
5121 sockets now has additional items such as ``issuer`` and ``notBefore``.
5122
5123- ``usenetrc`` is now false by default for NNTP objects.
5124
5125- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
5126 Patch by Andrew Vant.
5127
5128- Issue #10335: Add tokenize.open(), detect the file encoding using
5129 tokenize.detect_encoding() and open it in read only mode.
5130
5131- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
5132 method send_message to send an email.message.Message object.
5133
5134- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
5135 handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
5136 code directory name contains a non-ASCII character and the locale encoding is
5137 ASCII.
5138
5139- Issue #10329: The trace module writes reports using the input Python script
5140 encoding, instead of the locale encoding. Patch written by Alexander
5141 Belopolsky.
5142
5143- Issue #10126: Fix distutils' test_build when Python was built with
5144 --enable-shared.
5145
5146- Issue #9281: Prevent race condition with mkdir in distutils. Patch by
5147 Arfrever.
5148
5149- Issue #10229: Fix caching error in gettext.
5150
5151- Issue #10252: Close file objects in a timely manner in distutils code and
5152 tests. Patch by Brian Brazil, completed by Éric Araujo.
5153
5154- Issue #10180: Pickling file objects is now explicitly forbidden, since
5155 unpickling them produced nonsensical results.
5156
5157- Issue #10311: The signal module now restores errno before returning from its
5158 low-level signal handler. Patch by Hallvard B Furuseth.
5159
5160- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
5161
5162- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
5163
5164- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
5165 environment better, and to correct unicode environment values for WSGI 1.0.1.
5166
5167- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
5168 response, instead of raising an exception.
5169
5170- wsgiref now implements and validates PEP 3333, rather than an experimental
5171 extension of PEP 333. (Note: earlier versions of Python 3.x may have
5172 incorrectly validated some non-compliant applications as WSGI compliant; if
5173 your app validates with Python <3.2b1+, but not on this version, it is likely
5174 the case that your app was not compliant.)
5175
5176- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
5177 by the server.
5178
5179- Issue #10184: Touch directories only once when extracting a tarfile.
5180
5181- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
5182 that were formerly found under Demo/turtle.
5183
5184- Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil.
5185
5186- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
5187 filename. Patch by Brian Brazil.
5188
5189- Issue #10110: Queue objects didn't recognize full queues when the maxsize
5190 parameter had been reduced.
5191
5192- Issue #10160: Speed up operator.attrgetter. Patch by Christos Georgiou.
5193
5194- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
5195
5196- Issue #5729: json.dumps() now supports using a string such as '\t' for
5197 pretty-printing multilevel objects.
5198
5199- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
5200 append that isn't seekable. Patch by Brian Brazil.
5201
Serhiy Storchaka14867992014-09-10 23:43:41 +03005202- Support context management protocol for file-like objects returned by mailbox
Georg Brandl86dc7322012-10-01 18:58:45 +02005203 ``get_file()`` methods.
5204
5205- Issue #10246: uu.encode didn't close file objects explicitly when filenames
5206 were given to it. Patch by Brian Brazil.
5207
5208- Issue #10198: fix duplicate header written to wave files when writeframes() is
5209 called without data.
5210
5211- Close file objects in modulefinder in a timely manner.
5212
Martin Panter7462b6492015-11-02 03:37:02 +00005213- Close an io.TextIOWrapper object in email.parser in a timely manner.
Georg Brandl86dc7322012-10-01 18:58:45 +02005214
5215- Close a file object in distutils.sysconfig in a timely manner.
5216
5217- Close a file object in pkgutil in a timely manner.
5218
5219- Issue #10233: Close file objects in a timely manner in the tarfile module and
5220 its test suite.
5221
5222- Issue #10093: ResourceWarnings are now issued when files and sockets are
5223 deallocated without explicit closing. These warnings are silenced by default,
5224 except in pydebug mode.
5225
5226- tarfile.py: Add support for all missing variants of the GNU sparse extensions
5227 and create files with holes when extracting sparse members.
5228
5229- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
5230
5231- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
5232 deprecate the old name ``zipfile.BadZipfile``.
5233
5234- Issue #5027: The standard ``xml`` namespace is now understood by
5235 xml.sax.saxutils.XMLGenerator as being bound to
5236 http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
5237
5238- Issue #5975: Add csv.unix_dialect class.
5239
5240- Issue #7761: telnetlib.interact failures on Windows fixed.
5241
5242- logging: Added style option to Formatter to allow %, {} or $-formatting.
5243
5244- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
5245 context manager.
5246
5247- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
5248 encode method now support a 'linesep' argument.
5249
5250- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
5251 order to support the TLS SNI extension. ``HTTPSConnection`` and ``urlopen()``
5252 also use this argument, so that HTTPS virtual hosts are now supported.
5253
5254- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
5255
5256- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
5257
5258- logging: Made StreamHandler terminator configurable.
5259
5260- logging: Allowed filters to be just callables.
5261
5262- logging: Added tests for _logRecordClass changes.
5263
5264- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
5265
5266- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
5267 increase flexibility of LogRecord creation.
5268
5269- Issue #5117: Case normalization was needed on ntpath.relpath(). Also fixed
5270 root directory issue on posixpath.relpath(). (Ported working fixes from
5271 ntpath.)
5272
5273- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
5274 short_empty_elements to direct it to use self-closing tags when appropriate.
5275
5276- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags. Add --abiflags
5277 switch to python-config for command line access.
5278
5279- Issue #6098: Don't claim DOM level 3 conformance in minidom.
5280
5281- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
5282 XML namespace attribute is encountered.
5283
5284- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
5285 characters by default. Deprecate ``cgi.escape()``.
5286
5287- Issue #9409: Fix the regex to match all kind of filenames, for interactive
5288 debugging in doctests.
5289
5290- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
5291 same instance as ``datetime.timezone.utc``.
5292
5293- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
5294 supported by the system. Patch by Nikita Vetoshkin.
5295
5296- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
5297 protocol. file:// urls had fallback to access remote hosts via ftp. This was
5298 not correct, change is made to raise a URLError when a remote host is tried to
5299 access via file:// scheme.
5300
5301- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
5302 created in modes 'a' or 'w' and then closed without adding any files. Raise
5303 BadZipfile (rather than IOError) when opening small non-ZIP files.
5304
5305- Issue #10041: The signature of optional arguments in socket.makefile() didn't
5306 match that of io.open(), and they also didn't get forwarded properly to
5307 TextIOWrapper in text mode. Patch by Kai Zhu.
5308
5309- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
5310 urllib.request.urlopen now take optional arguments to allow for server
5311 certificate checking, as recommended in public uses of HTTPS.
5312
5313- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
5314 current directory was deleted. Patch written by W. Trevor King.
5315
5316- Issue #3873: Speed up unpickling from file objects that have a peek() method.
5317
5318- Issue #10075: Add a session_stats() method to SSLContext objects.
5319
5320- Issue #9948: Fixed problem of losing filename case information.
5321
5322Extension Modules
5323-----------------
5324
5325- Issue #5109: array.array constructor will now use fast code when
5326 initial data is provided in an array object with correct type.
5327
5328- Issue #6317: Now winsound.PlaySound only accepts unicode.
5329
5330- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
5331
5332- Issue #9377: Use Unicode API for gethostname on Windows.
5333
5334- Issue #10143: Update "os.pathconf" values.
5335
Serhiy Storchaka14867992014-09-10 23:43:41 +03005336- Issue #6518: Support context management protocol for ossaudiodev types.
Georg Brandl86dc7322012-10-01 18:58:45 +02005337
5338- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
5339
5340- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
5341 version 2.0.1.
5342
5343- Issue #5355: Provide mappings from Expat error numbers to string descriptions
5344 and backwards, in order to actually make it possible to analyze error codes
5345 provided by ExpatError.
5346
5347- The Unicode database was updated to 6.0.0.
5348
5349C-API
5350-----
5351
5352- Issue #10288: The deprecated family of "char"-handling macros
5353 (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
5354
5355- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
5356 type has been introduced.
5357
5358Tools/Demos
5359-----------
5360
5361- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
5362 encoding other than ASCII or UTF-8. Source encoding is preserved when
5363 reindented code is written to a file.
5364
5365- Issue #7287: Demo/imputil/knee.py was removed.
5366
5367Tests
5368-----
5369
5370- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
5371 as unicode strings. Initial patch by Sandro Tosi.
5372
5373- Issue #10294: Remove dead code form test_unicode_file.
5374
5375- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
5376 test specific to unicode (non-ascii name and filename).
5377
5378Build
5379-----
5380
5381- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
5382
5383- Issue #8852: Allow the socket module to build on OpenSolaris.
5384
5385- Drop -OPT:Olimit compiler option.
5386
5387- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
5388
5389- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
5390
5391- Issue #7473: avoid link errors when building a framework with a different set
5392 of architectures than the one that is currently installed.
5393
5394
5395What's New in Python 3.2 Alpha 3?
5396=================================
5397
5398*Release date: 09-Oct-2010*
5399
5400Core and Builtins
5401-----------------
5402
5403- Issue #10068: Global objects which have reference cycles with their module's
5404 dict are now cleared again. This causes issue #7140 to appear again.
5405
5406- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
5407 encodings.
5408
5409- ast.literal_eval() can now handle negative numbers. It is also a little more
5410 liberal in what it accepts without compromising the safety of the evaluation.
5411 For example, 3j+4 and 3+4+5 are both accepted.
5412
5413- Issue #10006: type.__abstractmethods__ now raises an AttributeError. As a
5414 result metaclasses can now be ABCs (see #9533).
5415
5416- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
5417
5418- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
5419 UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
5420 32 bits wchar_t (eg. Linux in narrow build).
5421
5422- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
5423 introduced by issue #9324.
5424
5425- Issue #9979: Create function PyUnicode_AsWideCharString().
5426
5427- Issue #7397: Mention that importlib.import_module() is probably what someone
5428 really wants to be using in __import__'s docstring.
5429
5430- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
5431 to use named arguments.
5432
5433- Issue #9930: Remove bogus subtype check that was causing (e.g.)
5434 float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
5435
5436- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
5437
5438- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
5439 threads are still running. Instead, reinitialize the GIL on a second call to
5440 Py_Initialize().
5441
5442- All SyntaxErrors now have a column offset and therefore a caret when the error
5443 is printed.
5444
5445- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
5446 module that was imported, but instead gets the module from sys.modules.
5447
5448- Issue #9213: The range type_items now provides index() and count() methods, to
5449 conform to the Sequence ABC. Patch by Daniel Urban and Daniel Stutzbach.
5450
5451- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
5452 with a non-empty format string. This is an effort to future-proof user
5453 code. If a derived class does not currently implement __format__ but later
5454 adds its own __format__, it would most likely break user code that had
5455 supplied a format string. This will be changed to a DeprecationWaring in
5456 Python 3.3 and it will be an error in Python 3.4.
5457
5458- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
5459 re-created on a subsequent call to Py_Initialize(). The problem (a crash)
5460 wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
5461
5462- Issue #9210: Configure option --with-wctype-functions was removed. Using the
5463 functions from the libc caused the methods .upper() and lower() to become
5464 locale aware and created subtly wrong results.
5465
5466- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
5467 non-ASCII byte in the format string.
5468
5469- Issue #4617: Previously it was illegal to delete a name from the local
5470 namespace if it occurs as a free variable in a nested block. This limitation
5471 of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
5472
5473- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
5474 ``\UXXXXXXXX``, regardless of whether the character is printable or not.
5475 Also, the "backslashreplace" error handler now joins surrogate pairs into a
5476 single character on UCS-2 builds.
5477
5478- Issue #9757: memoryview objects get a release() method to release the
5479 underlying buffer (previously this was only done when deallocating the
5480 memoryview), and gain support for the context management protocol.
5481
5482- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
5483 thread-local storage key.
5484
5485Library
5486-------
5487
5488- Issue #2236: distutils' mkpath ignored the mode parameter.
5489
5490- Fix typo in one sdist option (medata-check).
5491
5492- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
5493
5494- Issue #1718574: Fix options that were supposed to accept arguments but did
5495 not in build_clib.
5496
5497- Issue #9437: Fix building C extensions with non-default LDFLAGS.
5498
5499- Issue #4661: email can now parse bytes input and generate either converted
5500 7bit output or bytes output. Email version bumped to 5.1.0.
5501
5502- Issue #1589: Add ssl.match_hostname(), to help implement server identity
5503 verification for higher-level protocols.
5504
5505- Issue #9759: GzipFile now raises ValueError when an operation is attempted
5506 after the file is closed. Patch by Jeffrey Finkelstein.
5507
5508- Issue #9042: Fix interaction of custom translation classes and caching in
5509 gettext.
5510
5511- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
5512 returning a (sock, addr) pair which is called when a connection has been
5513 established with a new remote endpoint. This is supposed to be used as a
5514 replacement for old handle_accept() and avoids the user to call accept()
5515 directly.
5516
5517- Issue #9065: tarfile no longer uses "root" as the default for the uname and
5518 gname field.
5519
5520- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
5521 an environment that does not have docutils. Patch by Arfrever.
5522
5523- Issue #1050268: parseaddr now correctly quotes double quote and backslash
5524 characters that appear inside quoted strings in email addresses.
5525
5526- Issue #10004: quoprimime no longer generates a traceback when confronted with
5527 invalid characters after '=' in a Q-encoded word.
5528
5529- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
5530 sending a 200 OK for the Expect: 100-continue request header.
5531
5532- Issue #9360: Cleanup and improvements to the nntplib module. The API now
5533 conforms to the philosophy of bytes and unicode separation in Python 3. A
5534 test suite has also been added.
5535
5536- Issue #9962: GzipFile now has the peek() method.
5537
5538- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
5539 retry the select() loop instead of bailing out. This is because select() can
5540 incorrectly report a socket as ready for reading (for example, if it received
5541 some data with an invalid checksum).
5542
5543- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
5544
5545- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
5546 received. Now sendall() properly calls signal handlers if necessary, and
5547 retries sending if these returned successfully, including on sockets with a
5548 timeout.
5549
5550- Issue #9947: logging: Fixed locking bug in stopListening.
5551
5552- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
5553
5554- Issue #9936: Fixed executable lines' search in the trace module.
5555
5556- Issue #9790: Rework imports necessary for samefile and sameopenfile
5557 in ntpath.
5558
5559- Issue #9928: Properly initialize the types exported by the bz2 module.
5560
5561- Issue #1675951: Allow GzipFile to work with unseekable file objects. Patch by
5562 Florian Festi.
5563
5564- Logging: Added QueueListener class to facilitate logging usage for
5565 performance-critical threads.
5566
5567- Issue #9916: Add some missing errno symbols.
5568
5569- Issue #9877: Expose sysconfig.get_makefile_filename()
5570
5571- logging: Added hasHandlers() method to Logger and LoggerAdapter.
5572
5573- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
5574
5575- Issue #2643: msync() is not called anymore when deallocating an open mmap
5576 object, only munmap().
5577
5578- logging: Changed LoggerAdapter implementation internally, to make it easier to
5579 subclass in a useful way.
5580
5581- logging: hasHandlers method was added to Logger, and isEnabledFor,
5582 getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
5583 LoggerAdapter was introduced into the unit tests for logging.
5584
5585- Issue #1686: Fix string.Template when overriding the pattern attribute.
5586
5587- Issue #9854: SocketIO objects now observe the RawIOBase interface in
5588 non-blocking mode: they return None when an operation would block (instead of
5589 raising an exception).
5590
5591- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
5592 another kind.
5593
5594- Issue #9441: logging has better coverage for rotating file handlers.
5595
5596- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
5597
5598- Issue #9854: The default read() implementation in io.RawIOBase now handles
5599 non-blocking readinto() returning None correctly.
5600
5601- Issue #1552: socket.socketpair() now returns regular socket.socket objects
5602 supporting the whole socket API (rather than the "raw" _socket.socket
5603 objects).
5604
5605- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
5606 to match the corresponding socket methods.
5607
5608- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
5609 them handle recursive calls within the same thread.
5610
5611- logging: Enhanced HTTPHandler with secure and credentials initializers.
5612
5613- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
5614
5615- Issue #9837: The read() method of ZipExtFile objects (as returned by
5616 ZipFile.open()) could return more bytes than requested.
5617
5618- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
5619 d['x'] = d.
5620
5621- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
5622 it possible for the user to create self-referencing ordered dictionaries which
5623 become permanently uncollectable GC garbage. Reinstated the Python 3.1
5624 approach of using weakref proxies so that reference cycles never get created
5625 in the first place.
5626
5627- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
5628 encode the value with filesystem encoding and surrogateescape (instead of
5629 utf-8 in strict mode) . Patch written by David Watson.
5630
5631- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
5632 environment variable to set the filesystem encoding at Python startup.
5633 sys.setfilesystemencoding() creates inconsistencies because it is unable to
5634 reencode all filenames in all objects.
5635
5636- Issue #9410: Various optimizations to the pickle module, leading to speedups
5637 up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow;
5638 initial patch by Alexandre Vassalotti.
5639
5640- The pprint module now supports printing OrderedDicts in their given order
5641 (formerly, it would sort the keys).
5642
5643- Logging: Added QueueHandler class to facilitate logging usage with
5644 multiprocessing.
5645
5646- Issue #9707: Rewritten reference implementation of threading.local which is
5647 friendlier towards reference cycles. This change is not normally visible
5648 since an optimized C implementation (_thread._local) is used instead.
5649
5650- Issue #6394: os.getppid() is now supported on Windows. Note that it will
5651 still return the id of the parent process after it has exited. This process
5652 id may even have been reused by another unrelated process.
5653
5654- Issue #9792: In case of connection failure, socket.create_connection() would
5655 swallow the exception and raise a new one, making it impossible to fetch the
5656 original errno, or to filter timeout errors. Now the original error is
5657 re-raised.
5658
5659- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
5660 the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
5661 back after the system call. Original patch by Brian Brazil.
5662
5663- Updates to the random module:
5664
5665 * Document which parts of the module are guaranteed to stay the same across
5666 versions and which parts are subject to change.
5667
5668 * Update the seed() method to use all of the bits in a string instead of just
5669 the hash value. This makes better use of the seed value and assures the
5670 seeding is platform independent. Issue #7889.
5671
5672 * Improved the random()-->integer algorithm used in choice(), shuffle(),
5673 sample(), randrange(), and randint(). Formerly, it used int(n*random())
5674 which has a slight bias whenever n is not a power of two. Issue #9025.
5675
5676 * Improved documentation of arguments to randrange(). Issue #9379.
5677
5678- collections.OrderedDict now supports a new method for repositioning keys to
5679 either end.
5680
5681- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
5682 cases now also have assertWarns and assertWarnsRegexp methods to check that a
5683 given warning type was triggered by the code under test.
5684
5685- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
5686 their contents without duplicating them. The view is both readable and
5687 writable.
5688
5689- Issue #7566: Implement os.path.sameopenfile for Windows.
5690
5691- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
5692 unsupported operation is attempted (for example, writing to a file open only
5693 for reading).
5694
5695- hashlib has two new constant attributes: algorithms_guaranteed and
5696 algorithms_avaiable that respectively list the names of hash algorithms
5697 guaranteed to exist in all Python implementations and the names of hash
5698 algorithms available in the current process.
5699
5700- A new package ``concurrent.futures`` as defined by PEP 3148.
5701
5702C-API
5703-----
5704
5705- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
5706
5707- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
5708 PySequence_DelSlice when the object doesn't have any mapping operations
5709 defined.
5710
5711Tools/Demos
5712-----------
5713
5714- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
5715 wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
5716 and the interpreter under test.
5717
5718Tests
5719-----
5720
5721- Issue #9308: Added tests for importing encoded modules that do not
5722 depend on specific stdlib modules being encoded in a certain way.
5723
5724- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
5725 certificate and private key files used by SSL-related certs.
5726
5727- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
5728 in test_os)
5729
5730- Issue #7110: regrtest now sends test failure reports and single-failure
5731 tracebacks to stderr rather than stdout.
5732
5733- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
5734
5735- Issue #9899: Fix test_tkinter.test_font on various platforms. Patch by Ned
5736 Deily.
5737
5738- Issue #9894: Do not hardcode ENOENT in test_subprocess.
5739
5740- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
5741
5742- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
5743 case when running profile or trace, for example.
5744
5745- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
5746
5747Build
5748-----
5749
5750- Issue #10062: Allow building on platforms which do not have sem_timedwait.
5751
5752- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by Akira
5753 Kitada.
5754
5755- Issue #10055: Make json C89-compliant in UCS4 mode.
5756
5757- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
5758
5759- Issue #1633863: Don't ignore $CC under AIX.
5760
5761- Issue #9810: Compile bzip2 source files in Python's project file directly. It
5762 used to be built with bzip2's makefile.
5763
5764- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
5765 module.
5766
5767- Issue #9806: python-config now has an ``--extension-suffix`` option that
5768 outputs the suffix for dynamic libraries including the ABI version name
5769 defined by PEP 3149.
5770
5771- Issue #941346: Improve the build process under AIX and allow Python to be
5772 built as a shared library. Patch by Sébastien Sablé.
5773
5774- Issue #4026: Make the fcntl extension build under AIX. Patch by Sébastien
5775 Sablé.
5776
5777- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
5778 the "bin" directory inside the framework is on the shell's search path. This
5779 feature now also supports the ZSH shell.
5780
5781
5782What's New in Python 3.2 Alpha 2?
5783=================================
5784
5785*Release date: 05-Sep-2010*
5786
5787Core and Builtins
5788-----------------
5789
5790- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
5791 the new (and simpler) DUP_TOP_TWO. Performance isn't changed, but our
5792 bytecode is a bit simplified. Patch by Demur Rumed.
5793
5794- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
5795 confusion with the proper variables names from 'warnings' itself.
5796
5797- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
5798 conform to the Set ABC. Patch by Daniel Urban.
5799
5800- Issue #9737: Fix a crash when trying to delete a slice or an item from a
5801 memoryview object.
5802
5803- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
5804 now removed, since their effect was inexistent in 3.x (the default encoding is
5805 hardcoded to utf-8 and cannot be changed).
5806
5807- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
5808 properly. Patch by Stefan Behnel.
5809
5810- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
5811 platforms. Previously, it inlined only when using Microsoft Visual C.
5812
5813- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
5814
5815- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
5816
5817- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
5818 the pyconfig.h generated by configure on other systems.
5819
5820- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
5821 occur during attribute lookup are now propagated to the caller.
5822
5823- Issue #8622: Add PYTHONFSENCODING environment variable to override the
5824 filesystem encoding.
5825
5826- Issue #5127: The C functions that access the Unicode Database now accept and
5827 return characters from the full Unicode range, even on narrow unicode builds
5828 (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others). A visible difference
5829 in Python is that unicodedata.numeric() now returns the correct value for
5830 large code points, and repr() may consider more characters as printable.
5831
5832- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
5833 as a unicode object, instead of a byte string. Function needed to support
5834 unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
5835 function.
5836
5837- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
5838
5839- Issue #9612: The set object is now 64-bit clean under Windows.
5840
5841- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
5842 the module file to be executed with the -m command line option.
5843
5844- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
5845 write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
5846 sys.stderr.
5847
5848- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
5849 decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
5850 objects are output as-is.
5851
5852- Issue #9203: Computed gotos are now enabled by default on supported compilers
5853 (which are detected by the configure script). They can still be disable
5854 selectively by specifying --without-computed-gotos.
5855
5856- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
5857 use PyUnicode_FromFormatV() to format the warning message.
5858
5859- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
5860 array.
5861
5862- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
5863
5864- Issue #9337: The str() of a float or complex number is now identical to its
5865 repr().
5866
5867- Issue #9416: Fix some issues with complex formatting where the output with no
5868 type specifier failed to match the str output:
5869
5870 - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
5871 - format(complex(0.0, 2.0), '-') included a sign and parentheses.
5872
5873Extension Modules
5874-----------------
5875
5876- Issue #8013: time.asctime and time.ctime no longer call system
5877 asctime and ctime functions. The year range for time.asctime is now
5878 1900 through maxint. The range for time.ctime is the same as for
5879 time.localtime. The string produced by these functions is longer
5880 than 24 characters when year is greater than 9999.
5881
5882- Issue #6608: time.asctime is now checking struct tm fields its input
5883 before passing it to the system asctime. Patch by MunSic Jeong.
5884
5885- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
5886 descriptor is provided. Patch by Pascal Chambon.
5887
5888- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
5889 posix module. Patch by Marcin Bachry.
5890
5891- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
5892 socket module, and fix the width of socket descriptors to be correctly
5893 detected under 64-bit Windows.
5894
5895- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
5896 and gethostbyaddr. getnameinfo is now restricted to numeric addresses as
5897 input.
5898
5899- Issue #9214: Set operations on a KeysView or ItemsView in collections now
5900 correctly return a set. Patch by Eli Bendersky.
5901
5902- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
5903 Matthew Ahrens.
5904
5905- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
5906 the surrogate error handler.
5907
5908- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
5909 than ``TypeError`` raised by the iterator argument.
5910
5911- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
5912
5913- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
5914 Lock around all system calls. Original patch by Ryan Kelly.
5915
5916- Issue #8524: Add a detach() method to socket objects, so as to put the socket
5917 into the closed state without closing the underlying file descriptor.
5918
5919- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
5920
5921- Issue #6869: Fix a refcount problem in the _ctypes extension.
5922
5923- Issue #5504: ctypes should now work with systems where mmap can't be
5924 PROT_WRITE and PROT_EXEC.
5925
5926- Issue #9507: Named tuple repr will now automatically display the right name in
5927 a tuple subclass.
5928
5929- Issue #9324: Add parameter validation to signal.signal on Windows in order to
5930 prevent crashes.
5931
5932- Issue #9526: Remove some outdated (int) casts that were preventing the array
5933 module from working correctly with arrays of more than 2**31 elements.
5934
5935- Fix memory leak in ssl._ssl._test_decode_cert.
5936
5937- Issue #8065: Fix memory leak in readline module (from failure to free the
5938 result of history_get_history_state()).
5939
5940- Issue #9450: Fix memory leak in readline.replace_history_item and
5941 readline.remove_history_item for readline version >= 5.0.
5942
5943- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
5944
Serhiy Storchaka14867992014-09-10 23:43:41 +03005945- Issue #8046: Add context management protocol support and .closed property to mmap
Georg Brandl86dc7322012-10-01 18:58:45 +02005946 objects.
5947
5948Library
5949-------
5950
5951- Issue #7451: Improve decoding performance of JSON objects, and reduce the
5952 memory consumption of said decoded objects when they use the same strings as
5953 keys.
5954
5955- Issue #1100562: Fix deep-copying of objects derived from the list and dict
5956 types. Patch by Michele Orrù and Björn Lindqvist.
5957
5958- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
5959
5960- Issue #9421: Made the get<type> methods consistently accept the vars and
5961 default arguments on all parser classes.
5962
5963- Issue #7005: Fixed output of None values for RawConfigParser.write and
5964 ConfigParser.write.
5965
5966- Issue #8990: array.fromstring() and array.tostring() get renamed to
5967 frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
5968 array.frombytes(), array.extend() as well as the array.array() constructor now
5969 accept bytearray objects. Patch by Thomas Jollans.
5970
5971- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
5972 issues when socket.close is called from a __del__ method.
5973
5974- Issue #9706: ssl module provides a better error handling in various
5975 circumstances.
5976
5977- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
5978 rid of the cached copy of thread-local attribute dictionary.
5979
5980- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
5981 are rounded to the nearest integer.
5982
5983- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
5984 falling into recursion.
5985
5986- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
5987 character years even if the message contains RFC822 two character years.
5988
5989- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
5990 operations on its self, namely x -= x and x ^= x.
5991
5992- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
5993 handling when accepting a new connection.
5994
5995- Issue #9601: ftplib now provides a workaround for non-compliant
5996 implementations such as IIS shipped with Windows server 2003 returning invalid
5997 response codes for MKD and PWD commands.
5998
5999- Issue #658749: asyncore's connect() method now correctly interprets winsock
6000 errors.
6001
6002- Issue #9501: Fixed logging regressions in cleanup code.
6003
6004- Fix functools.total_ordering() to skip methods inherited from object.
6005
6006- Issue #9572: Importlib should not raise an exception if a directory it thought
6007 it needed to create was done concurrently by another process.
6008
6009- Issue #9617: Signals received during a low-level write operation aren't
6010 ignored by the buffered IO layer anymore.
6011
6012- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
6013
6014- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
6015 error handler, or strict error handler on Windows.
6016
6017- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
6018 ``gzip.decompress``. Original patch by Anand B. Pillai.
6019
6020- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
6021 ssl.SSLContext object allowing bundling SSL configuration options,
6022 certificates and private keys into a single (potentially long-lived)
6023 structure.
6024
6025- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
6026 single keyword arguments.
6027
6028- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
6029 compiler flag values over defining its own.
6030
6031- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
6032 formatted code information in a string rather than displaying on screen.
6033
6034- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
6035 pointing to the original callable.
6036
6037- Issue #3445: functools.update_wrapper now tolerates missing attributes on
6038 wrapped callables.
6039
6040- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
6041
6042- Issue #9605: posix.getlogin() decodes the username with file filesystem
6043 encoding and surrogateescape error handler. Patch written by David Watson.
6044
6045- Issue #9604: posix.initgroups() encodes the username using the fileystem
6046 encoding and surrogateescape error handler. Patch written by David Watson.
6047
6048- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
6049 using the filesystem encoding and surrogateescape error handler. Patch written
6050 by David Watson.
6051
6052- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
6053 for use with the statvfs() function. Patch by Adam Jackson.
6054
6055- Issue #8688: MANIFEST files created by distutils now include a magic comment
6056 indicating they are generated. Manually maintained MANIFESTs without this
6057 marker will not be overwritten or removed.
6058
6059- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
6060 BadZipfile error is raised if it doesn't match (as used to be the case in
6061 Python 2.5 and earlier).
6062
6063- Issue #9550: a BufferedReader could issue an additional read when the original
6064 read request had been satisfied, which could block indefinitely when the
6065 underlying raw IO channel was e.g. a socket. Report and original patch by
6066 Jason V. Miller.
6067
6068- Issue #3757: thread-local objects now support cyclic garbage collection.
6069 Thread-local objects involved in reference cycles will be deallocated timely
6070 by the cyclic GC, even if the underlying thread is still running.
6071
6072- Issue #9452: Add read_file, read_string, and read_dict to the configparser
6073 API; new source attribute to exceptions.
6074
6075- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
6076 node.
6077
6078- Issue #8047: Fix the xml.etree serializer to return bytes by default. Use
6079 ``encoding="unicode"`` to generate a Unicode string.
6080
6081- Issue #8280: urllib2's Request method will remove fragments in the url. This
6082 is how it is supposed to work, wget and curl do the same. Previous behavior
6083 was wrong.
6084
6085- Issue #6683: For SMTP logins we now try all authentication methods advertised
6086 by the server. Many servers are buggy and advertise authentication methods
6087 they do not support in reality.
6088
6089- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
6090 included in the set of attributes copied by default by functools.wraps and
6091 functools.update_wrapper. Patch by Terrence Cole.
6092
6093- Issue #2944: asyncore doesn't handle connection refused correctly.
6094
6095- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
6096 the private attributes. Add tests for smtpd module.
6097
6098- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
6099 encoded in base64 is lacking padding.
6100
6101- Issue #9444: Argparse now uses the first element of prefix_chars as the option
6102 character for the added 'h/help' option if prefix_chars does not contain a
6103 '-', instead of raising an error.
6104
6105- Issue #7372: Fix pstats regression when stripping paths from profile data
6106 generated with the profile module.
6107
6108- Issue #9428: Fix running scripts with the profile/cProfile modules from the
6109 command line.
6110
6111- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
6112 browser.
6113
6114- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
6115 expressions.
6116
6117- Update collections.OrderedDict to match the implementation in Py2.7 (based on
6118 lists instead of weakly referenced Link objects).
6119
6120- Issue #8397: Raise an error when attempting to mix iteration and regular reads
6121 on a BZ2File object, rather than returning incorrect results.
6122
6123- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
6124 re-initializing a buffered IO object by calling its ``__init__`` method.
6125
6126- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
6127 across devices.
6128
6129- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
6130
6131- Issue #1690103: Fix initial namespace for code run with trace.main().
6132
6133- Issue #7395: Fix tracebacks in pstats interactive browser.
6134
6135- Issue #8230: Fix Lib/test/sortperf.py.
6136
6137- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
6138 newline, it no longer truncates the last character of the last command line.
6139
6140- Issue #5146: Handle UID THREAD command correctly in imaplib.
6141
6142- Issue #5147: Fix the header generated for cookie files written by
6143 http.cookiejar.MozillaCookieJar.
6144
6145- Issue #8198: In pydoc, output all help text to the correct stream when
6146 sys.stdout is reassigned.
6147
6148- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
6149 in ntpath.normpath().
6150
6151- Issue #1286: Allow using fileinput.FileInput as a context manager.
6152
6153- Add lru_cache() decorator to the functools module.
6154
6155Tools/Demos
6156-----------
6157
6158- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
6159
6160- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
6161 non-ASCII content.
6162
6163Tests
6164-----
6165
6166- Issue #9601: Provide a test case for ftplib.parse257.
6167
6168- Issue #8857: Provide a test case for socket.getaddrinfo.
6169
6170- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
6171
6172- Issue #8433: Fix test_curses failure with newer versions of ncurses.
6173
6174- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
6175 Michele Orrù.
6176
6177- Issue #8687: provide a test suite for sched.py module.
6178
6179Build
6180-----
6181
6182- Issue #1303434: Generate ZIP file containing all PDBs.
6183
6184- Issue #9193: PEP 3149 is accepted.
6185
6186- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
6187 become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
6188
6189- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
6190 Sébastien Sablé.
6191
6192- Don't run pgen twice when using make -j.
6193
6194
6195What's New in Python 3.2 Alpha 1?
6196=================================
6197
6198*Release date: 01-Aug-2010*
6199
6200Core and Builtins
6201-----------------
6202
6203- Issue #8991: convertbuffer() rejects discontigious buffers.
6204
6205- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
6206 compiler.
6207
6208- Issue #8413: structsequence now subclasses tuple.
6209
6210- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
6211 start byte and the continuation byte(s) are now considered invalid, instead of
6212 the number of bytes specified by the start byte. E.g.:
6213 '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
6214 with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
6215 even if '\xf1' is the start byte of a 4-bytes sequence. Previous versions
6216 returned a single u'\ufffd'.
6217
6218- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
6219 rather than 0.0. So "-7j" is now exactly equivalent to "-(7j)".
6220
6221- Be more specific in error messages about positional arguments.
6222
6223- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
6224 objects, as described in the documentation.
6225
6226- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
6227 Fix the encoding of the modules filename. Patch written by Amaury Forgeot
6228 d'Arc.
6229
6230- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
6231 dealing with unary minus applied to a constant. The removed code was mutating
6232 the ST, causing a second compilation to fail.
6233
6234- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
6235 mode raises unicode errors. The encoder only supports "strict" and "replace"
6236 error handlers, the decoder only supports "strict" and "ignore" error
6237 handlers. Patch written by Mark Hammond.
6238
6239- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
6240 "w*" format instead. Add tests for "w*" format.
6241
6242- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
6243 formats if the string contains a null byte/character. Write unit tests for
6244 string formats.
6245
6246- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
6247 suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
6248 location of the raised exception.
6249
6250- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
6251 filenames and enable os.fsencode().
6252
6253- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
6254
6255- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
6256 interpreter with characters outside the Basic Multilingual Plane (higher than
6257 0x10000).
6258
6259- Issue #8950: (See also issue #5080). Py_ArgParse*() functions now raise
6260 TypeError instead of giving a DeprecationWarning when a float is parsed using
6261 the 'L' code (for long long). (All other integer codes already raise
6262 TypeError in this case.)
6263
6264- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
6265 enable shortcuts for upper case encoding name. Add also a shortcut for
6266 "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
6267
6268- Issue #8838: Remove codecs.charbuffer_encode() function. The buffer protocol
6269 doesn't support "char buffer" anymore in Python 3.
6270
6271- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
6272 instead. codecs.charbuffer_encode() now accepts modifiable buffer objects
6273 like bytearray.
6274
6275- Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is no
6276 used anymore and it was never documented.
6277
6278- In str.format(), raise a ValueError when indexes to arguments are too large.
6279
6280- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
6281 integers n (including n = -909).
6282
6283- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
6284 of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
6285 easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
6286 equal value.
6287
6288- Issue #8748: Fix two issues with comparisons between complex and integer
6289 objects. (1) The comparison could incorrectly return True in some cases
6290 (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
6291 (2) The comparison raised an OverflowError for large integers, leading to
6292 unpredictable exceptions when combining integers and complex objects in sets
6293 or dicts.
6294
6295- Issue #8766: Initialize _warnings module before importing the first module.
6296 Fix a crash if an empty directory called "encodings" exists in sys.path.
6297
6298- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
6299 encoding and surrogateescape error handler instead of the locale encoding to
6300 be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
6301
6302- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
6303 of strict) error handler to escape surrogates.
6304
6305- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
6306 object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
6307 handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall
6308 back to UTF-8.
6309
6310- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
6311 error handler, not only the default error handler (strict).
6312
6313- Issue #8610: Load file system codec at startup, and display a fatal error on
6314 failure. Set the file system encoding to utf-8 (instead of None) if getting
6315 the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
6316
6317- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
6318 PyUnicode_FromString() to support surrogates in the filename and use the right
6319 encoding.
6320
6321- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
6322
6323- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
6324
6325- Issue #8419: Prevent the dict constructor from accepting non-string keyword
6326 arguments.
6327
6328- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
6329 indirectly Python signal handlers anymore because mywrite() ignores exceptions
6330 (KeyboardInterrupt).
6331
6332- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
6333 unicode string (eg. backslashreplace).
6334
6335- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
6336 anymore, you have to convert your bytearray filenames to bytes.
6337
6338- Issue #7332: Remove the 16KB stack-based buffer in
6339 PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
6340 compared to the dynamic memory allocation fallback. Patch by Charles-François
6341 Natali.
6342
6343- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
6344 passed to bytes or bytearray.
6345
6346- Issue #7301: Add environment variable $PYTHONWARNINGS.
6347
6348- Issue #8329: Don't return the same lists from select.select when no fds are
6349 changed.
6350
6351- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
6352 64-bit machines. The shift count for either left or right shift is permitted
6353 to be up to sys.maxsize.
6354
6355- Ensure that tokenization of identifiers is not affected by locale.
6356
6357- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
6358
6359- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
6360
6361- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
6362 is set.
6363
6364- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
6365 is unknown.
6366
6367- Issue #1583863: A str subclass can now override the __str__ method.
6368
6369- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
6370 PyMemberDefs could produce an internal error; raise TypeError instead.
6371
6372- Issue #7845: Rich comparison methods on the complex type now return
6373 NotImplemented rather than raising a TypeError when comparing with an
6374 incompatible type; this allows user-defined classes to implement their own
6375 comparisons with complex.
6376
6377- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
6378 (SIGINT). If an error occurs while importing the site module, the error is
6379 printed and Python exits. Initialize the GIL before importing the site module.
6380
6381- Issue #7173: Generator finalization could invalidate sys.exc_info().
6382
6383- Issue #7544: Preallocate thread memory before creating the thread to avoid a
6384 fatal error in low memory condition.
6385
6386- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
6387 check fails.
6388
6389- Handle errors from looking up __prepare__ correctly.
6390
6391- Issue #5939: Add additional runtime checking to ensure a valid capsule in
6392 Modules/_ctypes/callproc.c.
6393
6394- Issue #7309: Fix unchecked attribute access when converting
6395 UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
6396
6397- Issue #6902: Fix problem with built-in types format incorrectly with 0
6398 padding.
6399
6400- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
6401 Now it matches other numeric types.
6402
6403- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
6404 PyOS_ascii_strtod, and PyOS_ascii_atof. Use PyOS_double_to_string and
6405 PyOS_string_to_double instead. See issue #5835 for the original deprecations.
6406
6407- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
6408 fails. Patch by Florent Xicluna.
6409
6410- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
6411 very large step value.
6412
6413- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
6414 add the additional members returned in an OSVERSIONINFOEX structure. The new
6415 members are service_pack_major, service_pack_minor, suite_mask, and
6416 product_type.
6417
6418- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
6419 crash in many places because of the PyByteArray_AS_STRING() macro returning
6420 NULL. The macro now returns a statically allocated empty string instead.
6421
6422- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
6423 where the right hand operand is a set of constants, by turning the set into a
6424 frozenset and pre-building it as a constant. The comparison operation is made
6425 against the constant instead of building a new set each time it is executed (a
6426 similar optimization already existed which turned a list of constants into a
6427 pre-built tuple). Patch and additional tests by Dave Malcolm.
6428
6429- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
6430 of bytes, bytearray and unicode objects by using a common implementation based
6431 on stringlib's fast search. Patch by Florent Xicluna.
6432
6433- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
6434 including: (1) a serious 'wrong output' bug that could occur for long (> 40
6435 digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
6436 parsing certain long numeric strings corresponding to subnormal values, (3) a
6437 memory leak for some values large enough to cause overflow, and (4) a number
6438 of flaws that could lead to incorrectly rounded results.
6439
6440- The __complex__ method is now looked up on the class of instances to make it
6441 consistent with other special methods.
6442
6443- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
6444 `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
6445
6446- Issue #7604: Deleting an unset slotted attribute did not raise an
6447 AttributeError.
6448
6449- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
6450 in ** operator. The behaviour now conforms to that described in C99 Annex F.
6451
6452- Issue #1811: improve accuracy and cross-platform consistency for true division
6453 of integers: the result of a/b is now correctly rounded for ints a and b (at
6454 least on IEEE 754 platforms), and in particular does not depend on the
6455 internal representation of an int.
6456
6457- Issue #6834: replace the implementation for the 'python' and 'pythonw'
6458 executables on OSX.
6459
6460 These executables now work properly with the arch(1) command: ``arch -ppc
6461 python`` will start a universal binary version of python in PPC mode (unlike
6462 previous releases).
6463
6464- Issue #7466: Segmentation fault when the garbage collector is called in the
6465 middle of populating a tuple. Patch by Florent Xicluna.
6466
6467- Issue #7419: setlocale() could crash the interpreter on Windows when called
6468 with invalid values.
6469
6470- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
6471 mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
6472
6473- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
6474 10.6.
6475
6476- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
6477
6478- Issue #6970: Remove redundant calls when comparing objects that don't
6479 implement the relevant rich comparison methods.
6480
6481- Issue #7298: Fixes for range and reversed(range(...)). Iteration over
6482 range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
6483 long but the length of the range did not. Also fix several cases where
6484 reversed(range(a, b, c)) gave wrong results, and fix a refleak for
6485 reversed(range(a, b, c)) with large arguments.
6486
6487- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
6488 during the formation of an output tuple.
6489
6490- Issue #3297: On wide unicode builds, do not split unicode characters into
6491 surrogates.
6492
6493- Remove length limitation when constructing a complex number from a string.
6494
6495- Issue #1087418: Boost performance of bitwise operations for longs.
6496
6497- Support for AtheOS has been completely removed from the code base. It was
6498 disabled since Python 3.0.
6499
6500- Support for several legacy threading libraries has been disabled. These
6501 libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
6502 will be entirely removed in 3.3.
6503
6504- Support for OSF* has been disabled. If nobody stands up, support will be
6505 removed in 3.3. See <http://bugs.python.org/issue8606>.
6506
6507- Peephole constant folding had missed UNARY_POSITIVE.
6508
6509- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
6510 fixes the problem of some exceptions being thrown at shutdown when the
6511 interpreter is killed. Patch by Adam Olsen.
6512
6513- Issue #7147: Remove support for compiling Python without complex number
6514 support.
6515
6516- Issue #7120: logging: Removed import of multiprocessing which is causing crash
6517 in GAE.
6518
6519- Issue #1754094: Improve the stack depth calculation in the compiler. There
6520 should be no other effect than a small decrease in memory use. Patch by
6521 Christopher Tur Lesniewski-Laas.
6522
6523- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
6524 byte values greater than 127. Patch by Derk Drukker.
6525
6526- Issue #1571184: The Unicode database contains properties for more characters.
6527 The tables for code points representing numeric values, white spaces or line
6528 breaks are now generated from the official Unicode Character Database files,
6529 and include information from the Unihan.txt file.
6530
6531- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
6532 producing internally inconsistent Python longs.
6533
6534- Issue #6990: Fix threading.local subclasses leaving old state around after a
6535 reference cycle GC which could be recycled by new locals.
6536
6537- Issue #5460: Fix an ambiguity in the grammar.
6538
6539- Issue #1766304: Improve performance of membership tests on range objects.
6540
6541- Issue #6713: Improve performance of integer -> string conversions.
6542
6543- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
6544
6545- Issue #6750: A text file opened with io.open() could duplicate its output when
6546 writing from multiple threads at the same time.
6547
6548- Issue #6707: dir() on an uninitialized module caused a crash.
6549
6550- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
6551
6552- Issue #6573: set.union() stopped processing inputs if an instance of self
6553 occurred in the argument chain.
6554
6555- Issue #6070: On posix platforms import no longer copies the execute bit from
6556 the .py file to the .pyc file if it is set.
6557
6558- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
6559
6560- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
6561 and not an int. Fix the corresponding error message, and the documentation.
6562
6563- The deprecated PyCObject has been removed.
6564
6565- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a
6566 build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
6567 of stdint.h on that platform.
6568
6569- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
6570 'surrogateescape' error handler, a string which contains unpaired surrogates.
6571
6572- Issue #4856: Remove checks for win NT.
6573
6574- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
6575 to construct a null-initialized bytes object.
6576
6577- Issue #1023290: Add from_bytes() and to_bytes() methods to integers. These
6578 methods allow the conversion of integers to bytes, and vice-versa.
6579
6580- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
6581 from being copied with copy.copy(), and bytes subclasses from being pickled
6582 properly.
6583
6584- Code objects now support weak references.
6585
6586- Issue #7072: isspace(0xa0) is true on Mac OS X.
6587
6588- Issue #8084: PEP 370 now conforms to system conventions for framework builds
6589 on MacOS X. That is, "python setup.py install --user" will install into
6590 "~/Library/Python/2.7" instead of "~/.local".
6591
6592C-API
6593-----
6594
6595- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
6596 variable argument list. `Py_VA_COPY` is equivalent to C99
6597 `va_copy`, but available on all python platforms.
6598
6599- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
6600 instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX]. This makes it safe to do
6601 "step = -step" when reversing a slice.
6602
6603- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
6604 interpreter to set sys.argv without also modifying sys.path. This helps fix
6605 `CVE-2008-5983
6606 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
6607
6608- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
6609 strings in an efficient manner.
6610
6611- Issue #8276: PyEval_CallObject() is now only available in macro form. The
6612 function declaration, which was kept for backwards compatibility reasons, is
6613 now removed (the macro was introduced in 1997!).
6614
6615- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
6616 PyLong_AsLongAndOverflow.
6617
6618- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
6619 has '\0' at the end.
6620
6621- Issue #5080: The argument parsing functions PyArg_ParseTuple,
6622 PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
6623 PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
6624 'L' format code. This will become a TypeError in a future version of Python,
6625 to match the behaviour of the other integer format codes.
6626
6627- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
6628
6629- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
6630 PyArg_ParseTupleAndKeywords.
6631
6632- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
6633 PyErr_Format, on machines with HAVE_LONG_LONG defined.
6634
6635- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
Martin Panter8d56c022016-05-29 04:13:35 +00006636 PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be used for
Georg Brandl86dc7322012-10-01 18:58:45 +02006637 accessing the d_type and d_name members of structures using PyDescr_COMMON.
6638
6639- Issue #6405: Remove duplicate type declarations in descrobject.h.
6640
6641- The code flags for old __future__ features are now available again.
6642
6643- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
6644 PyCode_Addr2Line().
6645
6646- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
6647 object at a specified file, function, and line number.
6648
6649- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
6650 ``const char *`` as the string is stored beyond the call.
6651
6652- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
6653 allocator will be automatically disabled when running under Valgrind. This
6654 gives improved memory leak detection when running under Valgrind, while taking
6655 advantage of pymalloc at other times.
6656
6657Library
6658-------
6659
6660- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
6661 old commands are restored.
6662
6663- For traceback debugging, the pdb listing now also shows the locations where
6664 the exception was originally (re)raised, if it differs from the last line
6665 executed (e.g. in case of finally clauses).
6666
6667- The pdb command "source" has been added. It displays the source code for a
6668 given object, if possible.
6669
6670- The pdb command "longlist" has been added. It displays the whole source code
6671 for the current function.
6672
6673- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
6674 output into methods.
6675
6676- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
6677 emit a message when a breakpoint is enabled or disabled.
6678
6679- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
6680 top-level debugged frame.
6681
6682- Issue #5727: Restore the ability to use readline when calling into pdb in
6683 doctests.
6684
6685- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
6686 source file to be debugged is in a non-builtin encoding.
6687
6688- Issue #8048: Prevent doctests from failing when sys.displayhook has been
6689 reassigned.
6690
6691- Issue #8015: In pdb, do not crash when an empty line is entered as a
6692 breakpoint command.
6693
6694- In pdb, allow giving a line number to the "until" command.
6695
6696- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
6697 files. Also, add a command-line option "-c" that runs a command as if given
6698 in .pdbrc.
6699
6700- Issue #4179: In pdb, allow "list ." as a command to return to the currently
6701 debugged line.
6702
6703- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
6704 entries, consider the first one.
6705
6706- Issue #6630: Allow customizing regex flags when subclassing the
6707 string.Template class.
6708
6709- Issue #9411: Allow specifying an encoding for config files in the configparser
6710 module.
6711
6712- Issue #1682942: Improvements to configparser: support alternate delimiters,
6713 alternate comment prefixes and empty lines in values.
6714
6715- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
6716
6717- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
6718
6719- Issue #9378: python -m pickle <pickle file> will now load and display the
6720 first object in the pickle file.
6721
6722- Issue #4770: Restrict binascii module to accept only bytes (as specified).
6723 And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
6724 before ASCII-to-binary decoding.
6725
6726- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
6727
6728- The default size of the re module's compiled regular expression cache has been
6729 increased from 100 to 500 and the cache replacement policy has changed from
6730 simply clearing the entire cache on overflow to forgetting the least recently
6731 used cached compiled regular expressions. This is a performance win for
6732 applications that use a lot of regular expressions and limits the impact of
6733 the performance hit anytime the cache is exceeded.
6734
6735- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
6736
6737- Issue #9032: XML-RPC client retries the request on EPIPE error. The EPIPE
6738 error occurs when the server closes the socket and the client sends a big
6739 XML-RPC request.
6740
6741- Issue #4629: getopt raises an error if an argument ends with "=", whereas
6742 getopt doesn't accept a value (eg. --help= is rejected if getopt uses
6743 ['help='] long options).
6744
6745- Issue #7989: Added pure python implementation of the `datetime` module. The C
6746 module is renamed to `_datetime` and if available, overrides all classes
6747 defined in datetime with fast C impementation. Python implementation is based
6748 on the original python prototype for the datetime module by Tim Peters with
6749 minor modifications by the PyPy project. The test suite now tests `datetime`
6750 module with and without `_datetime` acceleration using the same test cases.
6751
6752- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
6753
Martin Panter9955a372015-10-07 10:26:23 +00006754- Issue #9323: Fixed a bug in trace.py that resulted in losing the name of the
Georg Brandl86dc7322012-10-01 18:58:45 +02006755 script being traced. Patch by Eli Bendersky.
6756
6757- Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for
6758 the patch.
6759
6760- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
6761 parameters.
6762
6763- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
6764 which controls printing of opcode descriptions in ``dis()`` output.
6765
6766- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
6767 crosses an 8192 byte boundary.
6768
6769- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
6770
6771- ``ast.literal_eval()`` now allows byte literals.
6772
6773- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
6774 keyword arguments called 'self' or 'other' specially.
6775
6776- ``ast.literal_eval()`` now allows set literals.
6777
6778- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
6779
6780- Issue #7646: The fnmatch pattern cache no longer grows without bound.
6781
6782- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
6783 produced when profiling the decimal module. This was due to a dangerous
6784 iteration over 'locals()' in Context.__init__.
6785
6786- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
6787 and the exponent is tiny (for example, ``Decimal(10) **
6788 Decimal('1e-999999999')``).
6789
6790- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
6791
6792- Issue #9130: Fix validation of relative imports in parser module.
6793
6794- Issue #9128: Fix validation of class decorators in parser module.
6795
6796- Issue #9094: python -m pickletools will now disassemble pickle files listed in
6797 the command line arguments. See output of python -m pickletools -h for more
6798 details.
6799
6800- Issue #5468: urlencode to handle bytes type and other encodings in its query
6801 parameter. Patch by Dan Mahn.
6802
6803- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
6804 ensure that the input string length is a multiple of the frame size.
6805
6806- Issue #6507: Accept source strings in dis.dis(). Original patch by Daniel
6807 Urban.
6808
6809- Issue #7829: Clearly document that the dis module is exposing an
6810 implementation detail that is not stable between Python VMs or releases.
6811
6812- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
6813 raises an exception.
6814
6815- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
6816 that act as both context managers and decorators. contextmanager changes to
6817 use ContextDecorator.
6818
6819- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
6820 for removal in Python 3.4.
6821
6822- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
6823 giving the number of frames to go.
6824
6825- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
6826 ``str`` or ``bytes``.
6827
6828- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
6829 OpenSSL structure.
6830
6831- Issue #8682: The ssl module now temporary increments the reference count of a
6832 socket object got through ``PyWeakref_GetObject``, so as to avoid possible
6833 deallocation while the object is still being used.
6834
6835- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
6836 password instead of presenting an interactive prompt. Older behavior can be
6837 obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
6838
6839- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
6840 smart enough to find source files in the linecache.
6841
6842- Issue #5610: feedparser no longer eats extra characters at the end of a body
6843 part if the body part ends with a ``\r\n``.
6844
6845- Issue #8986: math.erfc was incorrectly raising OverflowError for values
6846 between -27.3 and -30.0 on some platforms.
6847
6848- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
6849
6850- Issue #8966: If a ctypes structure field is an array of c_char, convert its
6851 value to bytes instead of str (as done for c_char and c_char_p).
6852
6853- Issue #8188: Comparisons between Decimal and Fraction objects are now
6854 permitted, returning a result based on the exact numerical values of the
6855 operands. This builds on issue #2531, which allowed Decimal-to-float
6856 comparisons; all comparisons involving numeric types (bool, int, float,
6857 complex, Decimal, Fraction) should now act as expected.
6858
6859- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
6860 Thomas Jollans.
6861
6862- Issue #8899: time.struct_time now has class and attribute docstrings.
6863
6864- Issue #6470: Drop UNC prefix in FixTk.
6865
6866- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
6867 strings. They are now correctly converted to strings.
6868
6869- Issue #8833: tarfile created hard link entries with a size field != 0 by
6870 mistake.
6871
6872- Charset.body_encode now correctly handles base64 encoding by encoding with the
6873 output_charset before calling base64mime.encode. Passes the tests from 2.x
6874 issue #1368247.
6875
6876- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
6877 attribute that is True iff there are uncommitted changes.
6878
6879- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
6880 divided by float and int objects. Results are rounded to the nearest multiple
6881 of timedelta.resolution with ties resolved using round-half-to-even method.
6882
6883- Issue #7150: Raise OverflowError if the result of adding or subtracting
6884 timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
6885
6886- Issue #8806: add SSL contexts support to ftplib.
6887
6888- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
6889 and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
6890 API.
6891
6892- Issue #8770: Now sysconfig displays information when it's called as a script.
6893 Initial idea by Sridhar Ratnakumar.
6894
6895- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
6896 Fredrik Håård.
6897
6898- Issue #8540: Decimal module: rename the Context._clamp attribute to
6899 Context.clamp and make it public. This is useful in creating contexts that
6900 correspond to the decimal interchange formats specified in IEEE 754.
6901
6902- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
6903 twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
6904 StreamWriter classes.
6905
6906- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
6907 of the C file stderr, to use stderr encoding and error handler.
6908
6909- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
6910 of files without one.
6911
6912- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
6913 comparing to a non-mapping.
6914
6915- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
6916 correct encoding.
6917
6918- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
Martin Panterc04fb562016-02-10 05:44:01 +00006919 ``OP_*`` constants to the `ssl` module. This allows selectively disabling
Georg Brandl86dc7322012-10-01 18:58:45 +02006920 protocol versions, when used in combination with `PROTOCOL_SSLv23`.
6921
6922- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
6923
6924- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
6925 compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
6926 stdout is not a TTY).
6927
6928- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
6929 subprocess.Popen() and os._execvpe() support bytes program name. Add
6930 os.supports_bytes_environ flag: True if the native OS type of the environment
6931 is bytes (eg. False on Windows).
6932
6933- Issue #8633: tarfile is now able to read and write archives with "raw" binary
6934 pax headers as described in POSIX.1-2008.
6935
6936- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
6937 unquote, unquote_to_bytes.
6938
Ezio Melotti85a86292013-08-17 16:57:41 +03006939- Issue #8688: Distutils now recalculates MANIFEST every time.
Georg Brandl86dc7322012-10-01 18:58:45 +02006940
6941- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
6942 surrogates and bytes for the filename.
6943
6944- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
6945
6946- Issue #8681: Make the zlib module's error messages more informative when the
6947 zlib itself doesn't give any detailed explanation.
6948
6949- The audioop module now supports sound fragments of length greater than 2**31
6950 bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
6951
Serhiy Storchaka14867992014-09-10 23:43:41 +03006952- Issue #4972: Add support for the context management protocol to the ftplib.FTP
Georg Brandl86dc7322012-10-01 18:58:45 +02006953 class.
6954
6955- Issue #8664: In py_compile, create __pycache__ when the compiled path is
6956 given.
6957
6958- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
6959 for use in the file system, environment variables or the command line.
6960
6961- Issue #8571: Fix an internal error when compressing or decompressing a chunk
6962 larger than 1GB with the zlib module's compressor and decompressor objects.
6963
6964- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
6965 mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
6966 file system encoding with the surrogateescape error handler (instead of
6967 utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
6968
6969- Issue #8573: asyncore _strerror() function might throw ValueError.
6970
6971- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
6972 messages when accessing undefined class attributes because of the cheap
6973 inheritance with the underlying socket object. The cheap inheritance has been
6974 deprecated.
6975
6976- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
6977 Patch by Tres Seaver.
6978
6979- Issue #8390: tarfile uses surrogateescape as the default error handler
6980 (instead of replace in read mode or strict in write mode).
6981
6982- Issue #7755: Use an unencumbered audio file for tests.
6983
6984- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
6985 and any children created using ``os.fork`` on MacOS X 10.6.
6986
6987- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
6988 operation raises multiple signals and more than one of those signals is
6989 trapped, the specification determines the order in which the signals should be
6990 handled. In many cases this order wasn't being followed, leading to the wrong
6991 Python exception being raised.
6992
6993- Issue #7865: The close() method of ``io`` objects should not swallow
6994 exceptions raised by the implicit flush(). Also qensure that calling close()
6995 several times is supported. Patch by Pascal Chambon.
6996
6997- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
6998 gc.DEBUG_STATS.
6999
7000- Issue #8354: The siginterrupt setting is now preserved for all signals, not
7001 just SIGCHLD.
7002
7003- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
7004 webbrowser.get("safari").
7005
7006- Issue #8464: tarfile no longer creates files with execute permissions set when
7007 mode="w|" is used.
7008
7009- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
7010 the Linux kernel. Patch by Yaniv Aknin.
7011
7012- Issue #8295: Added shutil.unpack_archive.
7013
7014- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
7015 It should correctly return an empty response now.
7016
7017- Issue #8546: Reject None given as the buffering argument to _pyio.open.
7018
7019- Issue #8549: Fix compiling the _ssl extension under AIX. Patch by
7020 Sridhar Ratnakumar.
7021
7022- Issue #6656: fix locale.format_string to handle escaped percents
7023 and mappings.
7024
7025- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
7026 the method could block indefinitely if called just before the event loop
7027 started running. This also fixes the occasional freezes witnessed in
7028 test_httpservers.
7029
7030- Issue #8524: When creating an SSL socket, the timeout value of the original
7031 socket wasn't retained (instead, a socket with a positive timeout would be
7032 turned into a non-blocking SSL socket).
7033
7034- Issue #5103: SSL handshake would ignore the socket timeout and block
7035 indefinitely if the other end didn't respond.
7036
7037- The do_handshake() method of SSL objects now adjusts the blocking mode of the
7038 SSL structure if necessary (as other methods already do).
7039
7040- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
7041 bytes strings for environment keys and values.
7042
7043- Issue #8467: Pure Python implementation of subprocess encodes the error
7044 message using surrogatepass error handler to support surrogates in the
7045 message.
7046
7047- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
7048
7049- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
7050 string "python" as the *ident*. openlog() arguments are all optional and
7051 keywords.
7052
7053- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
7054 non-infinite timeout. Also make that method friendlier with applications
7055 wanting to continue using the socket in clear-text mode, by disabling
7056 OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
7057
7058- Issue #8496: make mailcap.lookup() always return a list, rather than an
7059 iterator. Patch by Gregory Nofi.
7060
7061- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
7062 collation name contains a surrogate character.
7063
7064- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
7065 extension, such that verification of some SSL certificates doesn't fail
7066 because of an "unknown algorithm".
7067
7068- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
7069
7070- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
7071
7072- Issue #4814: timeout parameter is now applied also for connections resulting
7073 from PORT/EPRT commands.
7074
7075- Issue #8463: added missing reference to bztar in shutil's documentation.
7076
7077- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
7078 long as the user didn't specify 'automatic proxy configuration').
7079
7080- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
7081 as stated in RFC-959 at chapter 5.4.
7082
7083- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
7084 surrogates.
7085
7086- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
7087 `threading.Semaphore` objects. Original patch by Torsten Landschoff.
7088
7089- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
7090 available cipher list. Helps fix test_ssl with OpenSSL 1.0.0.
7091
7092- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
7093 the current working directory.
7094
7095- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
7096 using backslashreplace error handler.
7097
7098- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
7099
7100- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
7101 Locke and Hans Ulrich Niedermann.
7102
7103- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
7104
7105- Issue #7316: The acquire() method of lock objects in the ``threading``
7106 module now takes an optional timeout argument in seconds. Timeout support
7107 relies on the system threading library, so as to avoid a semi-busy wait loop.
7108
7109- Issue #8383: pickle and pickletools use surrogatepass error handler when
7110 encoding unicode as utf8 to support lone surrogates and stay compatible with
7111 Python 2.x and 3.x.
7112
7113- Issue #7585: difflib context and unified diffs now place a tab between
7114 filename and date, conforming to the 'standards' they were originally designed
7115 to follow. This improves compatibility with patch tools.
7116
7117- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
7118 character sets will now consistently use a Content-Transfer-Encoding of 7bit
7119 rather than sometimes being marked as 8bit.
7120
7121- Issue #8375: test_distutils now checks if the temporary directory are still
7122 present before it cleans them.
7123
7124- Issue #8374: Update the internal alias table in the ``locale`` module to
7125 cover recent locale changes and additions.
7126
7127- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
7128 using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
7129 `ssl.OPENSSL_VERSION_NUMBER`.
7130
7131- Add functools.total_ordering() and functools.cmp_to_key().
7132
7133- Issue #8257: The Decimal construct now accepts a float instance directly,
7134 converting that float to a Decimal of equal value:
7135
7136 >>> Decimal(1.1)
7137 Decimal('1.100000000000000088817841970012523233890533447265625')
7138
7139- Issue #8294: The Fraction constructor now accepts Decimal and float instances
7140 directly.
7141
7142- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
7143 InvalidOperation instead of returning False. (Comparisons involving a quiet
7144 NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
7145 signaling NaNs remain unhashable.
7146
7147- Issue #2531: Comparison operations between floats and Decimal instances now
7148 return a result based on the numeric values of the operands; previously they
7149 returned an arbitrary result based on the relative ordering of id(float) and
7150 id(Decimal). See also issue #8188, which adds Decimal-to-Fraction
7151 comparisons.
7152
7153- Added a subtract() method to collections.Counter().
7154
7155- Issue #8233: When run as a script, py_compile.py optionally takes a single
7156 argument `-` which tells it to read files to compile from stdin. Each line is
7157 read on demand and the named file is compiled immediately. (Original patch by
7158 Piotr Ożarowski).
7159
7160- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
7161 form feed (0x0C) are now considered linebreaks, as specified in Unicode
7162 Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
7163
7164- Comparisons using one of <, <=, >, >= between a complex instance and a
7165 Fractions instance now raise TypeError instead of returning True/False. This
7166 makes Fraction <=> complex comparisons consistent with int <=> complex, float
7167 <=> complex, and complex <=> complex comparisons.
7168
7169- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
7170 methods (such as oss_mixer_device.fileno()) were not available. Initial patch
7171 by Bertrand Janin.
7172
7173- Issue #8205: Remove the "Modules" directory from sys.path when Python is
7174 running from the build directory (POSIX only).
7175
7176- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
7177 didn't support chflags() (for example ZFS under FreeBSD). The error is now
7178 silenced.
7179
7180- Issue #7860: platform.uname now reports the correct 'machine' type when Python
7181 is running in WOW64 mode on 64 bit Windows.
7182
7183- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
7184 Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
7185 reads and writes are always retried by OpenSSL itself.
7186
7187- Issue #4282: Fix the main function of the profile module for a non-ASCII
7188 script, open the file in binary mode and not in text mode with the default
7189 (utf8) encoding.
7190
7191- Issue #8179: Fix macpath.realpath() on a non-existing path.
7192
7193- Issue #8024: Update the Unicode database to 5.2.
7194
7195- Issue #8168: py_compile now handles files with utf-8 BOMS.
7196
7197- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
7198 detected.
7199
7200- Issue #6716/2: Backslash-replace error output in compilall.
7201
7202- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
7203 with Tcl/Tk-8.5.
7204
7205- Issue #8140: extend compileall to compile single files. Add -i option.
7206
7207- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
7208 locale.
7209
7210- The internals of the subprocess module on POSIX systems have been replaced by
7211 an extension module (_posixsubprocess) so that the fork()+exec() can be done
7212 safely without the possibility of deadlock in multithreaded applications.
7213
7214- subprocess.Popen now has restore_signals and start_new_session features. The
7215 default of restore_signals=True is a new behavior compared to earlier Python
7216 versions. This means that signals such as SIGPIPE are not ignored by default
7217 in subprocesses launched by Python (Issue #1652).
7218
7219- Issue #6472: The xml.etree package is updated to ElementTree 1.3. The
7220 cElementTree module is updated too.
7221
7222- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +03007223 a non existent program name and Python is unable to retrieve the real program
Georg Brandl86dc7322012-10-01 18:58:45 +02007224 name.
7225
7226- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
7227
7228- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
7229 replacement were all bytes. Patch by Antoine Pitrou.
7230
7231- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
7232 bugs and allows loading SQLite extensions from shared libraries.
7233
7234- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
7235 Review Issue #29 (http://unicode.org/review/pr-29.html).
7236
7237- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
7238 reset also the pointer to the current pointer context.
7239
Serhiy Storchaka14867992014-09-10 23:43:41 +03007240- Issue #7232: Add support for the context management protocol to the TarFile
Georg Brandl86dc7322012-10-01 18:58:45 +02007241 class.
7242
7243- Issue #7250: Fix info leak of os.environ across multi-run uses of
7244 wsgiref.handlers.CGIHandler.
7245
7246- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
7247
7248- Issue #691291: codecs.open() should not convert end of lines on reading and
7249 writing.
7250
7251- Issue #7869: logging: improved diagnostic for format-time errors.
7252
7253- Issue #7868: logging: added loggerClass attribute to Manager.
7254
7255- logging: Implemented PEP 391.
7256
7257- Issue #1537721: Add a writeheader() method to csv.DictWriter.
7258
7259- Issue #7959: ctypes callback functions are now registered correctly with the
7260 cycle garbage collector.
7261
7262- Issue #5801: removed spurious empty lines in wsgiref.
7263
7264- Issue #6666: fix bug in trace.py that applied the list of directories to be
7265 ignored only to the first file. Noted by Bogdan Opanchuk.
7266
7267- Issue #7597: curses.use_env() can now be called before initscr(). Noted by
7268 Kan-Ru Chen.
7269
7270- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
7271
7272- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
7273 messages parsed by email.Parser.HeaderParser.
7274
7275- Issue #7361: Importlib was not properly checking the number of bytes in
Martin Pantere26da7c2016-06-02 10:07:09 +00007276 bytecode file when it was less than 8 bytes.
Georg Brandl86dc7322012-10-01 18:58:45 +02007277
7278- Issue #7633: In the decimal module, Context class methods (with the exception
7279 of canonical and is_canonical) now accept instances of int and long wherever a
7280 Decimal instance is accepted, and implicitly convert that argument to Decimal.
7281 Previously only some arguments were converted.
7282
7283- Issue #7835: shelve should no longer produce mysterious warnings during
7284 interpreter shutdown.
7285
7286- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
7287 processing instructions and comments. These raw characters are allowed by the
7288 XML specification, and are necessary when outputting e.g. PHP code in a
7289 processing instruction. Patch by Neil Muller.
7290
7291- Issue #6233: ElementTree failed converting unicode characters to XML entities
7292 when they could't be represented in the requested output encoding. Patch by
7293 Jerry Chen.
7294
7295- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
7296 compression type.
7297
7298- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
7299 specified, rather than fall through to AF_PACKET (in the `socket` module).
7300 Also, raise ValueError rather than TypeError when an unknown TIPC address type
7301 is specified. Patch by Brian Curtin.
7302
7303- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
7304 position when calling `truncate()`. It would previously change the file
7305 position to the given argument, which goes against the tradition of
7306 ftruncate() and other truncation APIs. Patch by Pascal Chambon.
7307
7308- Issue #7610: Reworked implementation of the internal
7309 ``zipfile.ZipExtFile`` class used to represent files stored inside an
7310 archive. The new implementation is significantly faster and can be wrapped in
Martin Panter7462b6492015-11-02 03:37:02 +00007311 an ``io.BufferedReader`` object for more speedups. It also solves an
Georg Brandl86dc7322012-10-01 18:58:45 +02007312 issue where interleaved calls to `read()` and `readline()` give wrong results.
7313 Patch by Nir Aides.
7314
7315- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
7316 allowing for a maximum number of tasks within the pool to be completed by the
7317 worker before that worker is terminated, and a new one created to replace it.
7318
7319- Issue #7792: Registering non-classes to ABCs raised an obscure error.
7320
7321- Issue #7785: Don't accept bytes in FileIO.write().
7322
7323- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
7324
7325- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
7326 the release file is empty.
7327
7328- Issue #7561: Fix crashes when using bytearray objects with the posix
7329 module.
7330
7331- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
7332 multipart/signed MIME parts, which fixes one of the sources of invalid
7333 modifications to such parts by Generator.
7334
7335- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`. Patch
7336 by Florent Xicluna, along with some additional tests.
7337
7338- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
7339 argument. Patch by Victor Stinner.
7340
7341- Issue #3299: Fix possible crash in the _sre module when given bad argument
7342 values in debug mode. Patch by Victor Stinner.
7343
7344- Issue #2846: Add support for gzip.GzipFile reading zero-padded files. Patch
7345 by Brian Curtin.
7346
7347- Issue #7681: Use floor division in appropiate places in the wave module.
7348
7349- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
7350 Extension extra options may change the output without changing the .c
7351 file). Initial patch by Collin Winter.
7352
7353- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
7354 when it has a fully qualified configuration prefix. Initial patch by Arfrever.
7355
7356- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
7357 destruction of weakref'ed objects while iterating.
7358
7359- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
7360 Stinner.
7361
7362- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
7363 properly handles EINTR within the read, readline, write & flush methods. The
7364 socket.sendall() method now properly handles interrupted system calls.
7365
7366- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
7367 make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
7368 wrapping it in an `io.BufferedReader`. Patch by Nir Aides.
7369
7370- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
7371 parameter to allow specifying where your connections come from.
7372
7373- socket.create_connection now accepts an optional source_address parameter.
7374
7375- Issue #5511: now zipfile.ZipFile can be used as a context manager. Initial
7376 patch by Brian Curtin.
7377
7378- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
7379 Manifest file in text mode so string patterns can be used in regular
7380 expressions.
7381
7382- Issue #7552: Removed line feed in the base64 Authorization header in the
7383 Distutils upload command to avoid an error when PyPI reads it. This occurs on
7384 long passwords. Initial patch by JP St. Pierre.
7385
7386- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
7387 Tatsuhiro Tsujikawa.
7388
7389- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
7390 TypeError when given an `str` object (rather than a `bytes`-like object).
7391 Patch by Victor Stinner and Florent Xicluna.
7392
7393- Issue #7349: Make methods of file objects in the io module accept None as an
7394 argument where file-like objects (ie StringIO and BytesIO) accept them to mean
7395 the same as passing no argument.
7396
7397- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
7398
7399- Issue #5949: added check for correct lineends in input from IMAP server in
7400 imaplib.
7401
7402- Add count() and reverse() methods to collections.deque().
7403
7404- Fix variations of extending deques: d.extend(d) d.extendleft(d) d+=d
7405
7406- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
7407 parameter types. Patch by Victor Stinner.
7408
7409- Issue #7457: added a read_pkg_file method to
7410 distutils.dist.DistributionMetadata.
7411
7412- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
7413 TLS with authentication credentials.
7414
7415- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
7416 in Distutils. Patch by Stephen Emslie.
7417
7418- Issue #4120: Drop reference to CRT from manifest when building extensions with
7419 msvc9compiler.
7420
7421- Issue #7333: The `posix` module gains an `initgroups()` function providing
7422 access to the initgroups(3) C library call on Unix systems which implement it.
7423 Patch by Jean-Paul Calderone.
7424
7425- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
7426 ownership when the group is not forced, because the group may be different
7427 from the user's group and inherit from its container when the test is run.
7428
7429- Issue #4486: When an exception has an explicit cause, do not print its
7430 implicit context too. This affects the `traceback` module as well as built-in
7431 exception printing.
7432
7433- Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert
7434 Collins.
7435
7436- Issue #7403: logging: Fixed possible race condition in lock creation.
7437
7438- Issue #6845: Add restart support for binary upload in ftplib. The
7439 `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
7440 argument. Patch by Pablo Mouzo.
7441
7442- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
7443 returning the total number of seconds in the duration. Patch by Brian
7444 Quinlan.
7445
7446- Issue #7133: SSL objects now support the new buffer API.
7447
7448- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
7449
7450- Issue #6123: tarfile now opens empty archives correctly and consistently
7451 raises ReadError on empty files.
7452
7453- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
7454
7455- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
7456 of __str__.
7457
7458- Issue #7341: Close the internal file object in the TarFile constructor in case
7459 of an error.
7460
7461- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
7462 Windows box. Help provided by David Bolen.
7463
7464- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
7465 or SSL. Patch by Giampaolo Rodola'.
7466
7467- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
7468
7469- Issue #4969: The mimetypes module now reads the MIME database from the
7470 registry under Windows. Patch by Gabriel Genellina.
7471
7472- Issue #6816: runpy now provides a run_path function that allows Python code to
7473 execute file paths that refer to source or compiled Python files as well as
7474 zipfiles, directories and other valid sys.path entries that contain a
7475 __main__.py file. This allows applications that run other Python scripts to
7476 support the same flexibility as the CPython command line itself.
7477
7478- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
7479 connection with another process, rather than looping endlessly. The default
7480 timeout is 20 seconds, which should be amply sufficient for local connections.
7481
7482- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
7483 unpickled. This fixes crashes under Windows when trying to run
7484 test_multiprocessing in verbose mode.
7485
7486- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
7487 argument added to the TextTestRunner constructor allowing a different result
7488 class to be used without having to subclass.
7489
7490- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
7491 name in failure reports even if the test has a docstring.
7492
7493- Issue #3001: Add a C implementation of recursive locks which is used by
7494 default when instantiating a `threading.RLock` object. This makes recursive
7495 locks as fast as regular non-recursive locks (previously, they were slower by
7496 10x to 15x).
7497
7498- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
7499 those started through `threading.Thread` (for example, using
7500 `_thread.start_new_thread()`).
7501
7502- Issue #7187: Importlib would not silence the IOError raised when trying to
7503 write new bytecode when it was made read-only.
7504
7505- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
7506 which are part of a reference cycle.
7507
7508- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
7509 objects on 64-bit systems. Patch by Michael Broghton.
7510
7511- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
7512 modification is done through it. This fixes inconsistencies and test failures
7513 on systems with slightly bogus mtime behaviour.
7514
7515- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
7516 from stdin so that existing input does not confuse it and lead to incorrect
7517 entry or an IOError. It also properly flushes it afterwards to avoid the
7518 terminal echoing the input afterwards on OSes such as Solaris.
7519
7520- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
7521 they accept an int or long as the second argument. Also fix buggy handling of
7522 large arguments (those with coefficient longer than the current precision) in
7523 shift and rotate.
7524
7525- Issue #4750: Store the basename of the original filename in the gzip FNAME
7526 header as required by RFC 1952.
7527
7528- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
7529 Distutils.
7530
7531- Issue #7218: Fix test_site for win32, the directory comparison was done with
7532 an uppercase.
7533
7534- Issue #7205: Fix a possible deadlock when using a BZ2File object from
7535 several threads at once.
7536
7537- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
7538
7539- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
7540 larger than emax.
7541
7542- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
7543 platforms, and assorted locale fixes by Derk Drukker.
7544
7545- Issue #5833: Fix extra space character in readline completion with the GNU
7546 readline library version 6.0.
7547
7548- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
7549
7550- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
7551 anachronisms in the code which were a relic of 1.5.2 compatibility.
7552
7553- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
7554 to look for it is the Content-Type header.
7555
7556- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
7557 builtin tokenizer.
7558
7559- Issue #7048: Force Decimal.logb to round its result when that result is too
7560 large to fit in the current precision.
7561
7562- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
7563 other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
7564
7565- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
7566 always result in NULL.
7567
7568- Issue #5042: Structure sub-subclass does now initialize correctly with base
7569 class positional arguments.
7570
7571- Issue #6882: Import uuid creates zombies processes.
7572
7573- Issue #6635: Fix profiler printing usage message.
7574
7575- Issue #6856: Add a filter keyword argument to TarFile.add().
7576
7577- Issue #6888: pdb's alias command was broken when no arguments were given.
7578
7579- Issue #6857: Default format() alignment should be '>' for Decimal instances.
7580
7581- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
7582 NaN or raising InvalidContext. Also, fix infinite recursion in
7583 long(Decimal('nan')).
7584
7585- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
7586 type specifier.
7587
7588- Issue #6239: ctypes.c_char_p return value must return bytes.
7589
7590- Issue #6838: Use a list to accumulate the value instead of repeatedly
7591 concatenating strings in http.client's HTTPResponse._read_chunked providing a
7592 significant speed increase when downloading large files servend with a
7593 Transfer-Encoding of 'chunked'.
7594
7595- Trying to import a submodule from a module that is not a package, ImportError
7596 should be raised, not AttributeError.
7597
7598- When the globals past to importlib.__import__() has __package__ set to None,
7599 fall back to computing what __package__ should be instead of giving up.
7600
7601- Raise a TypeError when the name of a module to be imported for
7602 importlib.__import__ is not a string (was raising an AttributeError before).
7603
7604- Allow the fromlist passed into importlib.__import__ to be any iterable.
7605
7606- Have importlib raise ImportError if None is found in sys.modules.
7607
7608- Issue #6054: Do not normalize stored pathnames in tarfile.
7609
7610- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
7611 payloads are now ordered by integer value rather than lexicographically.
7612
7613- Issue #1356969: Add missing info methods in tix.HList.
7614
7615- Issue #1522587: New constants and methods for the tix.Grid widget.
7616
7617- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
7618
7619- Issue #1119673: Do not override tkinter.Text methods when creating a
7620 ScrolledText.
7621
7622- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
7623
7624- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
7625 and yview* methods.
7626
7627- Issue #6629: Fix a data corruption issue in the new I/O library, which could
7628 occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
7629 "wb+" mode) after having buffered a certain amount of data for reading. This
7630 bug was not present in the pure Python implementation.
7631
7632- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
7633 POP3.apop.
7634
7635- Issue #2715: Remove remnants of Carbon.File from binhex module.
7636
7637- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
7638 digits in input, as recommended by the standard. Previously it was restricted
7639 to accepting [0-9].
7640
7641- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
7642 DO/DONT correctly.
7643
7644- Issue #1424152: Fix for http.client, urllib.request to support SSL while
7645 working through proxy. Original patch by Christopher Li, changes made by
7646 Senthil Kumaran.
7647
7648- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
7649 loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
7650 PyPycLoader inherit from this class and provide implementations in relation to
7651 other methods required by the ABCs.
7652
7653- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
7654 the documentation said it did even though the code in PyLoader relied on the
7655 abstract method required by ResourceLoader.
7656
7657- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
7658 to handle a comparison without loss of precision. Also add correct handling
7659 of infinities and nans for comparisons with float.
7660
7661- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
7662
7663- Issue #6358: The exit status of a command started with os.popen() was reported
7664 differently than it did with python 2.x.
7665
7666- Issue #6323: The pdb debugger did not exit when running a script with a syntax
7667 error.
7668
7669- Issue #3392: The subprocess communicate() method no longer fails in select()
7670 when file descriptors are large; communicate() now uses poll() when possible.
7671
7672- Issue #6369: Fix an RLE decompression bug in the binhex module.
7673
7674- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
7675
7676- The deprecated function string.maketrans has been removed.
7677
7678- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
7679 sys.path.
7680
7681- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
7682
7683- The os.get_exec_path() function to return the list of directories that will be
7684 searched for an executable when launching a subprocess was added.
7685
7686- Issue #7481: When a threading.Thread failed to start it would leave the
7687 instance stuck in initial state and present in threading.enumerate().
7688
7689- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
7690 and os.read system calls where appropriate.
7691
7692- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
7693
7694- Issue #6247: The argparse module has been added to the standard library.
7695
7696- Issue #8235: _socket: Add the constant ``SO_SETFIB``. SO_SETFIB is a socket
7697 option available on FreeBSD 7.1 and newer.
7698
7699- Issue #9315: Fix for the trace module to record correct class name
7700 for tracing methods.
7701
7702Extension Modules
7703-----------------
7704
7705- Issue #9959: Tweak formula used for computing math.log of an integer,
7706 making it marginally more accurate for exact powers of 2.
7707
7708- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
7709
7710- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
7711 compared to other unix systems. In particular, os.getgroups() does not reflect
Martin Pantere26da7c2016-06-02 10:07:09 +00007712 any changes made using os.setgroups() but basically always returns the same
Georg Brandl86dc7322012-10-01 18:58:45 +02007713 information as the id command. os.getgroups() can now return more than 16
7714 groups on MacOSX.
7715
7716- Issue #6095: Make directory argument to os.listdir optional.
7717
7718- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
7719 struct.pack('>?')): if conversion to bool raised an exception then that
7720 exception wasn't properly propagated on machines where char is unsigned.
7721
7722- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
7723 they contain instances of old-style classes.
7724
7725- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
7726 existing isinf and isnan functions.
7727
7728- Issue #1578269: Implement os.symlink for Windows 6.0+. Patch by Jason
7729 R. Coombs.
7730
Martin Pantere26da7c2016-06-02 10:07:09 +00007731- In struct.pack, correctly propagate exceptions from computing the truth of an
Georg Brandl86dc7322012-10-01 18:58:45 +02007732 object in the '?' format.
7733
7734- Issue #9000: datetime.timezone objects now have eval-friendly repr.
7735
7736- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
7737 special methods.
7738
7739- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
7740 Prior to this change, timezone adjustment in utctimetuple() could produce
7741 tm_year value of 0 or 10,000. Now an OverflowError is raised in these edge
7742 cases.
7743
7744- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
7745 directive. When the ``%z`` directive is present in the format string, an
7746 aware ``datetime`` object is returned with ``tzinfo`` bound to a
7747 ``datetime.timezone`` instance constructed from the parsed offset. If both
7748 ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
7749 name, but ``%Z`` data without ``%z`` is discarded.
7750
7751- Issue #5094: The ``datetime`` module now has a simple concrete class
7752 implementing ``datetime.tzinfo`` interface. Instances of the new class,
7753 ``datetime.timezone``, return fixed name and UTC offset from their
7754 ``tzname(dt)`` and ``utcoffset(dt)`` methods. The ``dst(dt)`` method always
7755 returns ``None``. A class attribute, ``utc`` contains an instance
7756 representing the UTC timezone. Original patch by Rafe Kaplan.
7757
7758- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
7759 includes documentation for the struct.Struct class.
7760
7761- Issue #3129: Trailing digits in struct format string are no longer ignored.
7762 For example, "1" or "ilib123" are now invalid formats and cause
7763 ``struct.error`` to be raised. Patch by Caleb Deveraux.
7764
7765- Issue #7384: If the system readline library is linked against ncurses, the
7766 curses module must be linked against ncurses as well. Otherwise it is not safe
7767 to load both the readline and curses modules in an application.
7768
7769- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
7770 requiring a re-try in order to get the complete result.
7771
7772- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
7773 with an improved 'binary-split' algorithm that uses fewer multiplications and
7774 allows many of the multiplications to be performed using plain C integer
7775 arithmetic instead of PyLong arithmetic. Also uses a lookup table for small
7776 arguments.
7777
7778- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
7779 overflow checks in the audioop module.
7780
7781- Issue #8644: The accuracy of td.total_seconds() has been improved (by
7782 calculating with integer arithmetic instead of float arithmetic internally):
7783 the result is now always correctly rounded, and is equivalent to ``td /
7784 timedelta(seconds=1)``.
7785
7786- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
7787 timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
7788 timedelta) are all supported.
7789
7790- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
7791
7792- Issue #8300: When passing a non-integer argument to struct.pack with any
7793 integer format code, struct.pack first attempts to convert the non-integer
7794 using its __index__ method. If that method is non-existent or raises
7795 TypeError it goes on to try the __int__ method, as described below.
7796
7797- Issue #8142: Update libffi to the 3.0.9 release.
7798
7799- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
7800
7801- Issue #6544: Fix a reference leak in the kqueue implementation's error
7802 handling.
7803
7804- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
7805 msvcr100.dll is not a platform assembly anymore.
7806
7807- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
7808
7809- Issue #7078: Set struct.__doc__ from _struct.__doc__.
7810
7811- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
7812
7813- Issue #6877: It is now possible to link the readline extension to the libedit
7814 readline emulation on OSX 10.5 or later.
7815
7816- Issue #6848: Fix curses module build failure on OS X 10.6.
7817
7818- Fix a segfault that could be triggered by expat with specially formed input.
7819
7820- Issue #6561: '\d' in a regex now matches only characters with Unicode category
7821 'Nd' (Number, Decimal Digit). Previously it also matched characters with
7822 category 'No'.
7823
7824- Issue #4509: Array objects are no longer modified after an operation failing
7825 due to the resize restriction in-place when the object has exported buffers.
7826
7827- Issue #2389: Array objects are now pickled in a portable manner.
7828
7829- Expat: Fix DoS via XML document with malformed UTF-8 sequences
7830 (CVE_2009_3560).
7831
7832- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
7833 could raise an incorrect RuntimeError about not holding the import lock. The
7834 import lock is now reinitialized after fork.
7835
7836- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
7837 parameter on some platforms such as OS X.
7838
7839- Build the ossaudio extension on GNU/kFreeBSD.
7840
7841- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
7842 the return value of QueryReflectionKey.
7843
7844- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
7845
7846Build
7847-----
7848
7849- Use OpenSSL 1.0.0a on Windows.
7850
7851- Issue #9280: Make sharedinstall depend on sharedmods.
7852
7853- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
7854 override the configure and makefile defaults, without deleting options the
7855 user didn't intend to override. Developers should no longer need to specify
7856 OPT or EXTRA_CFLAGS, although those variables are still present for
7857 backward-compatibility.
7858
7859- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
7860
7861- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
7862 multiprocessing only.
7863
7864- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
7865 (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
7866 result of the issue #1628484 fix, combined with autoconf's strange choice of
7867 default CFLAGS produced by AC_PROG_CC for gcc.)
7868
7869- Issue #3646: It is now easily possible to install a Python framework into your
7870 home directory on MacOSX, see Mac/README for more information.
7871
7872- Issue #3928: os.mknod() now available in Solaris, also.
7873
7874- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
7875 give false warnings.
7876
7877- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
7878 anymore. It also forwards the LDFLAGS settings to the linker when building a
7879 shared library.
7880
7881- Issue #6716: Quote -x arguments of compileall in MSI installer. Exclude 2to3
7882 tests from compileall.
7883
7884- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
7885
7886- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
7887 memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
7888 instead. Also disable caching of powers of 5.
7889
7890- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
7891
7892- Issue #6943: Use pkg-config to find the libffi headers when the
7893 --with-system-ffi flag is used.
7894
7895- Issue #7609: Add a --with-system-expat option that causes the system's expat
7896 library to be used for the pyexpat module instead of the one included with
7897 Python.
7898
7899- Issue #7589: Only build the nis module when the correct header files are
7900 found.
7901
7902- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
7903
7904- Issue #5792: Extend the short float repr support to x86 systems using
7905 icc or suncc.
7906
7907- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
7908 correctly under gcc on x86-64. This fixes a reported problem with the
7909 --with-tsc build on x86-64.
7910
7911- Issue #6802: Fix build issues on MacOSX 10.6.
7912
7913- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
7914
7915- Issue #4601: 'make install' did not set the appropriate permissions on
7916 directories.
7917
7918- Issue #5390: Add uninstall icon independent of whether file extensions are
7919 installed.
7920
7921- Issue #7541: When using ``python-config`` with a framework install the
7922 compiler might use the wrong library.
7923
7924- python-config now supports multiple options on the same command line.
7925
7926- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
7927
7928- Issue #8510: Update to autoconf2.65.
7929
7930Documentation
7931-------------
7932
7933- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
7934 to Doc/license.rst.
7935
7936- Issue #9524: Document that two CTRL* signals are meant for use only
7937 with os.kill.
7938
7939- Issue #9255: Document that the 'test' package is meant for internal Python use
7940 only.
7941
7942- A small WSGI server was added as Tools/scripts/serve.py, and is used to
7943 implement a local documentation server via 'make serve' in the doc directory.
7944
7945- Updating `Using Python` documentation to include description of CPython's -J
7946 and -X options.
7947
7948- Document that importing a module that has None in sys.modules triggers an
7949 ImportError.
7950
7951- Issue #6556: Fixed the Distutils configuration files location explanation for
7952 Windows.
7953
7954- Update python manual page (options -B, -O0, -s, environment variables
7955 PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
7956
7957- Issue #8909: Added the size of the bitmap used in the installer created by
7958 distutils' bdist_wininst. Patch by Anatoly Techtonik.
7959
7960Tests
7961-----
7962
7963- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
7964 import lock was disabled.
7965
7966- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
7967
7968- Issue #7449: Skip test_socketserver if threading support is disabled.
7969
7970- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
7971 by a decompressor object without errors (it returns incomplete uncompressed
7972 data).
7973
7974- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
7975 UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
7976
7977- Issue #8576: Remove use of find_unused_port() in test_smtplib and
7978 test_multiprocessing. Patch by Paul Moore.
7979
7980- Issue #7449: Fix many tests to support Python compiled without thread
7981 support. Patches written by Jerry Seutter.
7982
7983- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
7984 SSL shutdowns.
7985
7986- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
7987 by Dave Malcolm.
7988
7989- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
7990 thread was previously started, most likely due to a platform bug.
7991
7992- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
7993
7994- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
7995
7996- Issue #8263: Now regrtest.py will report a failure if it receives a
7997 KeyboardInterrupt (SIGINT).
7998
7999- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
8000 Unicode normalization cases.
8001
8002- Issue #7783: test.support.open_urlresource invalidates the outdated files from
8003 the local cache.
8004
8005- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
8006 effectively raised.
8007
8008- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
8009 TestCase for some tests: test_genericpath.CommonTest.
8010
8011- Print platform information when running the whole test suite, or using the
8012 --verbose flag.
8013
8014- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
8015 filesystem encoding.
8016
8017- Issue #6292: for the moment at least, the test suite runs cleanly if python is
8018 run with the -OO flag. Tests requiring docstrings are skipped.
8019
8020- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
8021 also used by regrtest to run all the tests in a temporary directory. The
8022 original CWD is saved in `support.SAVEDCWD`. Thanks to Florent Xicluna who
8023 helped with the patch.
8024
8025- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
8026 (only seen so far on platforms where the curses module wasn't built), due to
8027 an uncleared exception.
8028
8029- Issue #7728: test_timeout was changed to use support.bind_port instead of a
8030 hard coded port.
8031
8032- Issue #7376: Instead of running a self-test (which was failing) when called
8033 with no arguments, doctest.py now gives a usage message.
8034
8035- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
8036
8037- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
8038 instead of a hardcoded port number in test_rapid_restart.
8039
8040- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
8041 in the Lib/test directory, which might be read-only for the user running the
8042 tests.
8043
8044- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
8045 of an option with no handler.
8046
8047- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
8048 fails. Can be combined with -j.
8049
8050- Issue #6551: test_zipimport could import and then destroy some modules of the
8051 encodings package, which would make other tests fail further down the road
8052 because the internally cached encoders and decoders would point to empty
8053 global variables.
8054
8055- Issue #7295: Do not use a hardcoded file name in test_tarfile.
8056
8057- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
8058 primitives such as Lock, RLock, Condition, Event and Semaphore.
8059
8060- Issue #7248 (part 2): Use a unique temporary directory for importlib source
8061 tests instead of tempfile.tempdir. This prevents the tests from sharing state
8062 between concurrent executions on the same system.
8063
8064- Issue #7248: In importlib.test.source.util a try/finally block did not make
8065 sure that some referenced objects actually were created in the block before
8066 calling methods on the object.
8067
8068- Issue #7222: Make thread "reaping" more reliable so that reference
8069 leak-chasing test runs give sensible results. The previous method of reaping
8070 threads could return successfully while some Thread objects were still
8071 referenced. This also introduces a new private function:
8072 ``_thread._count()``.
8073
8074- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
8075 runs the risk of causing the worker thread to fail.
8076
8077- Issue #7055: test___all__ now greedily detects all modules which have an
8078 __all__ attribute, rather than using a hardcoded and incomplete list.
8079
8080- Issue #7058: Added save/restore for things like sys.argv and cwd to
8081 runtest_inner in regrtest, with warnings if the called test modifies them, and
8082 a new section in the summary report at the end.
8083
8084- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
8085
8086- Fixed tests in importlib.test.source.test_abc_loader that were masking the
8087 proper exceptions that should be raised for missing or improper code object
8088 bytecode.
8089
8090- Removed importlib's custom test discovery code and switched to
8091 unittest.TestLoader.discover().
8092
8093Tools/Demos
8094-----------
8095
8096- Issue #5464, #8974: Implement plural forms in msgfmt.py.
8097
8098- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
8099 added to the `Tools/` directory. They were previously living in the sandbox.
8100
8101
8102What's New in Python 3.1?
8103=========================
8104
8105*Release date: 27-June-2009*
8106
8107Core and Builtins
8108-----------------
8109
8110- Issue #6334: Fix bug in range length calculation for ranges with
8111 large arguments.
8112
8113- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
8114 because it wasn't recognized as a sequence).
8115
8116Library
8117-------
8118
8119- Issue #6126: Fixed pdb command-line usage.
8120
8121- Issue #6314: logging: performs extra checks on the "level" argument.
8122
8123- Issue #6274: Fixed possible file descriptors leak in subprocess.py
8124
8125- Accessing io.StringIO.buffer now raises an AttributeError instead of
8126 io.UnsupportedOperation.
8127
8128- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
8129 (On Unix)
8130
8131- Issue #1202: zipfile module would cause a struct.error when attempting to
8132 store files with a CRC32 > 2**31-1.
8133
8134Extension Modules
8135-----------------
8136
8137- Issue #5590: Remove unused global variable in pyexpat extension.
8138
8139
8140What's New in Python 3.1 Release Candidate 2?
8141=============================================
8142
8143*Release date: 13-June-2009*
8144
8145Core and Builtins
8146-----------------
8147
8148- Fixed SystemError triggered by "range([], 1, -1)".
8149
8150- Issue #5924: On Windows, a large PYTHONPATH environment variable
8151 (more than 255 characters) would be completely ignored.
8152
8153- Issue #4547: When debugging a very large function, it was not always
8154 possible to update the lineno attribute of the current frame.
8155
8156- Issue #5330: C functions called with keyword arguments were not reported by
8157 the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
8158
8159Library
8160-------
8161
8162- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
8163 expression string pattern was trying to match against a bytes returned by
8164 Popen. Tested under win32 to build the py-postgresql project.
8165
8166- Issue #6258: Support AMD64 in bdist_msi.
8167
8168- Issue #6195: fixed doctest to no longer try to read 'source' data from
8169 binary files.
8170
8171- Issue #5262: Fixed bug in next rollover time computation in
8172 TimedRotatingFileHandler.
8173
8174- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
8175 errors property. Additionally, the errors and encoding properties of StringIO
8176 are always None now.
8177
8178- Issue #6137: The pickle module now translates module names when loading
8179 or dumping pickles with a 2.x-compatible protocol, in order to make data
8180 sharing and migration easier. This behaviour can be disabled using the
8181 new `fix_imports` optional argument.
8182
8183- Removed the ipaddr module.
8184
8185- Issue #3613: base64.{encode,decode}string are now called
8186 base64.{encode,decode}bytes which reflects what type they accept and return.
8187 The old names are still there as deprecated aliases.
8188
8189- Issue #5767: Remove sgmlop support from xmlrpc.client.
8190
8191- Issue #6150: Fix test_unicode on wide-unicode builds.
8192
8193- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
8194 parameters.
8195
8196Windows
8197-------
8198
8199- Issue #6221: Delete test registry key before running the test.
8200
8201- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
8202
8203C-API
8204-----
8205
8206- Issue #5735: Python compiled with --with-pydebug should throw an
8207 ImportError when trying to import modules compiled without
8208 --with-pydebug, and vice-versa.
8209
8210
8211Build
8212-----
8213
8214- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
8215 added LIBS to OS X framework builds.
8216
8217- Issue #5809: Specifying both --enable-framework and --enable-shared is
Martin Pantere26da7c2016-06-02 10:07:09 +00008218 an error. Configure now explicitly tells you about this.
Georg Brandl86dc7322012-10-01 18:58:45 +02008219
8220
8221
8222What's New in Python 3.1 release candidate 1?
8223=============================================
8224
8225*Release date: 2009-05-30*
8226
8227Core and Builtins
8228-----------------
8229
8230- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
8231 of the command line.
8232
8233- Issue #6012: Add cleanup support to O& argument parsing.
8234
8235- Issue #6089: Fixed str.format with certain invalid field specifiers
8236 that would raise SystemError.
8237
8238- Issue #5982: staticmethod and classmethod now expose the wrapped
8239 function with __func__.
8240
8241- Added support for multiple context managers in the same with-statement.
8242 Deprecated contextlib.nested() which is no longer needed.
8243
8244- Issue #5829: complex("1e500") no longer raises OverflowError. This
8245 makes it consistent with float("1e500") and interpretation of real
8246 and imaginary literals.
8247
8248- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
8249
8250- Issue #5994: the marshal module now has docstrings.
8251
8252- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
8253 (1) inf and nan strings with trailing whitespace were incorrectly
8254 rejected; (2) parsing of strings representing infinities and nans
8255 was locale aware; and (3) the interpretation of fromhex('-nan')
8256 didn't match that of float('-nan').
8257
8258Library
8259-------
8260
8261- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
8262
8263- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
8264
8265- Issue #6121: pydoc now ignores leading and trailing spaces in the
8266 argument to the 'help' function.
8267
8268- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
8269 arguments for strings with a space in them.
8270
8271- collections.namedtuple() was not working with the following field
8272 names: cls, self, tuple, itemgetter, and property.
8273
8274- In unittest, using a skipping decorator on a class is now equivalent to
8275 skipping every test on the class. The ClassTestSuite class has been removed.
8276
8277- Issue #6050: Don't fail extracting a directory from a zipfile if
8278 the directory already exists.
8279
8280- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
8281 than an int, which makes some operations possible under 64-bit Linux (e.g.
8282 DN_MULTISHOT with F_NOTIFY).
8283
8284- Issue #5761: Add the name of the underlying file to the repr() of various
8285 IO objects.
8286
8287- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix
8288 by Musashi Tamura, tests by Marcin Bachry.
8289
8290- Issue #1983: Fix functions taking or returning a process identifier to use
8291 the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
8292 a process identifier type wider than the standard C integer type.
8293
8294- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
8295 Patch by Farhan Ahmad, test by Marcin Bachry.
8296
8297- Issue #2116: Weak references and weak dictionaries now support copy()ing and
8298 deepcopy()ing.
8299
8300- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
8301
8302- Issue #5918: Fix a crash in the parser module.
8303
8304- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
8305
8306- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
Martin Panter6245cb32016-04-15 02:14:19 +00008307 library. This means, for example, that opening a UTF-16 text file in
Georg Brandl86dc7322012-10-01 18:58:45 +02008308 append mode doesn't add a BOM at the end of the file if the file isn't
8309 empty.
8310
8311- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
8312 file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix
8313 corrects a pydoc regression.
8314
8315- Issue #5955: aifc's close method did not close the file it wrapped,
8316 now it does. This also means getfp method now returns the real fp.
8317
8318Installation
8319------------
8320
8321- Issue #6047: fullinstall has been removed because Python 3's executable will
8322 now be known as python3.
8323
8324- Lib/smtpd.py is no longer installed as a script.
8325
8326Extension Modules
8327-----------------
8328
8329- Issue #3061: Use wcsftime for time.strftime where available.
8330
8331- Issue #4873: Fix resource leaks in error cases of pwd and grp.
8332
8333- Issue #6093: Fix off-by-one error in locale.strxfrm.
8334
8335- The _functools and _locale modules are now built into the libpython shared
8336 library instead of as extension modules.
8337
8338Build
8339-----
8340
8341- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
8342 and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
8343 Clinton Roy.
8344
8345Tests
8346-----
8347
8348- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
8349 tests on darwin even when the OS was installed on a case-sensitive
8350 filesystem. Also fixed tests that should not be run when
8351 sys.dont_write_bytecode is true.
8352
8353
8354What's New in Python 3.1 beta 1?
8355================================
8356
8357*Release date: 2009-05-06*
8358
8359Core and Builtins
8360-----------------
8361
8362- Issue #5914: Add new C API function PyOS_string_to_double, and
8363 deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
8364
8365- Issue #3382: float.__format__, complex.__format__, and %-formatting
8366 no longer map 'F' to 'f'. Because of issue #5859 (below), this only
8367 affects nan -> NAN and inf -> INF.
8368
8369- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
8370 in all operations, including splitdrive, split, etc. splitunc() now issues
8371 a PendingDeprecation warning.
8372
8373- Issue #5920: For float.__format__, change the behavior with the
8374 empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
8375 to be like 'g' but with at least one decimal point and with a
8376 default precision of 12. Previously, the behavior the same but with
8377 a default precision of 6. This more closely matches str(), and
8378 reduces surprises when adding alignment flags to the empty
8379 presentation type. This also affects the new complex.__format__ in
8380 the same way.
8381
8382- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
8383
8384- Issue #5890: in subclasses of 'property' the __doc__ attribute was
8385 shadowed by classtype's, even if it was None. property now
8386 inserts the __doc__ into the subclass instance __dict__.
8387
8388- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
8389 sequences. Patch by Nick Barnes and Victor Stinner.
8390
8391- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
8392
8393- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
8394 received a new method, detach(). detach() disconnects the underlying stream
8395 from the buffer or text IO and returns it.
8396
8397- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
8398 floats with absolute value over 1e50. Also remove length
8399 restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
8400 12.34 no longer raise an exception.
8401
8402- Issue #1588: Add complex.__format__. For example,
8403 format(complex(1, 2./3), '.5') now produces a sensible result.
8404
8405- Issue #5864: Fix empty format code formatting for floats so that it
8406 never gives more than the requested number of significant digits.
8407
8408- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
8409 new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
8410
8411- Issue #5835: Deprecate PyOS_ascii_formatd.
8412
8413- Issue #4971: Fix titlecase for characters that are their own
8414 titlecase, but not their own uppercase.
8415
8416- Issue #5283: Setting __class__ in __del__ caused a segfault.
8417
8418- Issue #5816: complex(repr(z)) now recovers z exactly, even when
8419 z involves nans, infs or negative zeros.
8420
8421- Issue #3166: Make int -> float conversions correctly rounded.
8422
8423- Issue #1869 (and many duplicates): make round(x, n) correctly
8424 rounded for a float x, by using the decimal <-> binary conversions
8425 from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
8426 consistently agrees with format(x, '.2f').
8427
8428- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
8429 some builtin types.
8430
8431- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
8432
8433- Issue #5515: str.format() type 'n' combined with commas and leading
8434 zeros no longer gives odd results with ints and floats.
8435
8436- Implement PEP 378, Format Specifier for Thousands Separator, for
8437 floats.
8438
8439- The str function switches to exponential notation at
8440 1e11, not 1e12. This avoids printing 13 significant digits in
8441 situations where only 12 of them are correct. Example problem
8442 value: str(1e11 + 0.5). (This minor issue has existed in 2.x for a
8443 long time.)
8444
8445- Issue #1580: On most platforms, use a 'short' float repr: for a
8446 finite float x, repr(x) now outputs a string based on the shortest
8447 sequence of decimal digits that rounds to x. Previous behaviour was
8448 to output 17 significant digits and then strip trailing zeros.
8449 Another minor difference is that the new repr switches to
8450 exponential notation at 1e16 instead of the previous 1e17; this
8451 avoids misleading output in some cases.
8452
8453 There's a new sys attribute sys.float_repr_style, which takes
8454 the value 'short' to indicate that we're using short float repr,
8455 and 'legacy' if the short float repr isn't available for one
8456 reason or another.
8457
8458 The float repr change involves incorporating David Gay's 'perfect
8459 rounding' code into the Python core (it's in Python/dtoa.c). As a
8460 secondary consequence, all string-to-float and float-to-string
8461 conversions (including all float formatting operations) will be
8462 correctly rounded on these platforms.
8463
8464 See issue #1580 discussions for details of platforms for which
8465 this change does not apply.
8466
8467- Issue #5759: float() didn't call __float__ on str subclasses.
8468
8469- The string.maketrans() function is deprecated; there is a new static method
8470 maketrans() on the bytes and bytearray classes. This removes confusion about
8471 the types string.maketrans() is supposed to work with, and mirrors the
8472 methods available on the str class.
8473
8474- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
8475 its clarity and its speed.
8476
8477- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
8478 to avoid compiler warnings.
8479
8480- Issue #3739: The unicode-internal encoder now reports the number of characters
8481 consumed like any other encoder (instead of the number of bytes).
8482
8483Installation
8484------------
8485
8486- Issue #5756: Install idle and pydoc with a 3 suffix.
8487
8488Library
8489-------
8490
8491- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
8492
8493- Issue #5311: bdist_msi can now build packages that do not depend on a
8494 specific Python version.
8495
8496- Issue #5150: IDLE's format menu now has an option to strip trailing
8497 whitespace.
8498
8499- Issue #5940: distutils.command.build_clib.check_library_list was not doing
8500 the right type checkings anymore.
8501
8502- Issue #4875: On win32, ctypes.util.find_library does no longer
8503 return directories.
8504
8505- Issue #5142: Add the ability to skip modules while stepping to pdb.
8506
8507- Issue #1309567: Fix linecache behavior of stripping subdirectories when
8508 looking for files given by a relative filename.
8509
8510- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
8511 turtle demos in Demo/turtle.
8512
8513- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
8514 extracting a file to the root directory.
8515
8516- Issue #5913: os.listdir() should fail for empty path on windows.
8517
8518- Issue #5084: unpickling now interns the attribute names of pickled objects,
8519 saving memory and avoiding growth in size of subsequent pickles. Proposal
8520 and original patch by Jake McGuire.
8521
8522- The json module now works exclusively with str and not bytes.
8523
8524- Issue #3959: The ipaddr module has been added to the standard library.
8525 Contributed by Google.
8526
8527- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
8528 error when a named pipe is encountered, rather than blocking infinitely.
8529
8530- Issue #5857: tokenize.tokenize() now returns named tuples.
8531
8532- Issue #4305: ctypes should now build again on mipsel-linux-gnu
8533
8534- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
8535 string is already in normalized form, by performing a quick check beforehand.
8536 Original patch by Rauli Ruohonen.
8537
8538- Issue #5853: calling a function of the mimetypes module from several threads
8539 at once could hit the recursion limit if the mimetypes database hadn't been
8540 initialized before.
8541
8542- Issue #5854: Updated __all__ to include some missing names and remove some
8543 names which should not be exported.
8544
8545- Issue #3102: All global symbols that the _ctypes extension defines
8546 are now prefixed with 'Py' or '_ctypes'.
8547
8548- Issue #5041: ctypes does now allow pickling wide character.
8549
8550- Issue #5812: For the two-argument form of the Fraction constructor,
8551 Fraction(m, n), m and n are permitted to be arbitrary Rational
8552 instances.
8553
8554- Issue #5812: Fraction('1e6') is valid: more generally, any string
8555 that's valid for float() is now valid for Fraction(), with the
8556 exception of strings representing NaNs and infinities.
8557
8558- Issue #5734: BufferedRWPair was poorly tested and had several glaring
8559 bugs. Patch by Brian Quinlan.
8560
8561- Issue #1161031: fix readwrite select flag handling: POLLPRI now
8562 results in a handle_expt_event call, not handle_read_event, and POLLERR
8563 and POLLNVAL now call handle_close, not handle_expt_event. Also,
8564 dispatcher now has an 'ignore_log_types' attribute for suppressing
8565 log messages, which is set to 'warning' by default.
8566
8567- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
8568 new arguments introduced in 2.5.
8569
8570- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
8571 makeunicodedata.py and regenerated the Unicode database (This fixes
8572 u'\u1d79'.lower() == '\x00').
8573
8574Extension Modules
8575-----------------
8576
8577- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
8578 pwd.
8579
8580- Issue #5463: In struct module, remove deprecated float coercion
8581 for integer type codes: struct.pack('L', 0.3) should now raise
8582 an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed.
8583 The version number has been bumped to 0.3.
8584
8585- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
8586 using Berkeley DB.
8587
8588Tests
8589-----
8590
8591- Issue #5354: New test support function import_fresh_module() makes
8592 it easy to import both normal and optimised versions of modules.
8593 test_heapq and test_warnings have been adjusted to use it, tests for
8594 other modules with both C and Python implementations in the stdlib
8595 can be adjusted to use it over time.
8596
8597- Issue #5837: Certain sequences of calls to set() and unset() for
8598 support.EnvironmentVarGuard objects restored the environment variables
8599 incorrectly on __exit__.
8600
8601C-API
8602-----
8603
8604- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
8605
8606
8607What's New in Python 3.1 alpha 2?
8608=================================
8609
8610*Release date: 2009-4-4*
8611
8612Core and Builtins
8613-----------------
8614
8615- Implement PEP 378, Format Specifier for Thousands Separator, for
8616 integers.
8617
8618- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
8619
8620- Issue #5499: The 'c' code for argument parsing functions now only accepts a
8621 byte, and the 'C' code only accepts a unicode character.
8622
8623- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
8624 when hitting the recursion limit under certain circumstances.
8625
8626- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
8627
8628- Fix a segfault when running test_exceptions with coverage, caused by
8629 insufficient checks in accessors of Exception.__context__.
8630
8631- Issue #5604: non-ASCII characters in module name passed to
8632 imp.find_module() were converted to UTF-8 while the path is
8633 converted to the default filesystem encoding, causing nonsense.
8634
8635- Issue #5126: str.isprintable() returned False for space characters.
8636
8637- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
8638 the end sys.path, for compatibility with the system install of Python.
8639
8640- Issue #4688: Add a heuristic so that tuples and dicts containing only
8641 untrackable objects are not tracked by the garbage collector. This can
8642 reduce the size of collections and therefore the garbage collection overhead
8643 on long-running programs, depending on their particular use of datatypes.
8644
8645- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
8646 improve its performance. Long divisions and remainder operations
8647 are now between 50% and 150% faster.
8648
8649- Issue #4258: Make it possible to use base 2**30 instead of base
8650 2**15 for the internal representation of integers, for performance
8651 reasons. Base 2**30 is enabled by default on 64-bit machines. Add
8652 --enable-big-digits option to configure, which overrides the
8653 default. Add sys.int_info structseq to provide information about
8654 the internal format.
8655
8656- Issue #4474: PyUnicode_FromWideChar now converts characters outside
8657 the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
8658 and sizeof(Py_UNICODE) == 2.
8659
8660- Issue #5237: Allow auto-numbered fields in str.format(). For
8661 example: '{} {}'.format(1, 2) == '1 2'.
8662
8663- Issue #5392: when a very low recursion limit was set, the interpreter would
8664 abort with a fatal error after the recursion limit was hit twice.
8665
8666- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
8667 short file names.
8668
8669Library
8670-------
8671
8672- Issue #2625: added missing items() call to the for loop in
8673 mailbox.MH.get_message().
8674
8675- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
8676 error substitutions from non-strict codec error callbacks in
8677 incrementalencoder and StreamWriter.
8678
8679- Issue #5656: Fix the coverage reporting when running the test suite with
8680 the -T argument.
8681
8682- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
8683
8684- Issue #5624: Fix the _winreg module name still used in several modules.
8685
Martin Panter7462b6492015-11-02 03:37:02 +00008686- Issue #5628: Fix io.TextIOWrapper.read() with an unreadable buffer.
Georg Brandl86dc7322012-10-01 18:58:45 +02008687
8688- Issue #5619: Multiprocessing children disobey the debug flag and causes
8689 popups on windows buildbots. Patch applied to work around this issue.
8690
8691- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
8692
8693- Issue #5387: Fixed mmap.move crash by integer overflow.
8694
8695- Issue #5261: Patch multiprocessing's semaphore.c to support context
8696 manager use: "with multiprocessing.Lock()" works now.
8697
8698- Issue #5236: Change time.strptime() to only take strings. Didn't work with
8699 bytes already but the failure was non-obvious.
8700
8701- Issue #5177: Multiprocessing's SocketListener class now uses
8702 socket.SO_REUSEADDR on all connections so that the user no longer needs
8703 to wait 120 seconds for the socket to expire.
8704
8705- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
8706
8707- Issue #1174606: Calling read() without arguments of an unbounded file
8708 (typically /dev/zero under Unix) could crash the interpreter.
8709
8710- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
8711 io.BufferedRandom have been deprecated for removal in Python 3.2.
8712
8713- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
8714 forever on incomplete input. That caused tarfile.open() to hang when used
8715 with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
8716 partial bzip2 compressed data.
8717
8718- Issue #2110: Add support for thousands separator and 'n' type
8719 specifier to Decimal.__format__
8720
8721- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
8722 '>' alignment characters.
8723
8724- The error detection code in FileIO.close() could fail to reflect the `errno`
8725 value, and report it as -1 instead.
8726
8727- Issue #5016: FileIO.seekable() could return False if the file position
8728 was negative when truncated to a C int. Patch by Victor Stinner.
8729
8730Extension Modules
8731-----------------
8732
8733- Issue #5391: mmap now deals exclusively with bytes.
8734
8735- Issue #5463: In struct module, remove deprecated overflow wrapping
8736 when packing an integer: struct.pack('=L', -1) now raises
8737 struct.error instead of returning b'\xff\xff\xff\xff'. The
8738 _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
8739 have been removed from the struct module.
8740
8741
8742What's New in Python 3.1 alpha 1
8743================================
8744
8745*Release date: 2009-03-07*
8746
8747Core and Builtins
8748-----------------
8749
8750- The io module has been reimplemented in C for speed.
8751
8752- Give dict views an informative __repr__.
8753
8754- Issue #5247: Improve error message when unknown format codes are
8755 used when using str.format() with str, int, and float arguments.
8756
8757- Issue #5249: time.strftime returned malformed string when format string
8758 contained non ascii character on windows.
8759
8760- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
8761 source has already been decoded into str.
8762
8763- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
8764 rotating the object pointer by 4 bits to the right.
8765
8766- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
8767 it now forces its argument to double before testing for infinity.
8768
8769- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
8770 returns a non-number type.
8771
8772- Issue #5182: Removed memoryview.__str__.
8773
8774- Issue #1717: Removed builtin cmp() function, dropped tp_compare
8775 slot, the C API functions PyObject_Compare and PyUnicode_Compare and
8776 the type definition cmpfunc. The tp_compare slot has been renamed
8777 to tp_reserved, and is reserved for future usage.
8778
8779- Issue #1242657: the __len__() and __length_hint__() calls in several tools
8780 were suppressing all exceptions. These include list() and bytearray().
8781
8782- Issue #4707: round(x, n) now returns an integer if x is an integer.
8783 Previously it returned a float.
8784
8785- Issue #4753: By enabling a configure option named '--with-computed-gotos'
8786 on compilers that support it (notably: gcc, SunPro, icc), the bytecode
8787 evaluation loop is compiled with a new dispatch mechanism which gives
8788 speedups of up to 20%, depending on the system, on various benchmarks.
8789
8790- Issue #4874: Most builtin decoders now reject unicode input.
8791
8792- Issue #4842: Don't allow trailing 'L' when constructing an integer
8793 from a string.
8794
8795- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
8796
8797- Issue #4838: When a module is deallocated, free the memory backing the
8798 optional module state data.
8799
8800- Issue #4910: Rename nb_long slot to nb_reserved, and change its
8801 type to ``(void *)``.
8802
8803- Issue #4935: The overflow checking code in the expandtabs() method common
8804 to str, bytes and bytearray could be optimized away by the compiler, letting
8805 the interpreter segfault instead of raising an error.
8806
8807- Issue #3720: Fix a crash when an iterator modifies its class and removes its
8808 __next__ method.
8809
8810- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
8811 function no longer attempt to call the __long__ slot to convert an object
8812 to an integer. Only the __int__ and __trunc__ slots are examined.
8813
8814- Issue #4893: Use NT threading on CE.
8815
8816- Issue #4915: Port sysmodule to Windows CE.
8817
8818- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
8819 common cases are optimized thanks to a dedicated fast path and a moderate
8820 amount of loop unrolling.
8821
8822- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
8823 collecting the oldest generation) so that allocating lots of objects without
8824 destroying them does not show quadratic performance. Based on a proposal by
8825 Martin von Löwis at
8826 http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
8827
8828- Issue #4604: Some objects of the I/O library could still be used after
8829 having been closed (for instance, a read() call could return some
8830 previously buffered data). Patch by Dmitry Vasiliev.
8831
8832- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
8833 flag to work properly. Furthermore, when specifying -u, the text stdout
8834 and stderr streams have line-by-line buffering enabled (the default being
8835 to buffer arbitrary chunks of data).
8836
8837- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
8838 instead of ints (reducing its size from 4 to 8 times thereby reducing
8839 Python's overall memory).
8840
8841- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
8842 an existing .py counterpart, override the co_filename attributes of all
8843 code objects if the original filename is obsolete (which can happen if the
8844 file has been renamed, moved, or if it is accessed through different paths).
8845 Patch by Ziga Seilnacht and Jean-Paul Calderone.
8846
8847- Issue #4580: Fix slicing of memoryviews when the item size is greater than
8848 one byte. Also fixes the meaning of len() so that it returns the number of
8849 items, rather than the size in bytes.
8850
8851- Issue #4075: Use OutputDebugStringW in Py_FatalError.
8852
8853- Issue #4747: When the terminal does not use utf-8, executing a script with
8854 non-ascii characters in its name could fail with a "SyntaxError: None" error.
8855
8856- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
8857 to open file with a bytes filename on Windows.
8858
8859- Issue #3680: Reference cycles created through a dict, set or deque iterator
8860 did not get collected.
8861
8862- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
8863 where the tp_hash and tp_dict slots are both NULL.
8864
8865- Issue #4759: None is now allowed as the first argument of
8866 bytearray.translate(). It was always allowed for bytes.translate().
8867
8868- Added test case to ensure attempts to read from a file opened for writing
8869 fail.
8870
8871- Issue #3106: Speedup some comparisons (str/str and int/int).
8872
8873- Issue #2183: Simplify and optimize bytecode for list, dict and set
8874 comprehensions. Original patch for list comprehensions by Neal Norwitz.
8875
8876- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
8877 print elapsed times, not only when some objects are uncollectable /
8878 unreachable. Original patch by Neil Schemenauer.
8879
8880- Issue #3439: Add a bit_length method to int.
8881
8882- Issue #2173: When getting device encoding, check that return value of
8883 nl_langinfo is not the empty string. This was causing silent build
8884 failures on OS X.
8885
8886- Issue #4597: Fixed several opcodes that weren't always propagating
8887 exceptions.
8888
8889- Issue #4589: Fixed exception handling when the __exit__ function of a
8890 context manager returns a value that cannot be converted to a bool.
8891
8892- Issue #4445: Replace "sizeof(PyBytesObject)" with
8893 "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
8894 bytes instances. On a typical machine this saves 3 bytes of memory
8895 (on average) per allocation of a bytes instance.
8896
8897- Issue #4533: File read operation was dreadfully slow due to a slowly
8898 growing read buffer. Fixed by using the same growth rate algorithm as
8899 Python 2.x.
8900
8901- Issue #4509: Various issues surrounding resize of bytearray objects to
8902 which there are buffer exports (e.g. memoryview instances).
8903
8904- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
8905 method on file objects with closefd=False. The file descriptor is still
8906 kept open but the file object behaves like a closed file. The ``FileIO``
8907 object also got a new readonly attribute ``closefd``.
8908
8909- Issue #4569: Interpreter crash when mutating a memoryview with an item size
8910 larger than 1.
8911
8912- Issue #4748: Lambda generators no longer return a value.
8913
8914- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
8915
8916- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
8917 PyUnicode_DecodeUTF8() once, remember the result and output it in a second
8918 step. This avoids problems with counting UTF-8 bytes that ignores the effect
8919 of using the replace error handler in PyUnicode_DecodeUTF8().
8920
8921Library
8922-------
8923
8924- Issue #7071: byte-compilation in Distutils is now done with respect to
8925 sys.dont_write_bytecode.
8926
8927- Issue #7066: archive_util.make_archive now restores the cwd if an error is
8928 raised. Initial patch by Ezio Melotti.
8929
8930- Issue #6516: Added owner/group support when creating tar archives in
8931 Distutils.
8932
8933- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
8934
8935- Issue #6163: Fixed HP-UX runtime library dir options in
8936 distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
8937 Michael Haubenwallner.
8938
8939- Issue #6693: New functions in site.py to get user/global site packages paths.
8940
8941- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
8942 opening an empty or very small file.
8943
8944- Issue #6545: Removed assert statements in distutils.Extension, so the
8945 behavior is similar when used with -O.
8946
8947- unittest has been split up into a package. All old names should still work.
8948
8949- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
8950 uses the same refactored function to get gcc/ld/dllwrap versions numbers.
8951 It's `distutils.util.get_compiler_versions`. Added deprecation warnings
8952 for the obsolete get_versions() functions.
8953
8954- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
8955
8956- Issue #6314: logging: Extra checks on the "level" argument in more places.
8957
8958- Issue #2622: Fixed an ImportError when importing email.message from a
8959 standalone application built with py2exe or py2app.
8960
8961- Issue #6455: Fixed test_build_ext under win32.
8962
8963- Issue #6377: Enabled the compiler option, and deprecate its usage as an
8964 attribute.
8965
8966- Issue #6413: Fixed the log level in distutils.dist for announce.
8967
8968- Issue #6403: Fixed package path usage in build_ext.
8969
8970- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
8971 unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
8972 descriptor errors
8973
8974- Issue #6365: Distutils build_ext inplace mode was copying the compiled
8975 extension in a subdirectory if the extension name had dots.
8976
8977- Issue #6164: Added an AIX specific linker argument in Distutils
8978 unixcompiler. Original patch by Sridhar Ratnakumar.
8979
8980- Issue #6286: Now Distutils upload command is based on urllib2 instead of
8981 httplib, allowing the usage of http_proxy.
8982
8983- Issue #6287: Added the license field in Distutils documentation.
8984
8985- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
8986
8987- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
8988 in Makefiles. This prevents compile errors when using syntax like:
8989 `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
8990
8991- Issue #6131: test_modulefinder leaked when run after test_distutils.
8992 Patch by Hirokazu Yamamoto.
8993
8994- Issue #6048: Now Distutils uses the tarfile module in archive_util.
8995
8996- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
8997 and tests on pywin32 by Tim Golden.
8998
8999- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
9000
9001- Issue #6046: Fixed the library extension when distutils build_ext is used
9002 inplace. Initial patch by Roumen Petrov.
9003
9004- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
9005 subcommand.
9006
9007- Issue #6022: a test file was created in the current working directory by
9008 test_get_outputs in Distutils.
9009
9010- Issue #5977: distutils build_ext.get_outputs was not taking into account the
9011 inplace option. Initial patch by kxroberto.
9012
9013- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
9014 for old-style extensions.
9015
9016- Issue #5976: Fixed Distutils test_check_environ.
9017
9018- Issue #5941: Distutils build_clib command was not working anymore because
9019 of an incomplete costumization of the archiver command. Added ARFLAGS in the
9020 Makefile besides AR and make Distutils use it. Original patch by David
9021 Cournapeau.
9022
9023- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
9024
9025- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
9026 anymore.
9027
9028- Issue #5810: Fixed Distutils test_build_scripts so it uses
9029 sysconfig.get_config_vars.
9030
9031- Issue #4951: Fixed failure in test_httpservers.
9032
9033- Issue #5795: Fixed test_distutils failure on Debian ppc.
9034
9035- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
9036
9037- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
9038 a value in SafeConfigParser.
9039
9040- Issue #5732: added a new command in Distutils: check.
9041
9042- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
9043 platforms. Initial patch by Paul Moore.
9044
9045- Issue #5095: Added bdist_msi to the list of bdist supported formats.
9046 Initial fix by Steven Bethard.
9047
9048- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
9049 Initial fix by Wayne Davison.
9050
9051- Issue #5694: removed spurious test output in Distutils (test_clean).
9052
9053- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
9054
9055- Issue #1665206 (partially): Move imports in cgitb to the top of the module
9056 instead of performing them in functions. Helps prevent import deadlocking in
9057 threads.
9058
9059- Issue #2522: locale.format now checks its first argument to ensure it has
9060 been passed only one pattern, avoiding mysterious errors where it appeared
9061 that it was failing to do localization.
9062
9063- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
9064 Brandl.
9065
9066- Issue #1222: locale.format() bug when the thousands separator is a space
9067 character.
9068
9069- Issue #5472: Fixed distutils.test_util tear down. Original patch by
9070 Tim Golden.
9071
9072- collections.deque() objects now have a read-only attribute called maxlen.
9073
9074- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
9075 it is has been populated and properly configured in order to prevent
9076 window flashing.
9077
9078- Issue #4792: Prevent a segfault in _tkinter by using the
9079 guaranteed to be safe interp argument given to the PythonCmd in place of
9080 the Tcl interpreter taken from a PythonCmd_ClientData.
9081
9082- Issue #5193: Guarantee that tkinter.Text.search returns a string.
9083
9084- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
9085 Original patch by Akira Kitada.
9086
9087- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
9088
9089- Issue #5385: Fixed mmap crash after resize failure on windows.
9090
9091- Issue #5179: Fixed subprocess handle leak on failure on windows.
9092
9093- PEP 372: Added collections.OrderedDict().
9094
9095- The _asdict() for method for namedtuples now returns an OrderedDict().
9096
9097- configparser now defaults to using an ordered dictionary.
9098
9099- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
9100 import guess_extension`` was used.
9101
9102- Issue #1733986: Fixed mmap crash in accessing elements of second map object
9103 with same tagname but larger size than first map. (Windows)
9104
9105- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
9106 overrun.
9107
9108- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
9109 bdist_rpm command.
9110
9111- Issue #5378: added --quiet option to Distutils bdist_rpm command.
9112
9113- Issue #5052: make Distutils compatible with 2.3 again.
9114
9115- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
9116 in Distutils tests.
9117
9118- Issue #5287: Add exception handling around findCaller() call to help out
9119 IronPython.
9120
9121- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
9122 The file was resized to wrong size.
9123
9124- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
9125
9126- Issue #2279: distutils.sdist.add_defaults now add files
9127 from the package_data and the data_files metadata.
9128
9129- Issue #5257: refactored all tests in distutils, so they use
9130 support.TempdirManager, to avoid writing in the tests directory.
9131
9132- Issue #4524: distutils build_script command failed with --with-suffix=3.
9133 Initial patch by Amaury Forgeot d'Arc.
9134
9135- Issue #2461: added tests for distutils.util
9136
9137- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
9138 which inherited from numbers.py which did not have __slots__ defined. The
9139 numbers hierarchy now has its own __slots__ declarations.
9140
9141- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
9142 encoding.
9143
9144- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
9145 function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
9146
9147- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
9148 under NT and OS2. Patch by Philip Jenvey.
9149
9150- Issue #5128: Make compileall properly inspect bytecode to determine if needs
9151 to be recreated. This avoids a timing hole thanks to the old reliance on the
9152 ctime of the files involved.
9153
9154- Issue #5122: Synchronize tk load failure check to prevent a potential
9155 deadlock.
9156
9157- Issue #1818: collections.namedtuple() now supports a keyword argument
9158 'rename' which lets invalid fieldnames be automatically converted to
9159 positional names in the form, _1, _2, ...
9160
9161- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
9162
9163- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
9164 public documented method ``ZipImporter.get_filename()``.
9165
9166- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
9167 the execution of packages by looking for and executing a ``__main__``
9168 submodule when a package name is supplied. Initial patch by Andi
9169 Vajda.
9170
9171- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
9172 not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
9173 Tkapp_Call when calling from a thread different than the one that created
9174 the Tcl interpreter. Patch by Robert Hancock.
9175
9176- Issue #4285: Change sys.version_info to be a named tuple. Patch by
9177 Ross Light.
9178
9179- Issue #1520877: Now distutils.sysconfig reads $AR from the
9180 environment/Makefile. Patch by Douglas Greiman.
9181
9182- Issue #1276768: The verbose option was not used in the code of
9183 distutils.file_util and distutils.dir_util.
9184
9185- Issue #5132: Fixed trouble building extensions under Solaris with
9186 --enabled-shared activated. Initial patch by Dave Peterson.
9187
9188- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
9189
9190- The shelve module now defaults to pickle protocol 3.
9191
9192- Fix a bug in the trace module where a bytes object from co_lnotab had its
9193 items being passed through ord().
9194
9195- Issue #2047: shutil.move() could believe that its destination path was
9196 inside its source path if it began with the same letters (e.g. "src" vs.
9197 "src.new").
9198
9199- Added the ttk module. See issue #2983: Ttk support for Tkinter.
9200
9201- Removed isSequenceType(), isMappingType, and isNumberType() from the
9202 operator module; use the abstract base classes instead. Also removed
9203 the repeat() function; use mul() instead.
9204
9205- Issue #5021: doctest.testfile() did not create __name__ and
9206 collections.namedtuple() relied on __name__ being defined.
9207
9208- Backport importlib from Python 3.1. Only the import_module() function has
9209 been backported to help facilitate transitions from 2.7 to 3.1.
9210
9211- Issue #1885: distutils. When running sdist with --formats=tar,gztar
Martin Pantere26da7c2016-06-02 10:07:09 +00009212 the tar file was overridden by the gztar one.
Georg Brandl86dc7322012-10-01 18:58:45 +02009213
9214- Issue #4863: distutils.mwerkscompiler has been removed.
9215
9216- Added a new itertools functions: combinations_with_replacement()
9217 and compress().
9218
9219- Issue #5032: added a step argument to itertools.count() and
9220 allowed non-integer arguments.
9221
9222- Fix and properly document the multiprocessing module's logging
9223 support, expose the internal levels and provide proper usage
9224 examples.
9225
9226- Issue #1672332: fix unpickling of subnormal floats, which was
9227 producing a ValueError on some platforms.
9228
9229- Issue #3881: Help Tcl to load even when started through the
9230 unreadable local symlink to "Program Files" on Vista.
9231
9232- Issue #4710: Extract directories properly in the zipfile module;
9233 allow adding directories to a zipfile.
9234
9235- Issue #3807: _multiprocessing build fails when configure is passed
9236 --without-threads argument. When this occurs, _multiprocessing will
9237 be disabled, and not compiled.
9238
9239- Issue #5008: When a file is opened in append mode with the new IO library,
9240 do an explicit seek to the end of file (so that e.g. tell() returns the
9241 file size rather than 0). This is consistent with the behaviour of the
9242 traditional 2.x file object.
9243
9244- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
9245 parameter was set.
9246
9247- Issue #4842: Always append a trailing 'L' when pickling longs using
9248 pickle protocol 0. When reading, the 'L' is optional.
9249
9250- Add the importlib package.
9251
9252- Issue #4301: Patch the logging module to add processName support, remove
9253 _check_logger_class from multiprocessing.
9254
9255- Issue #3325: Remove python2.x try: except: imports for old cPickle from
9256 multiprocessing.
9257
9258- Issue #4959: inspect.formatargspec now works for keyword only arguments
9259 without defaults.
9260
9261- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
9262 for Unix machines for negative handles and large int handles. Without this check
9263 it is possible to segfault the interpreter.
9264
9265- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
9266 in sharedctypes.py.
9267
9268- Issue #1225107: inspect.isclass() returned True for instances with a custom
9269 __getattr__.
9270
9271- Issue #3826 and #4791: The socket module now closes the underlying socket
9272 appropriately when it is being used via socket.makefile() objects
9273 rather than delaying the close by waiting for garbage collection to do it.
9274
9275- Issue #1696199: Add collections.Counter() for rapid and convenient
9276 counting.
9277
Serhiy Storchaka14867992014-09-10 23:43:41 +03009278- Issue #3860: GzipFile and BZ2File now support the context management protocol.
Georg Brandl86dc7322012-10-01 18:58:45 +02009279
9280- Issue #4867: Fixed a crash in ctypes when passing a string to a
9281 function without defining argtypes.
9282
9283- Issue #4272: Add an optional argument to the GzipFile constructor to override
9284 the timestamp in the gzip stream. The default value remains the current time.
9285 The information can be used by e.g. gunzip when decompressing. Patch by
9286 Jacques Frechet.
9287
9288- Restore Python 2.3 compatibility for decimal.py.
9289
9290- Issue #3638: Remove functions from _tkinter module level that depend on
9291 TkappObject to work with multiple threads.
9292
9293- Issue #4718: Adapt the wsgiref package so that it actually works with
9294 Python 3.x, in accordance with the `official amendments of the spec
9295 <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
9296
9297- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
9298 to the decimal module.
9299
9300- Fractions.from_float() no longer loses precision for integers too big to
9301 cast as floats.
9302
9303- Issue #4812: add missing underscore prefix to some internal-use-only
9304 constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
9305
9306- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
9307 did unnecessary work in the common case where no key function was specified.
9308
9309- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
9310 the function is not a generator.
9311
9312- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
9313 no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
9314
9315- Issue #4646: distutils was choking on empty options arg in the setup
9316 function. Original patch by Thomas Heller.
9317
9318- Issue #3767: Convert Tk object to string in tkColorChooser.
9319
9320- Issue #3248: Allow placing ScrolledText in a PanedWindow.
9321
9322- Issue #4444: Allow assertRaises() to be used as a context handler, so that
9323 the code under test can be written inline if more practical.
9324
9325- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
9326 works as expected in the interactive environment.
9327
9328- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
9329 Gabriel Genellina.
9330
Martin Panter6245cb32016-04-15 02:14:19 +00009331- Issue #4574: reading a UTF16-encoded text file crashes if \r on 64-char
Georg Brandl86dc7322012-10-01 18:58:45 +02009332 boundary.
9333
9334- Issue #4223: inspect.getsource() will now correctly display source code
9335 for packages loaded via zipimport (or any other conformant PEP 302
9336 loader). Original patch by Alexander Belopolsky.
9337
9338- Issue #4201: pdb can now access and display source code loaded via
9339 zipimport (or any other conformant PEP 302 loader). Original patch by
9340 Alexander Belopolsky.
9341
9342- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
9343 302 conformant loader) will now work correctly in most cases (they
9344 are still subject to the constraints that exist for all code running
9345 from inside a module loaded via a PEP 302 loader and attempting to
9346 perform IO operations based on __file__). Original patch by
9347 Alexander Belopolsky.
9348
9349- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
9350 allows backporting to maintenance branches. Original patch by
9351 Alexander Belopolsky.
9352
9353- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
9354 a non-ASCII letter.
9355
9356- Issue #4616: TarFile.utime(): Restore directory times on Windows.
9357
9358- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
9359 codec cannot be found. This is for compatibility with the builtin behavior.
9360
9361- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
9362 give correct results in the case where one argument is a quiet NaN
9363 and the other is a finite number that requires rounding.
9364
9365- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
9366 libs.
9367
9368- Added the subprocess.check_call_output() convenience function to get output
9369 from a subprocess on success or raise an exception on error.
9370
9371- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9372 support unusual filenames (such as those containing semi-colons) in
9373 Content-Disposition headers.
9374
9375- Issue #4384: Added logging integration with warnings module using
9376 captureWarnings(). This change includes a NullHandler which does nothing;
9377 it will be of use to library developers who want to avoid the "No handlers
9378 could be found for logger XXX" message which can appear if the library user
9379 doesn't configure logging.
9380
9381- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9382 exception.
9383
9384- Issue #4529: fix the parser module's validation of try-except-finally
9385 statements.
9386
9387- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
9388 not a malformed option.
9389
9390- Added the subprocess.check_output() convenience function to get output
9391 from a subprocess on success or raise an exception on error.
9392
9393- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
9394 the corresponding tests now pass.
9395
9396- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
9397 it was calling the wrong open() function.
9398
9399- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
9400 support unusual filenames (such as those containing semi-colons) in
9401 Content-Disposition headers.
9402
9403- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
9404 biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
9405
9406- Issue #5104: The socket module now raises OverflowError when 16-bit port and
9407 protocol numbers are supplied outside the allowed 0-65536 range on bind()
9408 and getservbyport().
9409
9410- Windows locale mapping updated to Vista.
9411
9412Tools/Demos
9413-----------
9414
9415- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
9416 and make it 2.6-compatible.
9417
9418- Ttk demos added in Demo/tkinter/ttk/
9419
9420- Issue #4677: add two list comprehension tests to pybench.
9421
9422
9423Build
9424-----
9425
9426- Issue #6094: Build correctly with Subversion 1.7.
9427
9428- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
9429
9430- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
9431 linker, rather than always exit successfully. Patch by Floris Bruynooghe.
9432
9433- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
9434 the order that backends for the dbm extension are checked.
9435
9436- Link the shared python library with $(MODLIBS).
9437
9438- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
9439
9440- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
9441
9442- Issue #4895: Use _strdup on Windows CE.
9443
9444- Issue #4472: "configure --enable-shared" now works on OSX
9445
9446- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
9447
9448- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9449
9450- Issue #4289: Remove Cancel button from AdvancedDlg.
9451
9452- Issue #1656675: Register a drop handler for .py* files on Windows.
9453
9454- Issue #4120: Exclude manifest from extension modules in VS2008.
9455
9456- Issue #4091: Install pythonxy.dll in system32 again.
9457
9458- Issue #4018: Disable "for me" installations on Vista.
9459
9460- Issue #3758: Add ``patchcheck`` build target to .PHONY.
9461
9462- Issue #4204: Fixed module build errors on FreeBSD 4.
9463
9464
9465C-API
9466-----
9467
9468- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
9469 NUL: Bogus TypeError detail string.
9470
9471- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
9472 for negative arguments. Previously, it raised TypeError.
9473
9474- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
9475
9476- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
9477 the GIL is released, or owned by another thread.
9478
9479- Issue #4122: On Windows, fix a compilation error when using the
9480 Py_UNICODE_ISSPACE macro in an extension module.
9481
9482
9483Extension Modules
9484-----------------
9485
9486- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
9487 supporting objects as input no matter how it was compiled (built in
9488 implementations or external openssl library).
9489
9490- Issue #4397: Fix occasional test_socket failure on OS X.
9491
9492- Issue #4279: Fix build of parsermodule under Cygwin.
9493
9494- Issue #4751: hashlib now releases the GIL when hashing large buffers
9495 (with a hardwired threshold of 2048 bytes), allowing better parallelization
9496 on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
9497
9498- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
9499
Martin Panterc04fb562016-02-10 05:44:01 +00009500- Issue #4738: Each zlib object now has a separate lock, allowing several streams
9501 to be compressed or decompressed at once on multi-CPU systems. Also, the GIL
Georg Brandl86dc7322012-10-01 18:58:45 +02009502 is now released when computing the CRC of a large buffer. Patch by ebfe.
9503
9504- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
9505
9506- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
9507
9508- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
9509 OpenBSD.
9510
9511- Issue #4583: array.array would not always prohibit resizing when a buffer
9512 has been exported, resulting in an interpreter crash when accessing the
9513 buffer.
9514
9515
9516- Issue #5228: Make functools.partial objects can now be pickled.
9517
9518Tests
9519-----
9520
9521- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
9522 regression tests in parallel, shortening the total runtime.
9523
9524- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
9525 Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
9526 the same behaviour as test_ttkguionly (and now also test_tk) which is to
9527 skip the tests if DISPLAY is defined but can't be used.
9528
9529- regrtest no longer treats ImportError as equivalent to SkipTest. Imports
9530 that should cause a test to be skipped are now done using import_module
9531 from test support, which does the conversion.
9532
9533- Issue #5083: New 'gui' resource for regrtest.
9534
9535
9536Docs
9537----
9538
9539
Barry Warsaw97f005d2008-12-03 16:46:14 +00009540What's New in Python 3.0 final
9541==============================
9542
9543*Release date: 03-Dec-2008*
9544
9545Core and Builtins
9546-----------------
9547
9548- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
9549 interpreter to abort ("Fatal Python error: Could not reset the stack!")
9550 instead of throwing a MemoryError.
9551
9552- Issue #3689: The list reversed iterator now supports __length_hint__
9553 instead of __len__. Behavior now matches other reversed iterators.
9554
9555- Issue #4367: Python would segfault during compiling when the unicodedata
9556 module couldn't be imported and \N escapes were present.
9557
9558- Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
9559
9560Library
9561-------
9562
9563- Issue #4387: binascii now refuses to accept str as binary input.
9564
9565- Issue #4073: Add 2to3 support to build_scripts, refactor that support
9566 in build_py.
9567
9568- IDLE would print a "Unhandled server exception!" message when internal
9569 debugging is enabled.
9570
9571- Issue #4455: IDLE failed to display the windows list when two windows have
9572 the same title.
9573
9574- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
9575 exception.
9576
9577- Issue #4433: Fixed an access violation when garbage collecting
9578 _ctypes.COMError instances.
9579
9580- Issue #4429: Fixed UnicodeDecodeError in ctypes.
9581
9582- Issue #4373: Corrected a potential reference leak in the pickle module and
9583 silenced a false positive ref leak in distutils.tests.test_build_ext.
9584
9585- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
9586 files.
9587
9588- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
9589 fail to properly display the error message.
9590
9591Build
9592-----
9593
9594- Issue #4407: Fix source file that caused the compileall step in Windows installer
9595 to fail.
9596
9597Docs
9598----
9599
9600- Issue #4449: Fixed multiprocessing examples
9601
9602- Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
9603 for keys and values which will be converted to bytes before committal.
9604
9605
9606What's New in Python 3.0 release candidate 3?
9607=============================================
9608
9609*Release date: 20-Nov-2008*
9610
9611
9612Core and Builtins
9613-----------------
9614
9615- Issue #4349: sys.path included a non-existent platform directory because of a
9616 faulty Makefile.
9617
9618- Issue #3327: Don't overallocate in the modules_by_index list.
9619
9620- Issue #1721812: Binary set operations and copy() returned the input type
9621 instead of the appropriate base type. This was incorrect because set
9622 subclasses would be created without their __init__() method being called.
9623 The corrected behavior brings sets into line with lists and dicts.
9624
9625- Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates to
9626 True, even when x doesn't compare equal to itself. This was a regression
9627 from 2.6.
9628
9629- Issue #3705: Command-line arguments were not correctly decoded when the
9630 terminal does not use UTF8.
9631
9632Library
9633-------
9634
9635- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
9636 the ctypes module is not present.
9637
9638- FileIO's mode attribute now always includes ``"b"``.
9639
9640- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String
9641 keys are now written out in UTF-8.
9642
9643- Issue #4338: Fix distutils upload command.
9644
9645- Issue #4354: Fix distutils register command.
9646
9647- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
9648
9649- Issue #4307: The named tuple that ``inspect.getfullargspec()`` returns now
9650 uses ``kwonlydefaults`` instead of ``kwdefaults``.
9651
Martin Panter7462b6492015-11-02 03:37:02 +00009652- Issue #4298: Fix a segfault when pickle.loads is passed ill-formed input.
Barry Warsaw97f005d2008-12-03 16:46:14 +00009653
9654- Issue #4283: Fix a left-over "iteritems" call in distutils.
9655
9656Build
9657-----
9658
9659- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
9660
9661- Issue #4289: Remove Cancel button from AdvancedDlg.
9662
9663- Issue #1656675: Register a drop handler for .py* files on Windows.
9664
9665Tools/Demos
9666-----------
9667
9668- Demos of the socketserver module now work with Python 3.
9669
9670
9671What's New in Python 3.0 release candidate 2
9672============================================
9673
9674*Release date: 05-Nov-2008*
9675
9676Core and Builtins
9677-----------------
9678
9679- Issue #4211: The __path__ attribute of frozen packages is now a list instead
9680 of a string as required by PEP 302.
9681
9682- Issue #3727: Fixed poplib.
9683
9684- Issue #3714: Fixed nntplib by using bytes where appropriate.
9685
9686- Issue #1210: Fixed imaplib and its documentation.
9687
Victor Stinner554fd082014-03-17 22:33:49 +01009688- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
Barry Warsaw97f005d2008-12-03 16:46:14 +00009689 method on file objects with closefd=False. The file descriptor is still
9690 kept open but the file object behaves like a closed file. The ``FileIO``
9691 object also got a new readonly attribute ``closefd``.
9692
9693- Issue #3626: On cygwin, starting python with a non-existent script name
9694 would not display anything if the file name is only 1 character long.
9695
9696- Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
9697 method does not return iterators for the 4th and 5th items.
9698
9699- Issue #3723: Fixed initialization of subinterpreters.
9700
9701- Issue #4213: The file system encoding is now normalized by the
9702 codec subsystem, for example UTF-8 is turned into utf-8.
9703
9704- Issue #4200: Changed the atexit module to store its state in its
9705 PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
9706
9707- Issue #4237: io.FileIO() was raising invalid warnings caused by
9708 insufficient initialization of PyFileIOObject struct members.
9709
9710- Issue #4170: Pickling a collections.defaultdict object would crash the
9711 interpreter.
9712
9713- Issue #4146: Compilation on OpenBSD has been restored.
9714
9715- Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
9716
9717- Issues #2384 and #3975: Tracebacks were not correctly printed when the
9718 source file contains a ``coding:`` header: the wrong line was displayed, and
9719 the encoding was not respected.
9720
9721- Issue #3740: Null-initialize module state.
9722
9723- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
9724
9725- Issue #1688: On Windows, the input() prompt was not correctly displayed if it
9726 contains non-ascii characters.
9727
9728- Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
9729
9730Library
9731-------
9732
9733- Issue #3664: The pickle module could segfault if a subclass of Pickler fails
9734 to call the base __init__ method.
9735
9736- Issue #3725: telnetlib now works completely in bytes.
9737
9738- Issue #4072: Restore build_py_2to3.
9739
9740- Issue #4014: Don't claim that Python has an Alpha release status, in addition
9741 to claiming it is Mature.
9742
9743- Issue #3187: Add sys.setfilesystemencoding.
9744
9745- Issue #3187: Better support for "undecodable" filenames. Code by Victor
9746 Stinner, with small tweaks by GvR.
9747
9748- Issue #3965: Allow repeated calls to turtle.Screen, by making it a
9749 true singleton object.
9750
9751- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
9752
9753- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
9754 raise a TypeError: "'tuple' object is not callable" instead of the expected
9755 dbm.error.
9756
9757- Bug #3884: Make the turtle module toplevel again.
9758
9759- Issue #3547: Fixed ctypes structures bitfields of varying integer
9760 sizes.
9761
9762Extension Modules
9763-----------------
9764
9765- Issue #3659: Subclasses of str didn't work as SQL parameters.
9766
9767Build
9768-----
9769
9770- Issue #4120: Exclude manifest from extension modules in VS2008.
9771
9772- Issue #4091: Install pythonxy.dll in system32 again.
9773
9774- Issue #4018: Disable "for me" installations on Vista.
9775
9776- Issue #4204: Fixed module build errors on FreeBSD 4.
9777
9778Tools/Demos
9779-----------
9780
9781- Issue #3717: Fix Demo/embed/demo.c.
9782
9783- Issue #4072: Add a distutils demo for build_py_2to3.
9784
9785
9786What's New in Python 3.0 release candidate 1
9787============================================
9788
9789*Release date: 17-Sep-2008*
9790
9791Core and Builtins
9792-----------------
9793
9794- Issue #3827: memoryview lost its size attribute in favor of using len(view).
9795
9796- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
9797
9798- Issue #3705: fix crash when given a non-ascii value on the command line for
9799 the "-c" and "-m" parameters. Now the behaviour is as expected under Linux,
9800 although under Windows it fails at a later point.
9801
9802- Issue #3279: Importing site at interpreter was failing silently because the
9803 site module uses the open builtin which was not initialized at the time.
9804
9805- Issue #3660: Corrected a reference leak in str.encode() when the encoder
9806 does not return a bytes object.
9807
9808- Issue #3774: Added a few more checks in PyTokenizer_FindEncoding to handle
9809 error conditions.
9810
9811- Issue #3594: Fix Parser/tokenizer.c:fp_setreadl() to open the file being
9812 tokenized by either a file path or file pointer for the benefit of
9813 PyTokenizer_FindEncoding().
9814
9815- Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin. On
9816 these systems, the mbstowcs() function is slightly buggy and must be
9817 replaced with strlen() for the purpose of counting of number of wide
9818 characters needed to represent the multi-byte character string.
9819
9820- Issue #3697: "Fatal Python error: Cannot recover from stack overflow"
9821 could be easily encountered under Windows in debug mode when exercising
9822 the recursion limit checking code, due to bogus handling of recursion
9823 limit when USE_STACKCHEK was enabled.
9824
Martin Panter4e525582016-05-22 03:01:52 +00009825- Issue #3639: The _warnings module could segfault the interpreter when
Barry Warsaw97f005d2008-12-03 16:46:14 +00009826 unexpected types were passed in as arguments.
9827
9828- Issue #3712: The memoryview object had a reference leak and didn't support
9829 cyclic garbage collection.
9830
9831- Issue #3668: Fix a memory leak with the "s*" argument parser in
Victor Stinner554fd082014-03-17 22:33:49 +01009832 PyArg_ParseTuple and friends, which occurred when the argument for "s*"
Barry Warsaw97f005d2008-12-03 16:46:14 +00009833 was correctly parsed but parsing of subsequent arguments failed.
9834
9835- Issue #3611: An exception __context__ could be cleared in a complex pattern
9836 involving a __del__ method re-raising an exception.
9837
Victor Stinner554fd082014-03-17 22:33:49 +01009838- Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
Barry Warsaw97f005d2008-12-03 16:46:14 +00009839 match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__
9840 mechanism. In the process, fix a bug where isinstance() and issubclass(),
9841 when given a tuple of classes as second argument, were looking up
9842 __instancecheck__ / __subclasscheck__ on the tuple rather than on each
9843 type object.
9844
9845- Issue #3663: Py_None was decref'd when printing SyntaxErrors.
9846
9847- Issue #3651: Fix various memory leaks when using the buffer
9848 interface, or when the "s#" code of PyArg_ParseTuple is given a
9849 bytes object.
9850
9851- Issue #3657: Fix uninitialized memory read when pickling longs.
9852 Found by valgrind.
9853
9854- Apply security patches from Apple.
9855
9856- Fix crashes on memory allocation failure found with failmalloc.
9857
9858- Fix memory leaks found with valgrind and update suppressions file.
9859
9860- Fix compiler warnings in opt mode which would lead to invalid memory reads.
9861
9862- Fix problem using wrong name in decimal module reported by pychecker.
9863
9864- Issue #3650: Fixed a reference leak in bytes.split('x').
9865
9866- bytes(o) now tries to use o.__bytes__() before using fallbacks.
9867
9868- Issue #1204: The configure script now tests for additional libraries
9869 that may be required when linking against readline. This fixes issues
9870 with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
9871
9872C API
9873-----
9874
9875- PyObject_Bytes and PyBytes_FromObject were added.
9876
9877Library
9878-------
9879
9880- Issue #3756: make re.escape() handle bytes as well as str.
9881
9882- Issue #3800: fix filter() related bug in formatter.py.
9883
9884- Issue #874900: fix behaviour of threading module after a fork.
9885
9886- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
9887
9888- Issue #3776: Deprecate the bsddb package for removal in 3.0.
9889
9890- Issue #3762: platform.architecture() fails if python is lanched via
9891 its symbolic link.
9892
9893- Issue #3660: fix a memory leak in the C accelerator of the pickle module.
9894
9895- Issue #3160: the "bdist_wininst" distutils command didn't work.
9896
9897- Issue #1658: tkinter changes dict size during iteration in both
9898 tkinter.BaseWidget and tkinter.scrolledtext.ScrolledText.
9899
9900- The bsddb module (and therefore the dbm.bsd module) has been removed.
9901 It is now maintained outside of the standard library at
9902 http://www.jcea.es/programacion/pybsddb.htm.
9903
Martin Panter4e525582016-05-22 03:01:52 +00009904- Issue #600362: Relocated parse_qs() and parse_qsl(), from the cgi module
Barry Warsaw97f005d2008-12-03 16:46:14 +00009905 to the urlparse one. Added a DeprecationWarning in the old module, it
9906 will be deprecated in the future.
9907
9908- Issue #3719: platform.architecture() fails if there are spaces in the
9909 path to the Python binary.
9910
Martin Panter4e525582016-05-22 03:01:52 +00009911- Issue #3602: As part of the merge of r66135, make the parameters on
Barry Warsaw97f005d2008-12-03 16:46:14 +00009912 warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning.
9913
9914- The deprecation warnings for the camelCase threading API names were removed.
9915
Victor Stinner554fd082014-03-17 22:33:49 +01009916- Issue #3110: multiprocessing fails to compiel on solaris 10 due to missing
Barry Warsaw97f005d2008-12-03 16:46:14 +00009917 SEM_VALUE_MAX.
9918
9919Extension Modules
9920-----------------
9921
9922- Issue #3782: os.write() must not accept unicode strings.
9923
9924- Issue #2975: When compiling several extension modules with Visual Studio 2008
9925 from the same python interpreter, some environment variables would grow
9926 without limit.
9927
9928- Issue #3643: Added a few more checks to _testcapi to prevent segfaults by
9929 exploitation of poor argument checking.
9930
9931- bsddb code updated to version 4.7.3pre2. This code is the same than
Martin Panter6245cb32016-04-15 02:14:19 +00009932 Python 2.6 one, since the intention is to keep a unified 2.x/3.x codebase.
Barry Warsaw97f005d2008-12-03 16:46:14 +00009933 The Python code is automatically translated using "2to3". Please, do not
9934 update this code in Python 3.0 by hand. Update the 2.6 one and then
9935 do "2to3".
9936
9937- The _bytesio and _stringio modules are now compiled into the python binary.
9938
9939- Issue #3492 and #3790: Fixed the zlib module and zipimport module uses of
9940 mutable bytearray objects where they should have been using immutable bytes.
9941
9942- Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to
9943 return bytes objects instead of bytearray objects.
9944
9945
9946Tools/Demos
9947-----------
9948
9949- Fix Misc/gdbinit so it works.
9950
9951
9952Build
9953-----
9954
9955- Issue #3812: Failed to build python if configure --without-threads.
9956
9957- Issue #3791: Remove the bsddb module from the Windows installer, and the
9958 core bsddb library from the Windows build files.
9959
9960
9961What's new in Python 3.0b3?
9962===========================
9963
9964*Release date: 20-Aug-2008*
9965
9966Core and Builtins
9967-----------------
9968
9969- Issue #3653: Fix a segfault when sys.excepthook was called with invalid
9970 arguments.
9971
9972- Issue #2394: implement more of the memoryview API, with the caveat that
9973 only one-dimensional contiguous buffers are supported and exercised right
9974 now. Slicing, slice assignment and comparison (equality and inequality)
9975 have been added. Also, the tolist() method has been implemented, but only
Georg Brandl98b52ef2009-05-25 22:20:44 +00009976 for byte buffers. Finally, the API has been updated to return bytes objects
Barry Warsaw97f005d2008-12-03 16:46:14 +00009977 wherever it used to return bytearrays.
9978
9979- Issue #3560: clean up the new C PyMemoryView API so that naming is
9980 internally consistent; add macros PyMemoryView_GET_BASE() and
9981 PyMemoryView_GET_BUFFER() to access useful properties of a memory views
9982 without relying on a particular implementation; remove the ill-named
9983 PyMemoryView() function (PyMemoryView_GET_BUFFER() can be used instead).
9984
9985- ctypes function pointers that are COM methods have a boolean True
9986 value again.
9987
9988- Issue #1819: function calls with several named parameters are now on
9989 average 35% faster (as measured by pybench).
9990
9991- The undocumented C APIs PyUnicode_AsString() and
9992 PyUnicode_AsStringAndSize() were made private to the interpreter, in
9993 order to be able to refine their interfaces for Python 3.1.
9994
9995 If you need to access the UTF-8 representation of a Unicode object
9996 as bytes string, please use PyUnicode_AsUTF8String() instead.
9997
9998- Issue #3460: PyUnicode_Join() implementation is 10% to 80% faster thanks
Martin Panterc04fb562016-02-10 05:44:01 +00009999 to Python 3.0's stricter semantics which allow avoiding successive
Barry Warsaw97f005d2008-12-03 16:46:14 +000010000 reallocations of the result string (this also affects str.join()).
10001
10002
10003Library
10004-------
10005
10006- Issue #1276: Added temporary aliases for CJK Mac encodings to resolve
10007 a build problem on MacOS with CJK locales. It adds four temporary
10008 mappings to existing legacy codecs that are virtually compatible
10009 with Mac encodings. They will be replaced by codecs correctly
10010 implemented in 3.1.
10011
10012- Issue #3614: Corrected a typo in xmlrpc.client, leading to a NameError
10013 "global name 'header' is not defined".
10014
10015- Issue #2834: update the regular expression library to match the unicode
10016 standards of py3k. In other words, mixing bytes and unicode strings
10017 (be it as pattern, search string or replacement string) raises a TypeError.
10018 Moreover, the re.UNICODE flag is enabled automatically for unicode patterns,
10019 and can be disabled by specifying a new re.ASCII flag; as for bytes
10020 patterns, ASCII matching is the only option and trying to specify re.UNICODE
10021 for such patterns raises a ValueError.
10022
10023- Issue #3300: make urllib.parse.[un]quote() default to UTF-8.
10024 Code contributed by Matt Giuca. quote() now encodes the input
10025 before quoting, unquote() decodes after unquoting. There are
10026 new arguments to change the encoding and errors settings.
10027 There are also new APIs to skip the encode/decode steps.
10028 [un]quote_plus() are also affected.
10029
10030- Issue #2235: numbers.Number now blocks inheritance of the default id()
10031 based hash because that hash mechanism is not correct for numeric types.
10032 All concrete numeric types that inherit from Number (rather than just
10033 registering with it) must explicitly provide a hash implementation in
10034 order for their instances to be hashable.
10035
10036- Issue #2676: in the email package, content-type parsing was hanging on
10037 pathological input because of quadratic or exponential behaviour of a
10038 regular expression.
10039
10040- Issue #3476: binary buffered reading through the new "io" library is now
10041 thread-safe.
10042
10043- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
10044 menu entries were not deleted.
10045
10046- Remove the TarFileCompat class from tarfile.py.
10047
10048- Issue #2491: os.fdopen is now almost an alias for the built-in open(), and
10049 accepts the same parameters. It just checks that its first argument is an
10050 integer.
10051
10052- Issue #3394: zipfile.writestr sets external attributes when passed a
10053 file name rather than a ZipInfo instance, so files are extracted with
10054 mode 0600 rather than 000 under Unix.
10055
10056- Issue #2523: Fix quadratic behaviour when read()ing a binary file without
10057 asking for a specific length.
10058
10059Extension Modules
10060-----------------
10061
10062- Bug #3542: Support Unicode strings in _msi module.
10063
10064What's new in Python 3.0b2?
10065===========================
10066
10067*Release date: 17-Jul-2008*
10068
10069Core and Builtins
10070-----------------
10071
10072- Issue #3008: the float type has a new instance method 'float.hex'
10073 and a new class method 'float.fromhex' to convert floating-point
10074 numbers to and from hexadecimal strings, respectively.
10075
10076- Issue #3083: Add alternate (#) formatting for bin, oct, hex output
10077 for str.format(). This adds the prefix 0b, 0o, or 0x, respectively.
10078
10079- Issue #3280: like chr(), the "%c" format now accepts unicode code points
10080 beyond the Basic Multilingual Plane (above 0xffff) on all configurations. On
10081 "narrow Unicode" builds, the result is a string of 2 code units, forming a
10082 UTF-16 surrogate pair.
10083
10084- Issue #3282: str.isprintable() should return False for undefined
10085 Unicode characters.
10086
10087- Issue #3236: Return small longs from PyLong_FromString.
10088
10089- Exception tracebacks now support exception chaining.
10090
10091Library
10092-------
10093
10094- Removed the sunaudio module. Use sunau instead.
10095
10096- Issue #3554: ctypes.string_at and ctypes.wstring_at did call Python
10097 api functions without holding the GIL, which could lead to a fatal
10098 error when they failed.
10099
10100- Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap Tcl command objects.
10101
10102- Removed "ast" function aliases from the parser module.
10103
10104- Issue #3313: Fixed a crash when a failed dlopen() call does not set
10105 a valid dlerror() message.
10106
10107- Issue #3258: Fixed a crash when a ctypes POINTER type to an
10108 incomplete structure was created.
10109
10110- Issue #2683: Fix inconsistency in subprocess.Popen.communicate(): the
10111 argument now must be a bytes object in any case.
10112
10113- Issue #3145: help("modules whatever") failed when trying to load the source
10114 code of every single module of the standard library, including invalid files
10115 used in the test suite.
10116
10117- The gettext library now consistently uses Unicode strings for message ids
10118 and message strings, and ``ugettext()`` and the like don't exist anymore.
10119
10120- The traceback module has been expanded to handle chained exceptions.
10121
10122C API
10123-----
10124
10125- Issue #3247: the function Py_FindMethod was removed. Modern types should
10126 use the tp_methods slot instead.
10127
10128Tools/Demos
10129-----------
10130
10131- The Mac/Demos directory has been removed.
10132
10133- All of the Mac scripts have been removed (including BuildApplet.py).
10134
10135
10136What's new in Python 3.0b1?
10137===========================
10138
10139*Release date: 18-Jun-2008*
10140
10141Core and Builtins
10142-----------------
10143
10144- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
10145 argument being anything other than a dict or None. Also fixed a bug in error
10146 handling when 'message' and 'category' were both set to None, triggering a
10147 bus error.
10148
10149- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
10150 holds the last (strong) reference to its referent.
10151
10152- Issue #2630: implement PEP 3138. repr() now returns printable
10153 Unicode characters unescaped, to get an ASCII-only representation
10154 of an object use ascii().
10155
10156- Issue #1342: On windows, Python could not start when installed in a
10157 directory with non-ascii characters.
10158
10159- Implement PEP 3121: new module initialization and finalization API.
10160
10161- Removed the already-defunct ``-t`` option.
10162
10163- Issue #2957: Corrected a ValueError "recursion limit exceeded", when
10164 unmarshalling many code objects, which happens when importing a
10165 large .pyc file (~1000 functions).
10166
10167- Issue #2963: fix merging oversight that disabled method cache for
10168 all types.
10169
10170- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
10171
10172- Issue #2895: Don't crash when given bytes objects as keyword names.
10173
10174- Issue #2798: When parsing arguments with PyArg_ParseTuple, the "s"
10175 code now allows any unicode string and returns a utf-8 encoded
10176 buffer, just like the "s#" code already does. The "z" code was
10177 corrected as well.
10178
10179- Issue #2863: generators now have a ``gen.__name__`` attribute that
10180 equals ``gen.gi_code.co_name``, like ``func.__name___`` that equals
10181 ``func.func_code.co_name``. The repr() of a generator now also
10182 contains this name.
10183
10184- Issue #2831: enumerate() now has a ``start`` argument.
10185
10186- Issue #2801: fix bug in the float.is_integer method where a
10187 ValueError was sometimes incorrectly raised.
10188
10189- The ``--with-toolbox-glue`` option (and the associated
10190 pymactoolbox.h) have been removed.
10191
10192- Issue #2196: hasattr() now lets exceptions which do not inherit
10193 Exception (KeyboardInterrupt, and SystemExit) propagate instead of
10194 ignoring them.
10195
10196- #3021 Exception reraising sematics have been significantly improved. However,
10197 f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
10198 code anymore.
10199
10200- Three of PyNumberMethods' members, nb_coerce, nb_hex, and nb_oct, have been
10201 removed.
10202
10203Extension Modules
10204-----------------
10205
10206- Renamed ``_winreg`` module to ``winreg``.
10207
10208- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the
10209 platform.
10210
10211- Support for Windows 9x has been removed from the winsound module.
10212
10213- Issue #2870: cmathmodule.c compile error.
10214
10215Library
10216-------
10217
10218- The methods ``is_in_tuple()``, ``is_vararg()``, and ``is_keywordarg()`` of
10219 symtable.Symbol have been removed.
10220
10221- Patch #3133: http.server.CGIHTTPRequestHandler did not work on windows.
10222
10223- a new ``urllib`` package was created. It consists of code from
10224 ``urllib``, ``urllib2``, ``urlparse``, and ``robotparser``. The old
10225 modules have all been removed. The new package has five submodules:
10226 ``urllib.parse``, ``urllib.request``, ``urllib.response``,
10227 ``urllib.error``, and ``urllib.robotparser``. The
10228 ``urllib.request.urlopen()`` function uses the url opener from
10229 ``urllib2``. (Note that the unittests have not been renamed for the
10230 beta, but they will be renamed in the future.)
10231
10232- rfc822 has been removed in favor of the email package.
10233
10234- mimetools has been removed in favor of the email package.
10235
10236- Patch #2849: Remove use of rfc822 module from standard library.
10237
10238- Added C optimized implementation of io.StringIO.
10239
10240- The ``pickle`` module is now automatically use an optimized C
10241 implementation of Pickler and Unpickler when available. The
10242 ``cPickle`` module is no longer needed.
10243
10244- Removed the ``htmllib`` and ``sgmllib`` modules.
10245
10246- The deprecated ``SmartCookie`` and ``SimpleCookie`` classes have
10247 been removed from ``http.cookies``.
10248
10249- The ``commands`` module has been removed. Its getoutput() and
10250 getstatusoutput() functions have been moved to the ``subprocess`` module.
10251
10252- The ``http`` package was created; it contains the old ``httplib``
10253 as ``http.client``, ``Cookie`` as ``http.cookies``, ``cookielib``
10254 as ``http.cookiejar``, and the content of the three ``HTTPServer``
10255 modules as ``http.server``.
10256
10257- The ``xmlrpc`` package was created; it contains the old
10258 ``xmlrpclib`` module as ``xmlrpc.client`` and the content of
10259 the old ``SimpleXMLRPCServer`` and ``DocXMLRPCServer`` modules
10260 as ``xmlrpc.server``.
10261
10262- The ``dbm`` package was created, containing the old modules
10263 ``anydbm`` and ``whichdb`` in its ``__init__.py``, and having
10264 ``dbm.gnu`` (was ``gdbm``), ``dbm.bsd`` (was ``dbhash``),
10265 ``dbm.ndbm`` (was ``dbm``) and ``dbm.dumb`` (was ``dumbdbm``)
10266 as submodules.
10267
10268- The ``repr`` module has been renamed to ``reprlib``.
10269
10270- The ``statvfs`` module has been removed.
10271
10272- Issue #1713041: fix pprint's handling of maximum depth.
10273
10274- Issue #2250: Exceptions raised during evaluation of names in
10275 rlcompleter's ``Completer.complete()`` method are now caught and
10276 ignored.
10277
10278- Patch #2659: Added ``break_on_hyphens`` option to textwrap's
10279 ``TextWrapper`` class.
10280
10281- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
10282 large to fit in a C long. ldexp(x, n) now returns a zero (with
10283 suitable sign) if n is large and negative; previously, it raised
10284 OverflowError.
10285
10286- The ``ConfigParser`` module has been renamed to ``configparser``.
10287
10288- Issue #2865: webbrowser.open() works again in a KDE environment.
10289
10290- The ``multifile`` module has been removed.
10291
10292- The ``SocketServer`` module has been renamed to ``socketserver``.
10293
10294- Fixed the ``__all__`` setting on ``collections`` to include
10295 ``UserList`` and ``UserString``.
10296
10297- The sre module has been removed.
10298
10299- The Queue module has been renamed to queue.
10300
10301- The copy_reg module has been renamed to copyreg.
10302
10303- The mhlib module has been removed.
10304
10305- The ihooks module has been removed.
10306
10307- The fpformat module has been removed.
10308
10309- The dircache module has been removed.
10310
10311- The Canvas module has been removed.
10312
10313- The Decimal module gained the magic methods __round__, __ceil__,
10314 __floor__ and __trunc__, to give support for round, math.ceil,
10315 math.floor and math.trunc.
10316
10317- The user module has been removed.
10318
10319- The mutex module has been removed.
10320
10321- The imputil module has been removed.
10322
10323- os.path.walk has been removed in favor of os.walk.
10324
10325- pdb gained the "until" command.
10326
10327- The test.test_support module has been renamed to test.support.
10328
10329- The threading module API was renamed to be PEP 8 compliant. The
10330 old names are still present, but will be removed in the near future.
10331
10332Tools/Demos
10333-----------
10334
10335- The bgen tool has been removed.
10336
10337Build
10338-----
10339
10340
10341What's New in Python 3.0a5?
10342===========================
10343
10344*Release date: 08-May-2008*
10345
10346Core and Builtins
10347-----------------
10348
10349- Fixed misbehaviour of PyLong_FromSsize_t on systems where
10350 sizeof(size_t) > sizeof(long).
10351
10352- Issue #2221: Corrected a SystemError "error return without exception
10353 set", when the code executed by exec() raises an exception, and
10354 sys.stdout.flush() also raises an error.
10355
10356- Bug #2565: The repr() of type objects now calls them 'class', not
10357 'type' - whether they are builtin types or not.
10358
10359- The command line processing was converted to pass Unicode strings
10360 through as unmodified as possible; as a consequence, the C API
10361 related to command line arguments was changed to use wchar_t.
10362
10363- All backslashes in raw strings are interpreted literally. This
10364 means that '\u' and '\U' escapes are not treated specially.
10365
10366Extension Modules
10367-----------------
10368
10369Library
10370-------
10371
10372- ctypes objects now support the PEP3118 buffer interface.
10373
10374- Issue #2682: ctypes callback functions now longer contain a cyclic
10375 reference to themselves.
10376
10377- Issue #2058: Remove the buf attribute and add __slots__ to the
10378 TarInfo class in order to reduce tarfile's memory usage.
10379
10380- Bug #2606: Avoid calling .sort() on a dict_keys object.
10381
10382- The bundled libffi copy is now in sync with the recently released
10383 libffi3.0.5 version, apart from some small changes to
10384 Modules/_ctypes/libffi/configure.ac.
10385
10386Build
10387-----
10388
10389- Issue #1496032: On alpha, use -mieee when gcc is the compiler.
10390
10391- "make install" is now an alias for "make altinstall", to prevent
10392 accidentally overwriting a Python 2.x installation. Use "make
10393 fullinstall" to force Python 3.0 to be installed as "python".
10394
10395- Issue #2544: On HP-UX systems, use 'gcc -shared' for linking when
10396 gcc is used as compiler.
10397
10398
10399What's New in Python 3.0a4?
10400===========================
10401
10402*Release date: 02-Apr-2008*
10403
10404Core and Builtins
10405-----------------
10406
10407- Bug #2301: Don't try decoding the source code into the original
10408 encoding for syntax errors.
10409
10410Extension Modules
10411-----------------
10412
10413- The dl module was removed, use the ctypes module instead.
10414
10415- Use wchar_t functions in _locale module.
10416
10417Library
10418-------
10419
10420- The class distutils.commands.build_py.build_py_2to3 can be used as a
10421 build_py replacement to automatically run 2to3 on modules that are
10422 going to be installed.
10423
10424- A new pickle protocol (protocol 3) is added with explicit support
10425 for bytes. This is the default protocol. It intentionally cannot
10426 be unpickled by Python 2.x.
10427
10428- When a pickle written by Python 2.x contains an (8-bit) str
10429 instance, this is now decoded to a (Unicode) str instance. The
10430 encoding used to do this defaults to ASCII, but can be overridden
10431 via two new keyword arguments to the Unpickler class. Previously
10432 this would create bytes instances, which is usually wrong: str
10433 instances are often used to pickle attribute names etc., and text is
10434 more common than binary data anyway.
10435
10436- Default to ASCII as the locale.getpreferredencoding, if the POSIX
10437 system doesn't support CODESET and LANG isn't set or doesn't allow
10438 deduction of an encoding.
10439
10440- Issue #1202: zlib.crc32 and zlib.adler32 now return an unsigned
10441 value.
10442
10443- Issue #719888: Updated tokenize to use a bytes API. generate_tokens
10444 has been renamed tokenize and now works with bytes rather than
10445 strings. A new detect_encoding function has been added for
10446 determining source file encoding according to PEP-0263. Token
10447 sequences returned by tokenize always start with an ENCODING token
10448 which specifies the encoding used to decode the file. This token is
10449 used to encode the output of untokenize back to bytes.
10450
10451
10452What's New in Python 3.0a3?
10453===========================
10454
10455*Release date: 29-Feb-2008*
10456
10457Core and Builtins
10458-----------------
10459
10460- Issue #2282: io.TextIOWrapper was not overriding seekable() from
10461 io.IOBase.
10462
10463- Issue #2115: Important speedup in setting __slot__ attributes. Also
10464 prevent a possible crash: an Abstract Base Class would try to access
10465 a slot on a registered virtual subclass.
10466
10467- Fixed repr() and str() of complex numbers with infinity or nan as
10468 real or imaginary part.
10469
10470- Clear all free list during a gc.collect() of the highest generation
10471 in order to allow pymalloc to free more arenas. Python may give back
10472 memory to the OS earlier.
10473
10474- Issue #2045: Fix an infinite recursion triggered when printing a
10475 subclass of collections.defaultdict, if its default_factory is set
10476 to a bound method.
10477
10478- Fixed a minor memory leak in dictobject.c. The content of the free
10479 list was not freed on interpreter shutdown.
10480
10481- Limit free list of method and builtin function objects to 256
10482 entries each.
10483
10484- Patch #1953: Added ``sys._compact_freelists()`` and the C API
10485 functions ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
10486 to compact the internal free lists of pre-allocted ints and floats.
10487
10488- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
10489 Python expected the return type int but the fork familie returns
10490 pi_t.
10491
10492- Issue #1678380: Fix a bug that identifies 0j and -0j when they
10493 appear in the same code unit.
10494
10495- Issue #2025: Added tuple.count() and tuple.index() methods to comply
10496 with the collections.Sequence API.
10497
10498- Fixed multiple reinitialization of the Python interpreter. The small
10499 int list in longobject.c has caused a seg fault during the third
10500 finalization.
10501
10502- Issue #1973: bytes.fromhex('') raised SystemError.
10503
10504- Issue #1771: remove cmp parameter from sorted() and list.sort().
10505
10506- Issue #1969: split and rsplit in bytearray are inconsistent.
10507
10508- map() no longer accepts None for the first argument. Use zip()
10509 instead.
10510
10511- Issue #1769: Now int("- 1") is not allowed any more.
10512
10513- Object/longobject.c: long(float('nan')) raises an OverflowError
10514 instead of returning 0.
10515
10516- Issue #1762972: __file__ points to the source file instead of the
10517 pyc/pyo file if the py file exists.
10518
10519- Issue #1393: object_richcompare() returns NotImplemented instead of
10520 False if the objects aren't equal, to give the other side a chance.
10521
10522- Issue #1692: Interpreter was not displaying location of SyntaxError.
10523
10524- Improve some exception messages when Windows fails to load an
10525 extension module. Now we get for example '%1 is not a valid Win32
10526 application' instead of 'error code 193'. Also use Unicode strings
10527 to deal with non-English locales.
10528
10529- Issue #1587: Added instancemethod wrapper for PyCFunctions. The
10530 Python C API has gained a new type *PyInstanceMethod_Type* and the
10531 functions *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)*
10532 and *PyInstanceMethod_Function(im)*.
10533
10534- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed
10535 from the gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE
10536 are now enough to print the corresponding list of objects considered
10537 by the garbage collector.
10538
10539- Issue #1573: Improper use of the keyword-only syntax makes the
10540 parser crash.
10541
10542- Issue #1564: The set implementation should special-case PyUnicode
10543 instead of PyString.
10544
10545- Patch #1031213: Decode source line in SyntaxErrors back to its
10546 original source encoding.
10547
10548- inspect.getsource() includes the decorators again.
10549
10550- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
10551 mountpoint.
10552
10553- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when
10554 the first chunk fed to the decoder started with a BOM, but was
10555 longer than 3 bytes.
10556
10557Extension Modules
10558-----------------
10559
10560- Code for itertools ifilter(), imap(), and izip() moved to bultins
10561 and renamed to filter(), map(), and zip(). Also, renamed
10562 izip_longest() to zip_longest() and ifilterfalse() to filterfalse().
10563
10564- Issue #1762972: Readded the reload() function as imp.reload().
10565
10566- Bug #2111: mmap segfaults when trying to write a block opened with
10567 PROT_READ.
10568
10569- Issue #2063: correct order of utime and stime in os.times() result
10570 on Windows.
10571
10572Library
10573-------
10574
10575- Weakref dictionaries now inherit from MutableMapping.
10576
10577- Created new UserDict class in collections module. This one inherits
10578 from and complies with the MutableMapping ABC. Also, moved
10579 UserString and UserList to the collections module. The
10580 MutableUserString class was removed.
10581
10582- Removed UserDict.DictMixin. Replaced all its uses with
10583 collections.MutableMapping.
10584
10585- Issue #1703: getpass() should flush after writing prompt.
10586
10587- Issue #1585: IDLE uses non-existent xrange() function.
10588
10589- Issue #1578: Problems in win_getpass.
10590
10591Build
10592-----
10593
10594- Renamed --enable-unicode configure flag to --with-wide-unicode,
10595 since Unicode strings can't be disabled anymore.
10596
10597C API
10598-----
10599
10600- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
10601 Py_TYPE and Py_REFCNT.
10602
10603- New API PyImport_ImportModuleNoBlock(), works like
10604 PyImport_ImportModule() but won't block on the import lock
10605 (returning an error instead).
10606
10607
10608What's New in Python 3.0a2?
10609===========================
10610
10611*Release date: 07-Dec-2007*
10612
10613(Note: this list is incomplete.)
10614
10615Core and Builtins
10616-----------------
10617
10618- str8 now has the same construction signature as bytes.
10619
10620- Comparisons between str and str8 now return False/True for ==/!=.
10621 sqlite3 returns str8 when recreating on object from it's __conform__
10622 value. The struct module returns str8 for all string-related
10623 formats. This was true before this change, but becomes more
10624 apparent thanks to string comparisons always being False.
10625
10626- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode,
10627 buffer, encoding, newline)`.
10628
10629- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
10630
10631- Changed `__file__` and `co_filename` to unicode. The path names are decoded
10632 with `Py_FileSystemDefaultEncoding` and a new API method
10633 `PyUnicode_DecodeFSDefault(char*)` was added.
10634
10635- io.open() and _fileio.FileIO have grown a new argument closefd. A
10636 false value disables the closing of the file descriptor.
10637
10638- Added a new option -b to issues warnings (-bb for errors) about
10639 certain operations between bytes/buffer and str like str(b'') and
10640 comparison.
10641
Martin Pantera90a4a92016-05-30 04:04:50 +000010642- The standard streams sys.stdin, stdout and stderr may be None
10643 when the C runtime library returns an invalid file descriptor
Barry Warsaw97f005d2008-12-03 16:46:14 +000010644 for the streams (fileno(stdin) < 0). For now this happens only for
10645 Windows GUI apps and scripts started with `pythonw.exe`.
10646
10647- Added PCbuild9 directory for VS 2008.
10648
10649- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to
10650 work around a name clash with VS 2008 on Windows.
10651
10652- Unbound methods are gone for good. ClassObject.method returns an
10653 ordinary function object, instance.method still returns a bound
10654 method object. The API of bound methods is cleaned up, too. The
10655 im_class attribute is removed and im_func + im_self are renamed to
10656 __func__ and __self__. The factory PyMethod_New takes only func and
10657 instance as argument.
10658
10659- intobject.h is no longer included by Python.h. The remains were
10660 moved to longobject.h. It still exists to define several aliases
10661 from PyInt to PyLong functions.
10662
10663- Removed sys.maxint, use sys.maxsize instead.
10664
10665Extension Modules
10666-----------------
10667
10668- The `hotshot` profiler has been removed; use `cProfile` instead.
10669
10670Library
10671-------
10672
10673- When loading an external file using testfile(), the passed-in
10674 encoding argument was being ignored if __loader__ is defined and
10675 forcing the source to be UTF-8.
10676
10677- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have
10678 been removed in favor of the tempfile module.
10679
10680- Removed the 'new' module.
10681
Martin Pantere26da7c2016-06-02 10:07:09 +000010682- Removed all types from the 'types' module that are easily accessible
Barry Warsaw97f005d2008-12-03 16:46:14 +000010683 through builtins.
10684
10685
10686What's New in Python 3.0a1?
10687===========================
10688
10689*Release date: 31-Aug-2007*
10690
10691Core and Builtins
10692-----------------
10693
10694- PEP 3131: Support non-ASCII identifiers.
10695
10696- PEP 3120: Change default encoding to UTF-8.
10697
10698- PEP 3123: Use proper C inheritance for PyObject.
10699
10700- Removed the __oct__ and __hex__ special methods and added a bin()
10701 builtin function.
10702
10703- PEP 3127: octal literals now start with "0o". Old-style octal
10704 literals are invalid. There are binary literals with a prefix of
10705 "0b". This also affects int(x, 0).
10706
10707- None, True, False are now keywords.
10708
10709- PEP 3119: isinstance() and issubclass() can be overridden.
10710
10711- Remove BaseException.message.
10712
10713- Remove tuple parameter unpacking (PEP 3113).
10714
10715- Remove the f_restricted attribute from frames. This naturally leads
10716 to the removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
10717
10718- PEP 3132 was accepted. That means that you can do ``a, *b =
10719 range(5)`` to assign 0 to a and [1, 2, 3, 4] to b.
10720
10721- range() now returns an iterator rather than a list. Floats are not
10722 allowed. xrange() is no longer defined.
10723
10724- Patch #1660500: hide iteration variable in list comps, add set comps
10725 and use common code to handle compilation of iterative expressions.
10726
10727- By default, != returns the opposite of ==, unless the latter returns
10728 NotImplemented.
10729
10730- Patch #1680961: sys.exitfunc has been removed and replaced with a
10731 private C-level API.
10732
10733- PEP 3115: new metaclasses: the metaclass is now specified as a
10734 keyword arg in the class statement, which can now use the full
10735 syntax of a parameter list. Also, the metaclass can implement a
10736 __prepare__ function which will be called to create the dictionary
10737 for the new class namespace.
10738
10739- The long-deprecated argument "pend" of PyFloat_FromString() has been
10740 removed.
10741
10742- The dir() function has been extended to call the __dir__() method on
10743 its argument, if it exists. If not, it will work like before. This
10744 allows customizing the output of dir() in the presence of a
10745 __getattr__().
10746
10747- Removed support for __members__ and __methods__.
10748
10749- Removed indexing/slicing on BaseException.
10750
10751- input() became raw_input(): the name input() now implements the
10752 functionality formerly known as raw_input(); the name raw_input() is
10753 no longer defined.
10754
10755- Classes listed in an 'except' clause must inherit from
10756 BaseException.
10757
10758- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
10759 and .keys(), .items(), .values() return dict views, which behave
10760 like sets.
10761
10762- PEP 3105: print is now a function. Also (not in the PEP) the
10763 'softspace' attribute of files is now gone (since print() doesn't
10764 use it). A side effect of this change is that you can get
10765 incomplete output lines in interactive sessions:
10766
10767 >>> print(42, end="")
10768 42>>>
10769
10770 We may be able to fix this after the I/O library rewrite.
10771
10772- PEP 3102: keyword-only arguments.
10773
10774- Int/Long unification is complete. The 'long' built-in type and
10775 literals with trailing 'L' or 'l' have been removed. Performance
10776 may be sub-optimal (haven't really benchmarked).
10777
10778- 'except E, V' must now be spelled as 'except E as V' and deletes V
10779 at the end of the except clause; V must be a simple name.
10780
10781- Added function annotations per PEP 3107.
10782
10783- Added nonlocal declaration from PEP 3104:
10784
10785 >>> def f(x):
10786 ... def inc():
10787 ... nonlocal x
10788 ... x += 1
10789 ... return x
10790 ... return inc
10791 ...
10792 >>> inc = f(0)
10793 >>> inc()
10794 1
10795 >>> inc()
10796 2
10797
10798- Moved intern() to sys.intern().
10799
10800- exec is now a function.
10801
10802- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
10803
10804- Classic classes are a thing of the past. All classes are new style.
10805
10806- Exceptions *must* derive from BaseException.
10807
10808- Integer division always returns a float. The -Q option is no more.
10809 All the following are gone:
10810
10811 * PyNumber_Divide and PyNumber_InPlaceDivide
10812 * __div__, __rdiv__, and __idiv__
10813 * nb_divide, nb_inplace_divide
10814 * operator.div, operator.idiv, operator.__div__, operator.__idiv__
10815 (Only __truediv__ and __floordiv__ remain, not sure how to handle
10816 them if we want to re-use __div__ and friends. If we do, it will
10817 make it harder to write code for both 2.x and 3.x.)
10818
10819- 'as' and 'with' are keywords.
10820
10821- Absolute import is the default behavior for 'import foo' etc.
10822
10823- Removed support for syntax: backticks (ie, `x`), <>.
10824
10825- Removed these Python builtins: apply(), callable(), coerce(),
10826 execfile(), file(), reduce(), reload().
10827
10828- Removed these Python methods: {}.has_key.
10829
10830- Removed these opcodes: BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT.
10831
10832- Remove C API support for restricted execution.
10833
10834- zip(), map() and filter() now return iterators, behaving like their
10835 itertools counterparts. This also affect map()'s behavior on
10836 sequences of unequal length -- it now stops after the shortest one
10837 is exhausted.
10838
10839- Additions: set literals, set comprehensions, ellipsis literal.
10840
10841- Added class decorators per PEP 3129.
10842
10843
10844Extension Modules
10845-----------------
10846
10847- Removed the imageop module. Obsolete long with its unit tests
10848 becoming useless from the removal of rgbimg and imgfile.
10849
10850- Removed these attributes from the operator module: div, idiv,
10851 __div__, __idiv__, isCallable, sequenceIncludes.
10852
10853- Removed these attributes from the sys module: exc_clear(), exc_type,
10854 exc_value, exc_traceback.
10855
10856
10857Library
10858-------
10859
10860- Removed the compiler package. Use of the _ast module and (an
10861 eventual) AST -> bytecode mechanism.
10862
10863- Removed these modules: audiodev, Bastion, bsddb185, exceptions,
10864 linuxaudiodev, md5, MimeWriter, mimify, popen2, rexec, sets, sha,
10865 stringold, strop, sunaudiodev, timing, xmllib.
10866
10867- Moved the toaiff module to Tools/Demos.
10868
10869- Removed obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL,
10870 DEVICE, ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile,
10871 IOCTL, jpeg, panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
10872
10873- Removed obsolete functions: commands.getstatus(), os.popen*().
10874
10875- Removed functions in the string module that are also string methods;
10876 Remove string.{letters, lowercase, uppercase}.
10877
10878- Removed support for long obsolete platforms: plat-aix3, plat-irix5.
10879
10880- Removed xmlrpclib.SlowParser. It was based on xmllib.
10881
10882- Patch #1680961: atexit has been reimplemented in C.
10883
10884- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
10885
10886Build
10887-----
10888
10889C API
10890-----
10891
10892- Removed these Python slots: __coerce__, __div__, __idiv__, __rdiv__.
10893
10894- Removed these C APIs: PyNumber_Coerce(), PyNumber_CoerceEx(),
10895 PyMember_Get, PyMember_Set.
10896
10897- Removed these C slots/fields: nb_divide, nb_inplace_divide.
10898
10899- Removed these macros: staticforward, statichere, PyArg_GetInt,
10900 PyArg_NoArgs, _PyObject_Del.
10901
10902- Removed these typedefs: intargfunc, intintargfunc, intobjargproc,
10903 intintobjargproc, getreadbufferproc, getwritebufferproc,
10904 getsegcountproc, getcharbufferproc, memberlist.
10905
10906Tests
10907-----
10908
10909- Removed test.testall as test.regrtest replaces it.
10910
10911Documentation
10912-------------
10913
10914Mac
10915---
10916
10917- The cfmfile module was removed.
10918
10919Platforms
10920---------
10921
10922- Support for BeOS and AtheOS was removed (according to PEP 11).
10923
10924- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
10925
10926Tools/Demos
10927-----------
10928
10929
Christian Heimesc3f30c42008-02-22 16:37:40 +000010930What's New in Python 2.5 release candidate 1?
10931=============================================
10932
10933*Release date: 17-AUG-2006*
10934
10935Core and builtins
10936-----------------
10937
10938- Unicode objects will no longer raise an exception when being
10939 compared equal or unequal to a string and a UnicodeDecodeError
10940 exception occurs, e.g. as result of a decoding failure.
10941
10942 Instead, the equal (==) and unequal (!=) comparison operators will
10943 now issue a UnicodeWarning and interpret the two objects as
10944 unequal. The UnicodeWarning can be filtered as desired using
10945 the warning framework, e.g. silenced completely, turned into an
10946 exception, logged, etc.
10947
10948 Note that compare operators other than equal and unequal will still
10949 raise UnicodeDecodeError exceptions as they've always done.
10950
10951- Fix segfault when doing string formatting on subclasses of long.
10952
10953- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
10954 with new-style classes.
10955
10956- Fix bug related to __len__ functions returning negative values with
10957 classic classes.
10958
10959- Patch #1538606, Fix __index__() clipping. There were some problems
10960 discovered with the API and how integers that didn't fit into Py_ssize_t
10961 were handled. This patch attempts to provide enough alternatives
10962 to effectively use __index__.
10963
10964- Bug #1536021: __hash__ may now return long int; the final hash
10965 value is obtained by invoking hash on the long int.
10966
10967- Bug #1536786: buffer comparison could emit a RuntimeWarning.
10968
10969- Bug #1535165: fixed a segfault in input() and raw_input() when
10970 sys.stdin is closed.
10971
10972- On Windows, the PyErr_Warn function is now exported from
10973 the Python dll again.
10974
10975- Bug #1191458: tracing over for loops now produces a line event
10976 on each iteration. Fixing this problem required changing the .pyc
10977 magic number. This means that .pyc files generated before 2.5c1
10978 will be regenerated.
10979
10980- Bug #1333982: string/number constants were inappropriately stored
10981 in the byte code and co_consts even if they were not used, ie
10982 immediately popped off the stack.
10983
10984- Fixed a reference-counting problem in property().
10985
10986
10987Library
10988-------
10989
10990- Fix a bug in the ``compiler`` package that caused invalid code to be
10991 generated for generator expressions.
10992
10993- The distutils version has been changed to 2.5.0. The change to
10994 keep it programmatically in sync with the Python version running
10995 the code (introduced in 2.5b3) has been reverted. It will continue
10996 to be maintained manually as static string literal.
10997
10998- If the Python part of a ctypes callback function returns None,
10999 and this cannot be converted to the required C type, an exception is
11000 printed with PyErr_WriteUnraisable. Before this change, the C
11001 callback returned arbitrary values to the calling code.
11002
11003- The __repr__ method of a NULL ctypes.py_object() no longer raises
11004 an exception.
11005
11006- uuid.UUID now has a bytes_le attribute. This returns the UUID in
11007 little-endian byte order for Windows. In addition, uuid.py gained some
11008 workarounds for clocks with low resolution, to stop the code yielding
11009 duplicate UUIDs.
11010
11011- Patch #1540892: site.py Quitter() class attempts to close sys.stdin
11012 before raising SystemExit, allowing IDLE to honor quit() and exit().
11013
11014- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
11015
11016- Patch #1536071: trace.py should now find the full module name of a
11017 file correctly even on Windows.
11018
11019- logging's atexit hook now runs even if the rest of the module has
11020 already been cleaned up.
11021
11022- Bug #1112549, fix DoS attack on cgi.FieldStorage.
11023
11024- Bug #1531405, format_exception no longer raises an exception if
11025 str(exception) raised an exception.
11026
11027- Fix a bug in the ``compiler`` package that caused invalid code to be
11028 generated for nested functions.
11029
11030
11031Extension Modules
11032-----------------
11033
11034- Patch #1511317: don't crash on invalid hostname (alias) info.
11035
11036- Patch #1535500: fix segfault in BZ2File.writelines and make sure it
11037 raises the correct exceptions.
11038
11039- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
11040 '-no-stack-protector' compiler flag for OpenBSD has been removed.
11041
11042- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
11043 uses the _as_parameter_ attribute when objects are passed to foreign
11044 function calls. The ctypes version number was changed to 1.0.1.
11045
11046- Bug #1530559, struct.pack raises TypeError where it used to convert.
11047 Passing float arguments to struct.pack when integers are expected
11048 now triggers a DeprecationWarning.
11049
11050
11051Tests
11052-----
11053
11054- test_socketserver should now work on cygwin and not fail sporadically
11055 on other platforms.
11056
11057- test_mailbox should now work on cygwin versions 2006-08-10 and later.
11058
11059- Bug #1535182: really test the xreadlines() method of bz2 objects.
11060
11061- test_threading now skips testing alternate thread stack sizes on
11062 platforms that don't support changing thread stack size.
11063
11064
11065Documentation
11066-------------
11067
11068- Patch #1534922: unittest docs were corrected and enhanced.
11069
11070
11071Build
11072-----
11073
11074- Bug #1535502, build _hashlib on Windows, and use masm assembler
11075 code in OpenSSL.
11076
11077- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
11078
11079- Bug #1530448, ctypes build failure on Solaris 10 was fixed.
11080
11081
11082C API
11083-----
11084
11085- New API for Unicode rich comparisons: PyUnicode_RichCompare()
11086
11087- Bug #1069160. Internal correctness changes were made to
11088 ``PyThreadState_SetAsyncExc()``. A test case was added, and
11089 the documentation was changed to state that the return value
11090 is always 1 (normal) or 0 (if the specified thread wasn't found).
11091
11092
11093What's New in Python 2.5 beta 3?
11094================================
11095
11096*Release date: 03-AUG-2006*
11097
11098Core and builtins
11099-----------------
11100
11101- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
11102 returned a long (see PEP 353).
11103
11104- Bug #1515471: string.replace() accepts character buffers again.
11105
11106- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
11107 This provides the proper warning for struct.pack().
11108 PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
11109
11110- Patch #1531113: Fix augmented assignment with yield expressions.
11111 Also fix a SystemError when trying to assign to yield expressions.
11112
11113- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
11114 with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
11115 used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
11116 excessive filesystem operations during imports.
11117
11118- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
11119 operations on signed longs that are formally undefined by C.
11120 Unfortunately, at least one compiler now cares about that, so complicated
11121 the code to make that compiler happy again.
11122
11123- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
11124
11125- Patch #1232023: Stop including current directory in search
11126 path on Windows.
11127
11128- Fix some potential crashes found with failmalloc.
11129
11130- Fix warnings reported by Klocwork's static analysis tool.
11131
11132- Bug #1512814, Fix incorrect lineno's when code within a function
11133 had more than 255 blank lines.
11134
11135- Patch #1521179: Python now accepts the standard options ``--help`` and
11136 ``--version`` as well as ``/?`` on Windows.
11137
11138- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
11139 again. Fixing this problem required changing the .pyc magic number.
11140 This means that .pyc files generated before 2.5b3 will be regenerated.
11141
11142- Bug #1524317: Compiling Python ``--without-threads`` failed.
11143 The Python core compiles again, and, in a build without threads, the
11144 new ``sys._current_frames()`` returns a dictionary with one entry,
11145 mapping the faux "thread id" 0 to the current frame.
11146
11147- Bug #1525447: build on MacOS X on a case-sensitive filesystem.
11148
11149
11150Library
11151-------
11152
11153- Fix #1693149. Now you can pass several modules separated by
11154 comma to trace.py in the same --ignore-module option.
11155
11156- Correction of patch #1455898: In the mbcs decoder, set final=False
11157 for stream decoder, but final=True for the decode function.
11158
11159- os.urandom no longer masks unrelated exceptions like SystemExit or
11160 KeyboardInterrupt.
11161
11162- Bug #1525866: Don't copy directory stat times in
11163 shutil.copytree on Windows
11164
11165- Bug #1002398: The documentation for os.path.sameopenfile now correctly
11166 refers to file descriptors, not file objects.
11167
11168- The renaming of the xml package to xmlcore, and the import hackery done
11169 to make it appear at both names, has been removed. Bug #1511497,
11170 #1513611, and probably others.
11171
11172- Bug #1441397: The compiler module now recognizes module and function
11173 docstrings correctly as it did in Python 2.4.
11174
11175- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
11176 lost that tests are sorted by name before being run. This rarely
11177 matters for well-written tests, but can create baffling symptoms if
11178 side effects from one test to the next affect outcomes. ``DocTestFinder``
11179 has been changed to sort the list of tests it returns.
11180
11181- The distutils version has been changed to 2.5.0, and is now kept
11182 in sync with sys.version_info[:3].
11183
11184- Bug #978833: Really close underlying socket in _socketobject.close.
11185
11186- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
11187 title().
11188
11189- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
11190 to recursive calls and call it with the failing package name.
11191
11192- Bug #1525817: Don't truncate short lines in IDLE's tool tips.
11193
11194- Patch #1515343: Fix printing of deprecated string exceptions with a
11195 value in the traceback module.
11196
11197- Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
11198
11199- Patch #1524429: Use repr() instead of backticks in Tkinter again.
11200
11201- Bug #1520914: Change time.strftime() to accept a zero for any position in its
11202 argument tuple. For arguments where zero is illegal, the value is forced to
11203 the minimum value that is correct. This is to support an undocumented but
11204 common way people used to fill in inconsequential information in the time
11205 tuple pre-2.4.
11206
11207- Patch #1220874: Update the binhex module for Mach-O.
11208
11209- The email package has improved RFC 2231 support, specifically for
11210 recognizing the difference between encoded (name*0*=<blah>) and non-encoded
11211 (name*0=<blah>) parameter continuations. This may change the types of
11212 values returned from email.message.Message.get_param() and friends.
11213 Specifically in some cases where non-encoded continuations were used,
11214 get_param() used to return a 3-tuple of (None, None, string) whereas now it
11215 will just return the string (since non-encoded continuations don't have
11216 charset and language parts).
11217
11218 Also, whereas % values were decoded in all parameter continuations, they are
11219 now only decoded in encoded parameter parts.
11220
11221- Bug #1517990: IDLE keybindings on MacOS X now work correctly
11222
11223- Bug #1517996: IDLE now longer shows the default Tk menu when a
11224 path browser, class browser or debugger is the frontmost window on MacOS X
11225
11226- Patch #1520294: Support for getset and member descriptors in types.py,
11227 inspect.py, and pydoc.py. Specifically, this allows for querying the type
11228 of an object against these built-in types and more importantly, for getting
11229 their docstrings printed in the interactive interpreter's help() function.
11230
11231
11232Extension Modules
11233-----------------
11234
11235- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
11236 a socket operation on a socket with a timeout, the exception will be
11237 caught correctly. Previously, the exception was not caught.
11238
11239- Patch #1529514: The _ctypes extension is now compiled on more
11240 openbsd target platforms.
11241
11242- The ``__reduce__()`` method of the new ``collections.defaultdict`` had
11243 a memory leak, affecting pickles and deep copies.
11244
11245- Bug #1471938: Fix curses module build problem on Solaris 8; patch by
11246 Paul Eggert.
11247
11248- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
11249
11250- Patch #1521817: Index range checking on ctypes arrays containing
11251 exactly one element enabled again. This allows iterating over these
11252 arrays, without the need to check the array size before.
11253
11254- Bug #1521375: When the code in ctypes.util.find_library was
11255 run with root privileges, it could overwrite or delete
11256 /dev/null in certain cases; this is now fixed.
11257
11258- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
11259 default mode for loading shared libraries in ctypes.
11260
11261- Because of a misspelled preprocessor symbol, ctypes was always
11262 compiled without thread support; this is now fixed.
11263
11264- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
11265 methods now allow their database parameter to be None as the
11266 sleepycat API allows.
11267
11268- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
11269 bluetooth API compared with Linux and FreeBSD.
11270
11271Tests
11272-----
11273
11274- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
11275 how long the test file should take to play. Now accepts taking 2.93 secs
11276 (exact time) +/- 10% instead of the hard-coded 3.1 sec.
11277
11278- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
11279 ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
11280 run via ``regrtest.py``. Now they do.
11281
11282Build
11283-----
11284
11285- Bug #1439538: Drop usage of test -e in configure as it is not portable.
11286
11287Mac
11288---
11289
11290- PythonLauncher now works correctly when the path to the script contains
11291 characters that are treated specially by the shell (such as quotes).
11292
11293- Bug #1527397: PythonLauncher now launches scripts with the working directory
11294 set to the directory that contains the script instead of the user home
11295 directory. That latter was an implementation accident and not what users
11296 expect.
11297
11298
11299What's New in Python 2.5 beta 2?
11300================================
11301
11302*Release date: 11-JUL-2006*
11303
11304Core and builtins
11305-----------------
11306
11307- Bug #1441486: The literal representation of -(sys.maxint - 1)
Martin Panter7462b6492015-11-02 03:37:02 +000011308 again evaluates to an int object, not a long.
Christian Heimesc3f30c42008-02-22 16:37:40 +000011309
11310- Bug #1501934: The scope of global variables that are locally assigned
11311 using augmented assignment is now correctly determined.
11312
11313- Bug #927248: Recursive method-wrapper objects can now safely
11314 be released.
11315
11316- Bug #1417699: Reject locale-specific decimal point in float()
11317 and atof().
11318
11319- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
11320 omit a default "error" argument for NULL pointer. This allows
11321 the parser to take a codec from cjkcodecs again.
11322
11323- Bug #1519018: 'as' is now validated properly in import statements.
11324
11325- On 64 bit systems, int literals that use less than 64 bits are
11326 now ints rather than longs.
11327
11328- Bug #1512814, Fix incorrect lineno's when code at module scope
11329 started after line 256.
11330
11331- New function ``sys._current_frames()`` returns a dict mapping thread
11332 id to topmost thread stack frame. This is for expert use, and is
11333 especially useful for debugging application deadlocks. The functionality
11334 was previously available in Fazal Majid's ``threadframe`` extension
11335 module, but it wasn't possible to do this in a wholly threadsafe way from
11336 an extension.
11337
11338Library
11339-------
11340
11341- Bug #1257728: Mention Cygwin in distutils error message about a missing
11342 VS 2003.
11343
11344- Patch #1519566: Update turtle demo, make begin_fill idempotent.
11345
11346- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
11347 environment variable to be set in order to the SDK environment
11348 for finding the compiler, include files, etc.
11349
11350- Bug #1515998: Properly generate logical ids for files in bdist_msi.
11351
11352- warnings.py now ignores ImportWarning by default
11353
11354- string.Template() now correctly handles tuple-values. Previously,
11355 multi-value tuples would raise an exception and single-value tuples would
11356 be treated as the value they contain, instead.
11357
11358- Bug #822974: Honor timeout in telnetlib.{expect,read_until}
11359 even if some data are received.
11360
11361- Bug #1267547: Put proper recursive setup.py call into the
11362 spec file generated by bdist_rpm.
11363
11364- Bug #1514693: Update turtle's heading when switching between
11365 degrees and radians.
11366
11367- Reimplement turtle.circle using a polyline, to allow correct
11368 filling of arcs.
11369
11370- Bug #1514703: Only setup canvas window in turtle when the canvas
11371 is created.
11372
11373- Bug #1513223: .close() of a _socketobj now releases the underlying
11374 socket again, which then gets closed as it becomes unreferenced.
11375
11376- Bug #1504333: Make sgmllib support angle brackets in quoted
11377 attribute values.
11378
11379- Bug #853506: Fix IPv6 address parsing in unquoted attributes in
11380 sgmllib ('[' and ']' were not accepted).
11381
11382- Fix a bug in the turtle module's end_fill function.
11383
11384- Bug #1510580: The 'warnings' module improperly required that a Warning
11385 category be either a types.ClassType and a subclass of Warning. The proper
11386 check is just that it is a subclass with Warning as the documentation states.
11387
11388- The compiler module now correctly compiles the new try-except-finally
11389 statement (bug #1509132).
11390
11391- The wsgiref package is now installed properly on Unix.
11392
11393- A bug was fixed in logging.config.fileConfig() which caused a crash on
11394 shutdown when fileConfig() was called multiple times.
11395
11396- The sqlite3 module did cut off data from the SQLite database at the first
11397 null character before sending it to a custom converter. This has been fixed
11398 now.
11399
11400Extension Modules
11401-----------------
11402
11403- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
11404 means that select() on sockets > FD_SETSIZE (typically 1024) work again.
11405 The patch makes sockets use poll() internally where available.
11406
11407- Assigning None to pointer type fields in ctypes structures possible
11408 overwrote the wrong fields, this is fixed now.
11409
11410- Fixed a segfault in _ctypes when ctypes.wintypes were imported
11411 on non-Windows platforms.
11412
11413- Bug #1518190: The ctypes.c_void_p constructor now accepts any
11414 integer or long, without range checking.
11415
11416- Patch #1517790: It is now possible to use custom objects in the ctypes
11417 foreign function argtypes sequence as long as they provide a from_param
11418 method, no longer is it required that the object is a ctypes type.
11419
11420- The '_ctypes' extension module now works when Python is configured
11421 with the --without-threads option.
11422
11423- Bug #1513646: os.access on Windows now correctly determines write
11424 access, again.
11425
11426- Bug #1512695: cPickle.loads could crash if it was interrupted with
11427 a KeyboardInterrupt.
11428
11429- Bug #1296433: parsing XML with a non-default encoding and
11430 a CharacterDataHandler could crash the interpreter in pyexpat.
11431
11432- Patch #1516912: improve Modules support for OpenVMS.
11433
11434Build
11435-----
11436
11437- Automate Windows build process for the Win64 SSL module.
11438
11439- 'configure' now detects the zlib library the same way as distutils.
11440 Previously, the slight difference could cause compilation errors of the
11441 'zlib' module on systems with more than one version of zlib.
11442
11443- The MSI compileall step was fixed to also support a TARGETDIR
11444 with spaces in it.
11445
11446- Bug #1517388: sqlite3.dll is now installed on Windows independent
11447 of Tcl/Tk.
11448
11449- Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
11450 trying to be installed even though it's empty.
11451
11452Tests
11453-----
11454
11455- Call os.waitpid() at the end of tests that spawn child processes in order
11456 to minimize resources (zombies).
11457
11458Documentation
11459-------------
11460
11461- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
11462 documentation for the warnings module.
11463
11464- Patch #1509163: MS Toolkit Compiler no longer available.
11465
11466- Patch #1504046: Add documentation for xml.etree.
11467
11468
11469What's New in Python 2.5 beta 1?
11470================================
11471
11472*Release date: 20-JUN-2006*
11473
11474Core and builtins
11475-----------------
11476
11477- Patch #1507676: Error messages returned by invalid abstract object operations
11478 (such as iterating over an integer) have been improved and now include the
11479 type of the offending object to help with debugging.
11480
11481- Bug #992017: A classic class that defined a __coerce__() method that returned
11482 its arguments swapped would infinitely recurse and segfault the interpreter.
11483
11484- Fix the socket tests so they can be run concurrently.
11485
11486- Removed 5 integers from C frame objects (PyFrameObject).
11487 f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
11488
11489- Bug #532646: object.__call__() will continue looking for the __call__
11490 attribute on objects until one without one is found. This leads to recursion
11491 when you take a class and set its __call__ attribute to an instance of the
11492 class. Originally fixed for classic classes, but this fix is for new-style.
11493 Removes the infinite_rec_3 crasher.
11494
11495- The string and unicode methods startswith() and endswith() now accept
11496 a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
11497
11498- Buffer objects, at the C level, never used the char buffer
11499 implementation even when the char buffer for the wrapped object was
11500 explicitly requested (originally returned the read or write buffer).
11501 Now a TypeError is raised if the char buffer is not present but is
11502 requested.
11503
11504- Patch #1346214: Statements like "if 0: suite" are now again optimized
11505 away like they were in Python 2.4.
11506
11507- Builtin exceptions are now full-blown new-style classes instead of
11508 instances pretending to be classes, which speeds up exception handling
11509 by about 80% in comparison to 2.5a2.
11510
11511- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
11512 Unicode 4.1.
11513
11514- Patch #921466: sys.path_importer_cache is now used to cache valid and
11515 invalid file paths for the built-in import machinery which leads to
11516 fewer open calls on startup.
11517
11518- Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
11519 of-2 bases. The largest speedup is for inputs with about 1000 decimal
11520 digits. Conversion from non-power-of-2 bases remains quadratic-time in
11521 the number of input digits (it was and remains linear-time for bases
11522 2, 4, 8, 16 and 32).
11523
11524- Bug #1334662: ``int(string, base)`` could deliver a wrong answer
11525 when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
11526 an integer close to ``sys.maxint``. This was repaired by patch
11527 #1335972, which also gives a nice speedup.
11528
11529- Patch #1337051: reduced size of frame objects.
11530
11531- PyErr_NewException now accepts a tuple of base classes as its
11532 "base" parameter.
11533
11534- Patch #876206: function call speedup by retaining allocated frame
11535 objects.
11536
11537- Bug #1462152: file() now checks more thoroughly for invalid mode
11538 strings and removes a possible "U" before passing the mode to the
11539 C library function.
11540
11541- Patch #1488312, Fix memory alignment problem on SPARC in unicode
11542
11543- Bug #1487966: Fix SystemError with conditional expression in assignment
11544
11545- WindowsError now has two error code attributes: errno, which carries
11546 the error values from errno.h, and winerror, which carries the error
11547 values from winerror.h. Previous versions put the winerror.h values
11548 (from GetLastError()) into the errno attribute.
11549
11550- Patch #1475845: Raise IndentationError for unexpected indent.
11551
11552- Patch #1479181: split open() and file() from being aliases for each other.
11553
11554- Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
11555 methods were always silently ignored by dictionaries when comparing keys.
11556 They are now passed through (except when using the C API function
11557 ``PyDict_GetItem()``, whose semantics did not change).
11558
11559- Bug #1456209: In some obscure cases it was possible for a class with a
11560 custom ``__eq__()`` method to confuse dict internals when class instances
11561 were used as a dict's keys and the ``__eq__()`` method mutated the dict.
11562 No, you don't have any code that did this ;-)
11563
11564Extension Modules
11565-----------------
11566
11567- Bug #1295808: expat symbols should be namespaced in pyexpat
11568
11569- Patch #1462338: Upgrade pyexpat to expat 2.0.0
11570
11571- Change binascii.hexlify to accept a read-only buffer instead of only a char
11572 buffer and actually follow its documentation.
11573
11574- Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
11575
11576- Patch #1478788 (modified version): The functional extension module has
11577 been renamed to _functools and a functools Python wrapper module added.
11578 This provides a home for additional function related utilities that are
11579 not specifically about functional programming. See PEP 309.
11580
11581- Patch #1493701: performance enhancements for struct module.
11582
11583- Patch #1490224: time.altzone is now set correctly on Cygwin.
11584
11585- Patch #1435422: zlib's compress and decompress objects now have a
11586 copy() method.
11587
11588- Patch #1454481: thread stack size is now tunable at runtime for thread
11589 enabled builds on Windows and systems with Posix threads support.
11590
11591- On Win32, os.listdir now supports arbitrarily-long Unicode path names
11592 (up to the system limit of 32K characters).
11593
11594- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
11595 As a result, these functions now raise WindowsError instead of OSError.
11596
11597- ``time.clock()`` on Win64 should use the high-performance Windows
11598 ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
11599 Windows platforms).
11600
11601- Calling Tk_Init twice is refused if the first call failed as that
11602 may deadlock.
11603
11604- bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
11605 accept it without potentially using an uninitialized pointer.
11606
11607- bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
11608 assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
11609 patch numbers 1494885 and 1494902]
11610
11611- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
11612 [pybsddb project SF patch number 1466734]
11613
11614- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
11615 parameter is supplied. [SF pybsddb bug #1477863]
11616
11617- bsddb: the __len__ method of a DB object has been fixed to return correct
11618 results. It could previously incorrectly return 0 in some cases.
11619 Fixes SF bug 1493322 (pybsddb bug 1184012).
11620
11621- bsddb: the bsddb.dbtables Modify method now raises the proper error and
11622 aborts the db transaction safely when a modifier callback fails.
11623 Fixes SF python patch/bug #1408584.
11624
11625- bsddb: multithreaded DB access using the simple bsddb module interface
11626 now works reliably. It has been updated to use automatic BerkeleyDB
11627 deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
11628 database calls that would previously deadlock. [SF python bug #775414]
11629
11630- Patch #1446489: add support for the ZIP64 extensions to zipfile.
11631
11632- Patch #1506645: add Python wrappers for the curses functions
11633 is_term_resized, resize_term and resizeterm.
11634
11635Library
11636-------
11637
11638- Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
11639 functions.
11640
11641- Patch #812986: Update turtle output even if not tracing.
11642
11643- Patch #1494750: Destroy master after deleting children in
11644 Tkinter.BaseWidget.
11645
11646- Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
11647
11648- Patch #763580: Add name and value arguments to Tkinter variable
11649 classes.
11650
11651- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
11652 mime.types file for determining MIME types.
11653
11654- Bug #1339007: Shelf objects now don't raise an exception in their
11655 __del__ method when initialization failed.
11656
11657- Patch #1455898: The MBCS codec now supports the incremental mode for
11658 double-byte encodings.
11659
11660- ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
11661 guarantee that adjacent triples in the return list always describe
11662 non-adjacent blocks. Previously, a pair of matching blocks could end
11663 up being described by multiple adjacent triples that formed a partition
11664 of the matching pair.
11665
11666- Bug #1498146: fix optparse to handle Unicode strings in option help,
11667 description, and epilog.
11668
11669- Bug #1366250: minor optparse documentation error.
11670
11671- Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
11672 clarify docs.
11673
11674- The wsgiref package has been added to the standard library.
11675
11676- The functions update_wrapper() and wraps() have been added to the functools
11677 module. These make it easier to copy relevant metadata from the original
11678 function when writing wrapper functions.
11679
11680- The optional ``isprivate`` argument to ``doctest.testmod()``, and the
11681 ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
11682
11683- Patch #1359618: Speed up charmap encoder by using a trie structure
11684 for lookup.
11685
11686- The functions in the ``pprint`` module now sort dictionaries by key
11687 before computing the display. Before 2.5, ``pprint`` sorted a dictionary
11688 if and only if its display required more than one line, although that
11689 wasn't documented. The new behavior increases predictability; e.g.,
11690 using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
11691
11692- Patch #1497027: try HTTP digest auth before basic auth in urllib2
11693 (thanks for J. J. Lee).
11694
11695- Patch #1496206: improve urllib2 handling of passwords with respect to
11696 default HTTP and HTTPS ports.
11697
11698- Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
11699
11700- Patch #1281707: speed up gzip.readline.
11701
11702- Patch #1180296: Two new functions were added to the locale module:
11703 format_string() to get the effect of "format % items" but locale-aware,
11704 and currency() to format a monetary number with currency sign.
11705
11706- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
11707 and several features added, such as speed and geometry control.
11708
11709- Patch #1488881: add support for external file objects in bz2 compressed
11710 tarfiles.
11711
11712- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
11713 stdout arguments, making it possible to redirect input and output
11714 for remote debugging.
11715
11716- Patch #1484695: Update the tarfile module to version 0.8. This fixes
11717 a couple of issues, notably handling of long file names using the
11718 GNU LONGNAME extension.
11719
11720- Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
11721 new flag when ``name`` is already the name of an option flag.
11722
11723- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
11724 package.
11725
11726- Patch #1472854: make the rlcompleter.Completer class usable on non-
11727 UNIX platforms.
11728
11729- Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
11730
11731- Bug #1472827: correctly escape newlines and tabs in attribute values in
11732 the saxutils.XMLGenerator class.
11733
11734
11735Build
11736-----
11737
11738- Bug #1502728: Correctly link against librt library on HP-UX.
11739
11740- OpenBSD 3.9 is supported now.
11741
11742- Patch #1492356: Port to Windows CE.
11743
11744- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
11745
11746- Patch #1471883: Add --enable-universalsdk.
11747
11748C API
11749-----
11750
11751Tests
11752-----
11753
11754Tools
11755-----
11756
11757Documentation
11758-------------
11759
11760
11761
11762What's New in Python 2.5 alpha 2?
11763=================================
11764
11765*Release date: 27-APR-2006*
11766
11767Core and builtins
11768-----------------
11769
11770- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
11771 by converting these apis from macros into exported functions again:
11772
11773 PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
11774 PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
11775 PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
11776 PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
11777 PyRun_String Py_CompileString
11778
11779- Under COUNT_ALLOCS, types are not necessarily immortal anymore.
11780
11781- All uses of PyStructSequence_InitType have been changed to initialize
11782 the type objects only once, even if the interpreter is initialized
11783 multiple times.
11784
11785- Bug #1454485, array.array('u') could crash the interpreter. This was
11786 due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
11787 to unicode when it didn't make sense. 'u#' now requires a unicode string.
11788
11789- Py_UNICODE is unsigned. It was always documented as unsigned, but
11790 due to a bug had a signed value in previous versions.
11791
11792- Patch #837242: ``id()`` of any Python object always gives a positive
11793 number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
11794 ``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
11795 never been correct to implement a ``__hash()__`` method that returns the
11796 ``id()`` of an object:
11797
11798 def __hash__(self):
11799 return id(self) # WRONG
11800
11801 because a hash result must be a (short) Python int but it was always
11802 possible for ``id()`` to return a Python long. However, because ``id()``
11803 could return negative values before, on a 32-bit box an ``id()`` result
11804 was always usable as a hash value before this patch. That's no longer
11805 necessarily so.
11806
11807- Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
11808 to load extension modules and now provides the dl module. As a result,
11809 sys.setdlopenflags() now works correctly on these systems. (SF patch
11810 #1454844)
11811
11812- Patch #1463867: enhanced garbage collection to allow cleanup of cycles
11813 involving generators that have paused outside of any ``try`` or ``with``
11814 blocks. (In 2.5a1, a paused generator that was part of a reference
11815 cycle could not be garbage collected, regardless of whether it was
11816 paused in a ``try`` or ``with`` block.)
11817
11818Extension Modules
11819-----------------
11820
11821- Patch #1191065: Fix preprocessor problems on systems where recvfrom
11822 is a macro.
11823
11824- Bug #1467952: os.listdir() now correctly raises an error if readdir()
11825 fails with an error condition.
11826
11827- Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
11828
11829- Bug #1117761: bsddb.*open() no longer raises an exception when using
11830 the cachesize parameter.
11831
11832- Bug #1149413: bsddb.*open() no longer raises an exception when using
11833 a temporary db (file=None) with the 'n' flag to truncate on open.
11834
11835- Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
11836 as older versions cause excessive test failures.
11837
11838- Patch #1062014: AF_UNIX sockets under Linux have a special
11839 abstract namespace that is now fully supported.
11840
11841Library
11842-------
11843
11844- Bug #1223937: subprocess.CalledProcessError reports the exit status
11845 of the process using the returncode attribute, instead of
11846 abusing errno.
11847
11848- Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
11849 a doctest to be skipped (the code is not run, and the expected output
11850 or exception is ignored).
11851
11852- Fixed contextlib.nested to cope with exceptions being raised and
11853 caught inside exit handlers.
11854
11855- Updated optparse module to Optik 1.5.1 (allow numeric constants in
11856 hex, octal, or binary; add ``append_const`` action; keep going if
11857 gettext cannot be imported; added ``OptionParser.destroy()`` method;
11858 added ``epilog`` for better help generation).
11859
11860- Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
11861 called from a thread spawned as a side effect of importing a module.
11862
11863- The pydoc module now supports documenting packages contained in
11864 .zip or .egg files.
11865
11866- The pkgutil module now has several new utility functions, such
11867 as ``walk_packages()`` to support working with packages that are either
11868 in the filesystem or zip files.
11869
11870- The mailbox module can now modify and delete messages from
11871 mailboxes, in addition to simply reading them. Thanks to Gregory
11872 K. Johnson for writing the code, and to the 2005 Google Summer of
11873 Code for funding his work.
11874
11875- The ``__del__`` method of class ``local`` in module ``_threading_local``
11876 returned before accomplishing any of its intended cleanup.
11877
11878- Patch #790710: Add breakpoint command lists in pdb.
11879
11880- Patch #1063914: Add Tkinter.Misc.clipboard_get().
11881
11882- Patch #1191700: Adjust column alignment in bdb breakpoint lists.
11883
11884- SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
11885 Windows. Bug #1469163.
11886
11887- The warnings, linecache, inspect, traceback, site, and doctest modules
11888 were updated to work correctly with modules imported from zipfiles or
11889 via other PEP 302 __loader__ objects.
11890
11891- Patch #1467770: Reduce usage of subprocess._active to processes which
11892 the application hasn't waited on.
11893
11894- Patch #1462222: Fix Tix.Grid.
11895
11896- Fix exception when doing glob.glob('anything*/')
11897
11898- The pstats.Stats class accepts an optional stream keyword argument to
11899 direct output to an alternate file-like object.
11900
11901Build
11902-----
11903
11904- The Makefile now has a reindent target, which runs reindent.py on
11905 the library.
11906
11907- Patch #1470875: Building Python with MS Free Compiler
11908
11909- Patch #1161914: Add a python-config script.
11910
11911- Patch #1324762:Remove ccpython.cc; replace --with-cxx with
11912 --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
11913 specified. (Can be overridden by explicitly setting LINKCC.) Decouple
11914 CXX from --with-cxx-main, see description in README.
11915
11916- Patch #1429775: Link extension modules with the shared libpython.
11917
11918- Fixed a libffi build problem on MIPS systems.
11919
11920- ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
11921 now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
11922 and "%zu" for unsigned integers of type ``size_t``.
11923
11924Tests
11925-----
11926
11927- test_contextlib now checks contextlib.nested can cope with exceptions
11928 being raised and caught inside exit handlers.
11929
11930- test_cmd_line now checks operation of the -m and -c command switches
11931
11932- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
11933 it separately and by hand. It also wasn't cleaning up its changes to
11934 the current Decimal context.
11935
11936- regrtest.py now has a -M option to run tests that test the new limits of
11937 containers, on 64-bit architectures. Running these tests is only sensible
11938 on 64-bit machines with more than two gigabytes of memory. The argument
11939 passed is the maximum amount of memory for the tests to use.
11940
11941Tools
11942-----
11943
11944- Added the Python benchmark suite pybench to the Tools/ directory;
11945 contributed by Marc-Andre Lemburg.
11946
11947Documentation
11948-------------
11949
11950- Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
11951
11952- PEP 343: Added Context Types section to the library reference
11953 and attempted to bring other PEP 343 related documentation into
11954 line with the implementation and/or python-dev discussions.
11955
11956- Bug #1337990: clarified that ``doctest`` does not support examples
11957 requiring both expected output and an exception.
11958
11959
11960What's New in Python 2.5 alpha 1?
11961=================================
11962
11963*Release date: 05-APR-2006*
11964
11965Core and builtins
11966-----------------
11967
11968- PEP 338: -m command line switch now delegates to runpy.run_module
11969 allowing it to support modules in packages and zipfiles
11970
11971- On Windows, .DLL is not an accepted file name extension for
11972 extension modules anymore; extensions are only found if they
11973 end in .PYD.
11974
11975- Bug #1421664: sys.stderr.encoding is now set to the same value as
11976 sys.stdout.encoding.
11977
11978- __import__ accepts keyword arguments.
11979
11980- Patch #1460496: round() now accepts keyword arguments.
11981
11982- Fixed bug #1459029 - unicode reprs were double-escaped.
11983
11984- Patch #1396919: The system scope threads are reenabled on FreeBSD
11985 5.4 and later versions.
11986
11987- Bug #1115379: Compiling a Unicode string with an encoding declaration
11988 now gives a SyntaxError.
11989
11990- Previously, Python code had no easy way to access the contents of a
11991 cell object. Now, a ``cell_contents`` attribute has been added
11992 (closes patch #1170323).
11993
11994- Patch #1123430: Python's small-object allocator now returns an arena to
11995 the system ``free()`` when all memory within an arena becomes unused
11996 again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
11997 freed. Some applications will see a drop in virtual memory size now,
11998 especially long-running applications that, from time to time, temporarily
11999 use a large number of small objects. Note that when Python returns an
12000 arena to the platform C's ``free()``, there's no guarantee that the
12001 platform C library will in turn return that memory to the operating system.
12002 The effect of the patch is to stop making that impossible, and in tests it
12003 appears to be effective at least on Microsoft C and gcc-based systems.
12004 Thanks to Evan Jones for hard work and patience.
12005
12006- Patch #1434038: property() now uses the getter's docstring if there is
12007 no "doc" argument given. This makes it possible to legitimately use
12008 property() as a decorator to produce a read-only property.
12009
12010- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
12011 nb_index slot to the PyNumberMethods struct. The slot is consulted instead
12012 of requiring an int or long in slicing and a few other contexts, enabling
12013 other objects (e.g. Numeric Python's integers) to be used as slice indices.
12014
12015- Fixed various bugs reported by Coverity's Prevent tool.
12016
12017- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
12018 new exception base class, BaseException, which has a new message attribute.
12019 KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
12020 Raising a string exception now raises a DeprecationWarning.
12021
12022- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
12023 explicitly relative, using 'from .module import name' to mean 'from the same
12024 package as this module is in. Imports without dots still default to the
12025 old relative-then-absolute, unless 'from __future__ import
12026 absolute_import' is used.
12027
12028- Properly check if 'warnings' raises an exception (usually when a filter set
12029 to "error" is triggered) when raising a warning for raising string
12030 exceptions.
12031
12032- CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
12033 The name was removed from Include/code.h.
12034
12035- PEP 308: conditional expressions were added: (x if cond else y).
12036
12037- Patch 1433928:
12038 - The copy module now "copies" function objects (as atomic objects).
12039 - dict.__getitem__ now looks for a __missing__ hook before raising
12040 KeyError.
12041
12042- PEP 343: with statement implemented. Needs ``from __future__ import
12043 with_statement``. Use of 'with' as a variable will generate a warning.
12044 Use of 'as' as a variable will also generate a warning (unless it's
12045 part of an import statement).
12046 The following objects have __context__ methods:
12047 - The built-in file type.
12048 - The thread.LockType type.
12049 - The following types defined by the threading module:
12050 Lock, RLock, Condition, Semaphore, BoundedSemaphore.
12051 - The decimal.Context class.
12052
12053- Fix the encodings package codec search function to only search
12054 inside its own package. Fixes problem reported in patch #1433198.
12055
12056 Note: Codec packages should implement and register their own
12057 codec search function. PEP 100 has the details.
12058
12059- PEP 353: Using ``Py_ssize_t`` as the index type.
12060
12061- ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
12062 info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
12063 now allow Python to make use of memory blocks exceeding 2**32 bytes for
12064 some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
12065 to 4-byte allocations before.
12066
12067- Patch #1400181, fix unicode string formatting to not use the locale.
12068 This is how string objects work. u'%f' could use , instead of .
12069 for the decimal point. Now both strings and unicode always use periods.
12070
12071- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
12072 configure would break checking curses.h.
12073
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012074- Bug #959576: The pwd module is now built in. This allows Python to be
Christian Heimesc3f30c42008-02-22 16:37:40 +000012075 built on UNIX platforms without $HOME set.
12076
12077- Bug #1072182, fix some potential problems if characters are signed.
12078
12079- Bug #889500, fix line number on SyntaxWarning for global declarations.
12080
12081- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
12082
12083- Support for converting hex strings to floats no longer works.
12084 This was not portable. float('0x3') now raises a ValueError.
12085
12086- Patch #1382163: Expose Subversion revision number to Python. New C API
12087 function Py_GetBuildNumber(). New attribute sys.subversion. Build number
12088 is now displayed in interactive prompt banner.
12089
12090- Implementation of PEP 341 - Unification of try/except and try/finally.
12091 "except" clauses can now be written together with a "finally" clause in
12092 one try statement instead of two nested ones. Patch #1355913.
12093
12094- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
12095 now encodes backslash correctly.
12096
12097- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
12098
12099- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
12100 and long longs.
12101
12102- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
12103 It was possible for dlerror() to return a NULL pointer, so
12104 it will now use a default error message in this case.
12105
12106- Replaced most Unicode charmap codecs with new ones using the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012107 new Unicode translate string feature in the built-in charmap
Christian Heimesc3f30c42008-02-22 16:37:40 +000012108 codec; the codecs were created from the mapping tables available
12109 at ftp.unicode.org and contain a few updates (e.g. the Mac OS
12110 encodings now include a mapping for the Apple logo)
12111
12112- Added a few more codecs for Mac OS encodings
12113
12114- Sped up some Unicode operations.
12115
12116- A new AST parser implementation was completed. The abstract
12117 syntax tree is available for read-only (non-compile) access
12118 to Python code; an _ast module was added.
12119
12120- SF bug #1167751: fix incorrect code being produced for generator expressions.
12121 The following code now raises a SyntaxError: foo(a = i for i in range(10))
12122
12123- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
12124
12125- SF Bug #887946: fix segfault when redirecting stdin from a directory.
12126 Provide a warning when a directory is passed on the command line.
12127
12128- Fix segfault with invalid coding.
12129
12130- SF bug #772896: unknown encoding results in MemoryError.
12131
12132- All iterators now have a Boolean value of True. Formerly, some iterators
12133 supported a __len__() method which evaluated to False when the iterator
12134 was empty.
12135
12136- On 64-bit platforms, when __len__() returns a value that cannot be
12137 represented as a C int, raise OverflowError.
12138
12139- test__locale is skipped on OS X < 10.4 (only partial locale support is
12140 present).
12141
12142- SF bug #893549: parsing keyword arguments was broken with a few format
12143 codes.
12144
12145- Changes donated by Elemental Security to make it work on AIX 5.3
12146 with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
12147 bug #105470: test_pwd fails on 64bit system (Opteron).
12148
12149- Changes donated by Elemental Security to make it work on HP-UX 11 on
12150 Itanium2 with HP's 64-bit compiler (SF patch #1225212).
12151
12152- Disallow keyword arguments for type constructors that don't use them
12153 (fixes bug #1119418).
12154
12155- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
12156
12157- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
12158 exceptions that cause a function to exit.
12159
12160- The implementation of set() and frozenset() was revised to use its
12161 own internal data structure. Memory consumption is reduced by 1/3
12162 and there are modest speed-ups as well. The API is unchanged.
12163
12164- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
12165
12166- SF bug #1229429: PyObject_CallMethod failed to decrement some
12167 reference counts in some error exit cases.
12168
12169- SF bug #1185883: Python's small-object memory allocator took over
12170 a block managed by the platform C library whenever a realloc specified
12171 a small new size. However, there's no portable way to know then how
12172 much of the address space following the pointer is valid, so there's no
12173 portable way to copy data from the C-managed block into Python's
12174 small-object space without risking a memory fault. Python's small-object
12175 realloc now leaves such blocks under the control of the platform C
12176 realloc.
12177
12178- SF bug #1232517: An overflow error was not detected properly when
12179 attempting to convert a large float to an int in os.utime().
12180
12181- SF bug #1224347: hex longs now print with lowercase letters just
12182 like their int counterparts.
12183
12184- SF bug #1163563: the original fix for bug #1010677 ("thread Module
12185 Breaks PyGILState_Ensure()") broke badly in the case of multiple
12186 interpreter states; back out that fix and do a better job (see
12187 http://mail.python.org/pipermail/python-dev/2005-June/054258.html
12188 for a longer write-up of the problem).
12189
12190- SF patch #1180995: marshal now uses a binary format by default when
12191 serializing floats.
12192
12193- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
12194 the routines that promise to produce IEEE 754 binary representations
12195 of floats now simply copy bytes around.
12196
12197- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
12198 278.
12199
12200- patch #1109424: int, long, float, complex, and unicode now check for the
12201 proper magic slot for type conversions when subclassed. Previously the
12202 magic slot was ignored during conversion. Semantics now match the way
12203 subclasses of str always behaved. int/long/float, conversion of an instance
12204 to the base class has been moved to the proper nb_* magic slot and out of
12205 PyNumber_*().
Antoine Pitroufbd4f802012-08-11 16:51:50 +020012206 Thanks Walter Dörwald.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012207
12208- Descriptors defined in C with a PyGetSetDef structure, where the setter is
12209 NULL, now raise an AttributeError when attempting to set or delete the
12210 attribute. Previously a TypeError was raised, but this was inconsistent
12211 with the equivalent pure-Python implementation.
12212
12213- It is now safe to call PyGILState_Release() before
12214 PyEval_InitThreads() (note that if there is reason to believe there
12215 are multiple threads around you still must call PyEval_InitThreads()
12216 before using the Python API; this fix is for extension modules that
12217 have no way of knowing if Python is multi-threaded yet).
12218
12219- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
12220 disabled caused a crash.
12221
12222- Bug #1165306: instancemethod_new allowed the creation of a method
12223 with im_class == im_self == NULL, which caused a crash when called.
12224
12225- Move exception finalisation later in the shutdown process - this
12226 fixes the crash seen in bug #1165761
12227
12228- Added two new builtins, any() and all().
12229
12230- Defining a class with empty parentheses is now allowed
12231 (e.g., ``class C(): pass`` is no longer a syntax error).
12232 Patch #1176012 added support to the 'parser' module and 'compiler' package
12233 (thanks to logistix for that added support).
12234
12235- Patch #1115086: Support PY_LONGLONG in structmember.
12236
12237- Bug #1155938: new style classes did not check that __init__() was
12238 returning None.
12239
12240- Patch #802188: Report characters after line continuation character
12241 ('\') with a specific error message.
12242
12243- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
12244
12245- Bug #1124295: the __name__ attribute of file objects was
12246 inadvertently made inaccessible in restricted mode.
12247
12248- Bug #1074011: closing sys.std{out,err} now causes a flush() and
12249 an ferror() call.
12250
12251- min() and max() now support key= arguments with the same meaning as in
12252 list.sort().
12253
12254- The peephole optimizer now performs simple constant folding in expressions:
12255 (2+3) --> (5).
12256
12257- set and frozenset objects can now be marshalled. SF #1098985.
12258
12259- Bug #1077106: Poor argument checking could cause memory corruption
12260 in calls to os.read().
12261
12262- The parser did not complain about future statements in illegal
12263 positions. It once again reports a syntax error if a future
12264 statement occurs after anything other than a doc string.
12265
12266- Change the %s format specifier for str objects so that it returns a
12267 unicode instance if the argument is not an instance of basestring and
12268 calling __str__ on the argument returns a unicode instance.
12269
12270- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
12271 current thread state when the auto-GIL-state machinery knows about
12272 it (since the thread state is being deleted, continuing to remember it
12273 can't help, but can hurt if another thread happens to get created with
12274 the same thread id).
12275
12276Extension Modules
12277-----------------
12278
12279- Patch #1380952: fix SSL objects timing out on consecutive read()s
12280
12281- Patch #1309579: wait3 and wait4 were added to the posix module.
12282
12283- Patch #1231053: The audioop module now supports encoding/decoding of alaw.
12284 In addition, the existing ulaw code was updated.
12285
12286- RFE #567972: Socket objects' family, type and proto properties are
12287 now exposed via new attributes.
12288
12289- Everything under lib-old was removed. This includes the following modules:
12290 Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
12291 lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
12292 util, whatsound, whrandom, zmod
12293
12294- The following modules were removed: regsub, reconvert, regex, regex_syntax.
12295
12296- re and sre were swapped, so help(re) provides full help. importing sre
12297 is deprecated. The undocumented re.engine variable no longer exists.
12298
12299- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
12300 SS2 (single-shift 2) escape sequences correctly.
12301
12302- The unicodedata module was updated to the 4.1 version of the Unicode
12303 database. The 3.2 version is still available as unicodedata.db_3_2_0
12304 for applications that require this specific version (such as IDNA).
12305
12306- The timing module is no longer built by default. It was deprecated
12307 in PEP 4 in Python 2.0 or earlier.
12308
12309- Patch 1433928: Added a new type, defaultdict, to the collections module.
12310 This uses the new __missing__ hook behavior added to dict (see above).
12311
12312- Bug #854823: socketmodule now builds on Sun platforms even when
12313 INET_ADDRSTRLEN is not defined.
12314
12315- Patch #1393157: os.startfile() now has an optional argument to specify
12316 a "command verb" to invoke on the file.
12317
12318- Bug #876637, prevent stack corruption when socket descriptor
12319 is larger than FD_SETSIZE.
12320
12321- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
12322 mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
12323 mmap.mmap(0, size) should not be used on Windows for anonymous memory.
12324
12325- Patch #1422385: The nis module now supports access to domains other
12326 than the system default domain.
12327
12328- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
12329 are reported, the limit on path name lengths is removed, and stat reports
12330 WindowsError now (instead of OSError).
12331
12332- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
12333
12334- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
12335 before the env.
12336
12337- Patch #1103116: Basic AF_NETLINK support.
12338
12339- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
12340
12341- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
12342 Also fix ungetmouse() which did not accept arguments properly.
12343 The code now conforms to the documented signature.
12344
12345- Bug #1400115, Fix segfault when calling curses.panel.userptr()
12346 without prior setting of the userptr.
12347
12348- Fix 64-bit problems in bsddb.
12349
12350- Patch #1365916: fix some unsafe 64-bit mmap methods.
12351
12352- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
12353 problem on AIX.
12354
12355- Bug #869197: os.setgroups rejects long integer arguments
12356
12357- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
12358
12359- Bug #1344508, Fix UNIX mmap leaking file descriptors
12360
12361- Patch #1338314, Bug #1336623: fix tarfile so it can extract
12362 REGTYPE directories from tarfiles written by old programs.
12363
12364- Patch #1407992, fixes broken bsddb module db associate when using
12365 BerkeleyDB 3.3, 4.0 or 4.1.
12366
12367- Get bsddb module to build with BerkeleyDB version 4.4
12368
12369- Get bsddb module to build with BerkeleyDB version 3.2
12370
12371- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
12372 but Python incorrectly assumes it is in UTF-8 format
12373
12374- Fix parse errors in the readline module when compiling without threads.
12375
12376- Patch #1288833: Removed thread lock from socket.getaddrinfo on
12377 FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
12378
12379- Patches #1298449 and #1298499: Add some missing checks for error
12380 returns in cStringIO.c.
12381
12382- Patch #1297028: fix segfault if call type on MultibyteCodec,
12383 MultibyteStreamReader, or MultibyteStreamWriter
12384
12385- Fix memory leak in posix.access().
12386
12387- Patch #1213831: Fix typo in unicodedata._getcode.
12388
12389- Bug #1007046: os.startfile() did not accept unicode strings encoded in
12390 the file system encoding.
12391
12392- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
12393 platforms that don't have inet_aton().
12394
12395- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
12396
12397- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
12398 line without newlines.
12399
12400- Bug #728515: mmap.resize() now resizes the file on Unix as it did
12401 on Windows.
12402
12403- Patch #1180695: Add nanosecond stat resolution, and st_gen,
12404 st_birthtime for FreeBSD.
12405
12406- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
12407 the request code argument, which results in more C-like behaviour
12408 for large or negative values.
12409
12410- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
12411 implementation treated all integer values except 1 as false.
12412
12413- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
12414
Serhiy Storchakad65c9492015-11-02 14:10:23 +020012415- Patch #1212117: os.stat().st_flags is now accessible as an attribute
Christian Heimesc3f30c42008-02-22 16:37:40 +000012416 if available on the platform.
12417
12418- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
12419 available on the platform.
12420
12421- Bug #1166660: The readline module could segfault if hook functions
12422 were set in a different thread than that which called readline.
12423
12424- collections.deque objects now support a remove() method.
12425
12426- operator.itemgetter() and operator.attrgetter() now support retrieving
12427 multiple fields. This provides direct support for sorting on multiple
12428 keys (primary, secondary, etc).
12429
12430- os.access now supports Unicode path names on non-Win32 systems.
12431
12432- Patches #925152, #1118602: Avoid reading after the end of the buffer
12433 in pyexpat.GetInputContext.
12434
12435- Patches #749830, #1144555: allow UNIX mmap size to default to current
12436 file size.
12437
12438- Added functional.partial(). See PEP309.
12439
12440- Patch #1093585: raise a ValueError for negative history items in readline.
12441 {remove_history,replace_history}
12442
12443- The spwd module has been added, allowing access to the shadow password
12444 database.
12445
12446- stat_float_times is now True.
12447
12448- array.array objects are now picklable.
12449
12450- the cPickle module no longer accepts the deprecated None option in the
12451 args tuple returned by __reduce__().
12452
12453- itertools.islice() now accepts None for the start and step arguments.
12454 This allows islice() to work more readily with slices:
12455 islice(s.start, s.stop, s.step)
12456
12457- datetime.datetime() now has a strptime class method which can be used to
12458 create datetime object using a string and format.
12459
12460- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
12461 with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
12462
12463Library
12464-------
12465
12466- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
12467 been renamed to have only a single underscore prefix. This was done to
12468 make subclassing easier.
12469
12470- PEP 338: new module runpy defines a run_module function to support
12471 executing modules which provide access to source code or a code object
12472 via the PEP 302 import mechanisms.
12473
12474- The email module's parsedate_tz function now sets the daylight savings
12475 flag to -1 (unknown) since it can't tell from the date whether it should
12476 be set.
12477
12478- Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
12479 now sport attributes that provide access to the parts of the result.
12480
12481- Patch #1462498: sgmllib now handles entity and character references
12482 in attribute values.
12483
12484- Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
12485 a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
12486 later to build this - if you have an earlier version, the C extension
12487 module will not be built.
12488
12489- Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
12490 aren't officially supported here, and trying to use them will probably
12491 raise an exception some day. But dicts have been allowed, and "mostly
12492 worked", so support for them won't go away without warning.
12493
12494- Bug #1445068: getpass.getpass() can now be given an explicit stream
12495 argument to specify where to write the prompt.
12496
12497- Patch #1462313, bug #1443328: the pickle modules now can handle classes
12498 that have __private names in their __slots__.
12499
12500- Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
12501
12502- patch #1457316: "setup.py upload" now supports --identity to select the
12503 key to be used for signing the uploaded code.
12504
12505- Queue.Queue objects now support .task_done() and .join() methods
12506 to make it easier to monitor when daemon threads have completed
12507 processing all enqueued tasks. Patch #1455676.
12508
12509- popen2.Popen objects now preserve the command in a .cmd attribute.
12510
12511- Added the ctypes ffi package.
12512
12513- email 4.0 package now integrated. This is largely the same as the email 3.0
12514 package that was included in Python 2.3, except that PEP 8 module names are
12515 now used (e.g. mail.message instead of email.Message). The MIME classes
12516 have been moved to a subpackage (e.g. email.mime.text instead of
12517 email.MIMEText). The old names are still supported for now. Several
12518 deprecated Message methods have been removed and lots of bugs have been
12519 fixed. More details can be found in the email package documentation.
12520
12521- Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
12522 (a subclass of tuple) that provides incremental decoders and encoders
12523 (a way to use stateful codecs without the stream API). Python functions
12524 codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
12525 as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
12526 have been added.
12527
12528- Patch #1359365: Calling next() on a closed StringIO.String object raises
12529 a ValueError instead of a StopIteration now (like file and cString.String do).
12530 cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
12531 called before (like file and StringIO.StringIO do).
12532
12533- A regrtest option -w was added to re-run failed tests in verbose mode.
12534
12535- Patch #1446372: quit and exit can now be called from the interactive
12536 interpreter to exit.
12537
12538- The function get_count() has been added to the gc module, and gc.collect()
12539 grew an optional 'generation' argument.
12540
12541- A library msilib to generate Windows Installer files, and a distutils
12542 command bdist_msi have been added.
12543
12544- PEP 343: new module contextlib.py defines decorator @contextmanager
12545 and helpful context managers nested() and closing().
12546
12547- The compiler package now supports future imports after the module docstring.
12548
12549- Bug #1413790: zipfile now sanitizes absolute archive names that are
12550 not allowed by the specs.
12551
12552- Patch #1215184: FileInput now can be given an opening hook which can
12553 be used to control how files are opened.
12554
12555- Patch #1212287: fileinput.input() now has a mode parameter for
12556 specifying the file mode input files should be opened with.
12557
12558- Patch #1215184: fileinput now has a fileno() function for getting the
12559 current file number.
12560
12561- Patch #1349274: gettext.install() now optionally installs additional
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012562 translation functions other than _() in the builtins namespace.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012563
12564- Patch #1337756: fileinput now accepts Unicode filenames.
12565
12566- Patch #1373643: The chunk module can now read chunks larger than
12567 two gigabytes.
12568
12569- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
12570
12571- Bug #1430298: It is now possible to send a mail with an empty
12572 return address using smtplib.
12573
12574- Bug #1432260: The names of lambda functions are now properly displayed
12575 in pydoc.
12576
12577- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
12578 unless the system is Win32.
12579
12580- Patch #1349118: urllib now supports user:pass@ style proxy
12581 specifications, raises IOErrors when proxies for unsupported protocols
12582 are defined, and uses the https proxy on https redirections.
12583
12584- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
12585
12586- Bug #1407902: Add support for sftp:// URIs to urlparse.
12587
12588- Bug #1371247: Update Windows locale identifiers in locale.py.
12589
12590- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
12591 any more.
12592
12593- Bug #1403410: The warnings module now doesn't get confused
12594 when it can't find out the module name it generates a warning for.
12595
12596- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
12597
12598- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
12599
12600- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
12601 LoadError as documented, instead of IOError. For compatibility,
12602 LoadError subclasses IOError.
12603
12604- Added the hashlib module. It provides secure hash functions for MD5 and
12605 SHA1, 224, 256, 384, and 512. Note that recent developments make the
12606 historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
12607 In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
12608 Ronald L. Rivest offered this advice for Python:
12609
12610 "The consensus of researchers in this area (at least as
12611 expressed at the NIST Hash Function Workshop 10/31/05),
12612 is that SHA-256 is a good choice for the time being, but
12613 that research should continue, and other alternatives may
12614 arise from this research. The larger SHA's also seem OK."
12615
12616- Added a subset of Fredrik Lundh's ElementTree package. Available
12617 modules are xml.etree.ElementTree, xml.etree.ElementPath, and
12618 xml.etree.ElementInclude, from ElementTree 1.2.6.
12619
12620- Patch #1162825: Support non-ASCII characters in IDLE window titles.
12621
12622- Bug #1365984: urllib now opens "data:" URLs again.
12623
12624- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
12625 is raised within the method itself on a previous call (e.g., passing in an
12626 illegal argument)
12627
12628- Bug #1340337: change time.strptime() to always return ValueError when there
12629 is an error in the format string.
12630
12631- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
12632
12633- Bug #729103: pydoc.py: Fix docother() method to accept additional
12634 "parent" argument.
12635
12636- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
12637 for padding.
12638
12639- Bug #1296004: httplib.py: Limit maximal amount of data read from the
12640 socket to avoid a MemoryError on Windows.
12641
12642- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
12643 to get the correct encoding.
12644
12645- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
12646 languages.
12647
12648- Patch #1268314: Cache lines in StreamReader.readlines for performance.
12649
12650- Bug #1290505: Fix clearing the regex cache for time.strptime().
12651
12652- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
12653
12654- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
12655 functionality.
12656
12657- Bug #1163178: Make IDNA return an empty string when the input is empty.
12658
12659- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
12660 separator and do not output trailing semicolon.
12661
12662- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
12663 ContentTooShortException, when the actually downloaded size does not
12664 match the Content-Length header.
12665
12666- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
12667
12668- Bug #1178484: Return complete lines from codec stream readers
12669 even if there is an exception in later lines, resulting in
12670 correct line numbers for decoding errors in source code.
12671
12672- Bug #1192315: Disallow negative arguments to clear() in pdb.
12673
12674- Patch #827386: Support absolute source paths in msvccompiler.py.
12675
12676- Patch #1105730: Apply the new implementation of commonprefix in posixpath
12677 to ntpath, macpath, os2emxpath and riscospath.
12678
12679- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
12680 __hasattr__ and __delattr__ methods on class Tk that were breaking
12681 Tkdnd.
12682
12683- Bug #1015140: disambiguated the term "article id" in nntplib docs and
12684 docstrings to either "article number" or "message id".
12685
12686- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
12687 parameter, but uses the usual "kwargs=None".
12688
12689- textwrap now processes text chunks at O(n) speed instead of O(n**2).
12690 Patch #1209527 (Contributed by Connelly).
12691
12692- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
12693 to W3C name (404 -> 'Not Found'). RFE #1216944.
12694
12695- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
12696 as this can cause problems with apps closing all file descriptors.
12697
12698- Bug #839151: Fix an attempt to access sys.argv in the warnings module;
12699 it can be missing in embedded interpreters
12700
12701- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
12702
12703- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
12704 error messages.
12705
12706- Bug #1108948: Cookie.py produced invalid JavaScript code.
12707
12708- The tokenize module now detects and reports indentation errors.
12709 Bug #1224621.
12710
12711- The tokenize module has a new untokenize() function to support a full
12712 roundtrip from lexed tokens back to Python source code. In addition,
12713 the generate_tokens() function now accepts a callable argument that
12714 terminates by raising StopIteration.
12715
12716- Bug #1196315: fix weakref.WeakValueDictionary constructor.
12717
12718- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
12719 component of the path.
12720
12721- Patch #1120353: The xmlrpclib module provides better, more transparent,
12722 support for datetime.{datetime,date,time} objects. With use_datetime set
12723 to True, applications shouldn't have to fiddle with the DateTime wrapper
12724 class at all.
12725
12726- distutils.commands.upload was added to support uploading distribution
12727 files to PyPI.
12728
12729- distutils.commands.register now encodes the data as UTF-8 before posting
12730 them to PyPI.
12731
12732- decimal operator and comparison methods now return NotImplemented
12733 instead of raising a TypeError when interacting with other types. This
12734 allows other classes to implement __radd__ style methods and have them
12735 work as expected.
12736
12737- Bug #1163325: Decimal infinities failed to hash. Attempting to
12738 hash a NaN raised an InvalidOperation instead of a TypeError.
12739
12740- Patch #918101: Add tarfile open mode r|* for auto-detection of the
12741 stream compression; add, for symmetry reasons, r:* as a synonym of r.
12742
12743- Patch #1043890: Add extractall method to tarfile.
12744
12745- Patch #1075887: Don't require MSVC in distutils if there is nothing
12746 to build.
12747
12748- Patch #1103407: Properly deal with tarfile iterators when untarring
12749 symbolic links on Windows.
12750
12751- Patch #645894: Use getrusage for computing the time consumption in
12752 profile.py if available.
12753
12754- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
12755
12756- Patch #1117454: Remove code to special-case cookies without values
12757 in LWPCookieJar.
12758
12759- Patch #1117339: Add cookielib special name tests.
12760
12761- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
12762
12763- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
12764
Martin Panterc04fb562016-02-10 05:44:01 +000012765- Patch #1107973: Allow iterating over the lines of a tarfile.ExFileObject.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012766
12767- Patch #1104111: Alter setup.py --help and --help-commands.
12768
12769- Patch #1121234: Properly cleanup _exit and tkerror commands.
12770
12771- Patch #1049151: xdrlib now unpacks booleans as True or False.
12772
12773- Fixed bug in a NameError bug in cookielib. Patch #1116583.
12774
12775- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
12776 disables recursive traversal through instance attributes, which can
12777 be exploited in various ways.
12778
12779- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
12780 flags on the HTTP listening socket.
12781
12782- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
12783 Fixed by reading the HTTP body in chunks instead of one big socket.read().
12784
12785- Patches #893642, #1039083: add allow_none, encoding arguments to
12786 constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
12787
12788- Bug #1110478: Revert os.environ.update to do putenv again.
12789
12790- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
12791
12792- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
12793
12794- Enhancements to the csv module:
12795
12796 + Dialects are now validated by the underlying C code, better
12797 reflecting its capabilities, and improving its compliance with
12798 PEP 305.
12799 + Dialect parameter parsing has been re-implemented to improve error
12800 reporting.
12801 + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
12802 dictates.
12803 + the parser now removes the escapechar prefix from escaped characters.
12804 + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
12805 types, rather than any object that can be represented as a numeric.
12806 + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
12807 to floats.
12808 + reader now allows \r characters to be quoted (previously it only allowed
12809 \n to be quoted).
12810 + writer doublequote handling improved.
12811 + Dialect classes passed to the module are no longer instantiated by
12812 the module before being parsed (the former validation scheme required
12813 this, but the mechanism was unreliable).
12814 + The dialect registry now contains instances of the internal
12815 C-coded dialect type, rather than references to python objects.
12816 + the internal c-coded dialect type is now immutable.
12817 + register_dialect now accepts the same keyword dialect specifications
12818 as the reader and writer, allowing the user to register dialects
12819 without first creating a dialect class.
12820 + a configurable limit to the size of parsed fields has been added -
12821 previously, an unmatched quote character could result in the entire
12822 file being read into the field buffer before an error was reported.
12823 + A new module method csv.field_size_limit() has been added that sets
12824 the parser field size limit (returning the former limit). The initial
12825 limit is 128kB.
12826 + A line_num attribute has been added to the reader object, which tracks
12827 the number of lines read from the source iterator. This is not
12828 the same as the number of records returned, as records can span
12829 multiple lines.
12830 + reader and writer objects were not being registered with the cyclic-GC.
12831 This has been fixed.
12832
12833- _DummyThread objects in the threading module now delete self.__block that is
12834 inherited from _Thread since it uses up a lock allocated by 'thread'. The
12835 lock primitives tend to be limited in number and thus should not be wasted on
12836 a _DummyThread object. Fixes bug #1089632.
12837
12838- The imghdr module now detects Exif files.
12839
12840- StringIO.truncate() now correctly adjusts the size attribute.
12841 (Bug #951915).
12842
12843- locale.py now uses an updated locale alias table (built using
12844 Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
12845 alias file); the encoding lookup was enhanced to use Python's
12846 encoding alias table.
12847
12848- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
12849
12850- the pickle module no longer accepts the deprecated None option in the
12851 args tuple returned by __reduce__().
12852
12853- optparse now optionally imports gettext. This allows its use in setup.py.
12854
12855- the pickle module no longer uses the deprecated bin parameter.
12856
12857- the shelve module no longer uses the deprecated binary parameter.
12858
12859- the pstats module no longer uses the deprecated ignore() method.
12860
12861- the filecmp module no longer uses the deprecated use_statcache argument.
12862
12863- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
12864 extended or overridden by subclasses. Formerly, the subclassed method would
12865 be ignored by the rest of the module. (Bug #1078905).
12866
12867- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
12868 the same meaning as in list.sort().
12869
12870- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
12871 once when a size argument is given. This prevents a buffer overflow in the
12872 tokenizer with very long source lines.
12873
12874- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
12875 immediately after creating the object, without any intervening
12876 ``.decompress()`` calls.
12877
12878- The reconvert.quote function can now emit triple-quoted strings. The
12879 reconvert module now has some simple documentation.
12880
12881- ``UserString.MutableString`` now supports negative indices in
12882 ``__setitem__`` and ``__delitem__``
12883
12884- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
12885 correctly.
12886
12887- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
12888 ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
12889 character even if the user has passed a size parameter to get a proper
12890 line ending. Remove the special handling of a "\r\n" that has been split
12891 between two lines.
12892
12893- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
12894 about illegal code points. The codec now supports PEP 293 style error
12895 handlers.
12896
12897- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
12898 from the input stream, so that the output is a byte string in the correct
12899 encoding instead of a unicode string.
12900
12901- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
12902 considering it exactly like a '*'.
12903
12904- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
12905 ``encodings.aliases``.
12906
12907- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
12908
12909- Patch #1413711: Certain patterns of differences were making difflib
12910 touch the recursion limit.
12911
12912- Bug #947906: An object oriented interface has been added to the calendar
12913 module. It's possible to generate HTML calendar now and the module can be
12914 called as a script (e.g. via ``python -mcalendar``). Localized month and
12915 weekday names can be ouput (even if an exotic encoding is used) using
12916 special classes that use unicode.
12917
12918Build
12919-----
12920
12921- Fix test_float, test_long, and test_struct failures on Tru64 with gcc
12922 by using -mieee gcc option.
12923
12924- Patch #1432345: Make python compile on DragonFly.
12925
12926- Build support for Win64-AMD64 was added.
12927
12928- Patch #1428494: Prefer linking against ncursesw over ncurses library.
12929
12930- Patch #881820: look for openpty and forkpty also in libbsd.
12931
12932- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
Georg Brandl93dc9eb2010-03-14 10:56:14 +000012933 The zlib module is now built in on Windows.
Christian Heimesc3f30c42008-02-22 16:37:40 +000012934
12935- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
12936
12937- Bug #1189330: configure did not correctly determine the necessary
12938 value of LINKCC if python was built with GCC 4.0.
12939
12940- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
12941 vulnerability in zlib 1.2.1 and 1.2.2.
12942
12943- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
12944 flags that change binary compatibility. Changes were also made to
12945 distutils.sysconfig to also use the environment variable when used during
12946 compilation of the interpreter and of C extensions through distutils.
12947
12948- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
12949 and linking has changed (prebinding is now deprecated, and libcc_dynamic
12950 no longer exists). This configure patch makes things right.
12951
12952- Bug #1158607: Build with --disable-unicode again.
12953
12954- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
12955 defined. Discovered as a result of not being able to build on OS X.
12956
12957- setup.py now uses the directories specified in LDFLAGS using the -L option
12958 and in CPPFLAGS using the -I option for adding library and include
12959 directories, respectively, for compiling extension modules against. This has
12960 led to the core being compiled using the values in CPPFLAGS. It also removes
12961 the need for the special-casing of both DarwinPorts and Fink for darwin since
12962 the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
12963 ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
12964 Fink, ``-I/opt/local/include`` for DarwinPorts).
12965
12966- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
12967 to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
12968 Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
12969 Closes bug #1096244. Thanks Gregory Bond.
12970
12971C API
12972-----
12973
12974- ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
12975 ``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
12976 is obtained via the ``PyObject_`` family, it must be released via the
12977 ``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
12978 always been officially true, but when Python's small-object allocator was
12979 introduced, an attempt was made to cater to a few extension modules
12980 discovered at the time that obtained memory via ``PyObject_New`` but
12981 released it via ``PyMem_DEL``. It's years later, and if such code still
12982 exists it will fail now (probably with segfaults, but calling wrong
12983 low-level memory management functions can yield many symptoms).
12984
12985- Added a C API for set and frozenset objects.
12986
12987- Removed PyRange_New().
12988
12989- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
12990 mapping argument now. This string is used as a mapping table. Byte values
12991 greater than the length of the string and 0xFFFE are treated as undefined
12992 mappings.
12993
12994
12995Tests
12996-----
12997
12998- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
12999
13000- Patch #1276356: New resource "urlfetch" is implemented. This enables
13001 even impatient people to run tests that require remote files.
13002
13003
13004Documentation
13005-------------
13006
13007- Bug #1402224: Add warning to dl docs about crashes.
13008
13009- Bug #1396471: Document that Windows' ftell() can return invalid
13010 values for text files with UNIX-style line endings.
13011
13012- Bug #1274828: Document os.path.splitunc().
13013
13014- Bug #1190204: Clarify which directories are searched by site.py.
13015
13016- Bug #1193849: Clarify os.path.expanduser() documentation.
13017
13018- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
13019
13020- Bug #755617: Document the effects of os.chown() on Windows.
13021
13022- Patch #1180012: The documentation for modulefinder is now in the library reference.
13023
13024- Patch #1213031: Document that os.chown() accepts argument values of -1.
13025
13026- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
13027
13028- Bug #1175022: Correct the example code for property().
13029
13030- Document the IterableUserDict class in the UserDict module.
13031 Closes bug #1166582.
13032
13033- Remove all latent references for "Macintosh" that referred to semantics for
13034 Mac OS 9 and change to reflect the state for OS X.
13035 Closes patch #1095802. Thanks Jack Jansen.
13036
13037Mac
13038---
13039
13040
13041New platforms
13042-------------
13043
13044- FreeBSD 7 support is added.
13045
13046
13047Tools/Demos
13048-----------
13049
13050- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
13051 directory for syntax highlighting in Vim. Vim directory was added and placed
13052 vimrc to it (was previous up a level).
13053
13054- Added two new files to Tools/scripts: pysource.py, which recursively
13055 finds Python source files, and findnocoding.py, which finds Python
13056 source files that need an encoding declaration.
13057 Patch #784089, credits to Oleg Broytmann.
13058
13059- Bug #1072853: pindent.py used an uninitialized variable.
13060
13061- Patch #1177597: Correct Complex.__init__.
13062
13063- Fixed a display glitch in Pynche, which could cause the right arrow to
13064 wiggle over by a pixel.
13065
13066
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013067What's New in Python 2.4 final?
13068===============================
13069
13070*Release date: 30-NOV-2004*
13071
13072Core and builtins
13073-----------------
13074
13075- Bug 875692: Improve signal handling, especially when using threads, by
13076 forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
13077 things_to_do is not cleared by Py_MakePendingCalls().
13078
13079
13080What's New in Python 2.4 (release candidate 1)
13081==============================================
13082
13083*Release date: 18-NOV-2004*
13084
13085Core and builtins
13086-----------------
13087
13088- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
13089 the years-old thread shutdown race bug 225673. Numeric history lesson
13090 aside, all bugs in all three reports are fixed now.
13091
13092
13093Library
13094-------
13095
13096- Bug 1052242: If exceptions are raised by an atexit handler function an
13097 attempt is made to execute the remaining handlers. The last exception
13098 raised is re-raised.
13099
13100- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
13101 doctests was broken in a dramatic but shallow way. Fixed.
13102
13103- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
13104 and ``month_abbr`` attributes emulate sequences of locale-correct
13105 spellings of month and day names. Because the locale can change at
13106 any time, the correct spelling is recomputed whenever one of these is
13107 indexed. In the worst case, the index may be a slice object, so these
13108 recomputed every day or month name each time they were indexed. This is
13109 much slower than necessary in the usual case, when the index is just an
13110 integer. In that case, only the single spelling needed is recomputed
13111 now; and, when the index is a slice object, only the spellings needed
13112 by the slice are recomputed now.
13113
13114- Patch 1061679: Added ``__all__`` to pickletools.py.
13115
13116Build
13117-----
13118
13119- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
13120 and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
13121 which has no known users. Thanks Bob Ippolito.
13122
13123C API
13124-----
13125
13126- The PyRange_New() function is deprecated.
13127
13128
13129What's New in Python 2.4 beta 2?
13130================================
13131
13132*Release date: 03-NOV-2004*
13133
13134License
13135-------
13136
13137The Python Software Foundation changed the license under which Python
13138is released, to remove Python version numbers. There were no other
13139changes to the license. So, for example, wherever the license for
13140Python 2.3 said "Python 2.3", the new license says "Python". The
13141intent is to make it possible to refer to the PSF license in a more
13142durable way. For example, some people say they're confused by that
13143the Open Source Initiative's entry for the Python Software Foundation
13144License::
13145
13146 http://www.opensource.org/licenses/PythonSoftFoundation.php
13147
13148says "Python 2.1.1" all over it, wondering whether it applies only
13149to Python 2.1.1.
13150
13151The official name of the new license is the Python Software Foundation
13152License Version 2.
13153
13154Core and builtins
13155-----------------
13156
13157- Bug #1055820 Cyclic garbage collection was not protecting against that
13158 calling a live weakref to a piece of cyclic trash could resurrect an
13159 insane mutation of the trash if any Python code ran during gc (via
13160 running a dead object's __del__ method, running another callback on a
13161 weakref to a dead object, or via any Python code run in any other thread
13162 that managed to obtain the GIL while a __del__ or callback was running
13163 in the thread doing gc). The most likely symptom was "impossible"
13164 ``AttributeError`` exceptions, appearing seemingly at random, on weakly
13165 referenced objects. The cure was to clear all weakrefs to unreachable
13166 objects before allowing any callbacks to run.
13167
13168- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
13169
13170Extension Modules
13171-----------------
13172
13173- Bug #1048870: the compiler now generates distinct code objects for
13174 functions with identical bodies. This was producing confusing
13175 traceback messages which pointed to the function where the code
13176 object was first defined rather than the function being executed.
13177
13178Library
13179-------
13180
13181- Patch #1056967 changes the semantics of Template.safe_substitute() so that
13182 no ValueError is raised on an 'invalid' match group. Now the delimiter is
13183 returned.
13184
13185- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
13186
13187- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
13188 paths with a base path before checking os.path.isfile().
13189
13190- The whichdb module can now be run from the command line.
13191
13192- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
13193 the year) when the day of the week and year are also specified.
13194
13195- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
13196
13197- Bug #1017553: fix bug in tarfile.filemode()
13198
13199- Patch #737473: fix bug that old source code is shown in tracebacks even if
13200 the source code is updated and reloaded.
13201
13202Build
13203-----
13204
13205- Patch #1044395: --enable-shared is allowed in FreeBSD also.
13206
13207What's New in Python 2.4 beta 1?
13208================================
13209
13210*Release date: 15-OCT-2004*
13211
13212Core and builtins
13213-----------------
13214
13215- Patch #975056: Restartable signals were not correctly disabled on
13216 BSD systems. Consistently use PyOS_setsig() instead of signal().
13217
13218- The internal portable implementation of thread-local storage (TLS), used
13219 by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
13220 thread-correct. This could lead to a variety of problems, up to and
13221 including segfaults. See bug 1041645 for an example.
13222
13223- Added a command line option, -m module, which searches sys.path for the
13224 module and then runs it. (Contributed by Nick Coghlan.)
13225
13226- The bytecode optimizer now folds tuples of constants into a single
13227 constant.
13228
13229- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
13230 an integer was compared to a float, the integer was coerced to a float.
13231 That could yield spurious overflow errors (if the integer was very
13232 large), and to anomalies such as
13233 ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
13234 longer performed, and cases like ``long(1e200)-1 < 1e200``,
13235 ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
13236 correctly now.
13237
13238Extension modules
13239-----------------
13240
13241- ``collections.deque`` objects didn't play quite right with garbage
13242 collection, which could lead to a segfault in a release build, or
13243 an assert failure in a debug build. Also, added overflow checks,
13244 better detection of mutation during iteration, and shielded deque
13245 comparisons from unusual subclass overrides of the __iter__() method.
13246
13247Library
13248-------
13249
13250- Patch 1046644: distutils build_ext grew two new options - --swig for
13251 specifying the swig executable to use, and --swig-opts to specify
13252 options to pass to swig. --swig-opts="-c++" is the new way to spell
13253 --swig-cpp.
13254
13255- Patch 983206: distutils now obeys environment variable LDSHARED, if
13256 it is set.
13257
13258- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
13259
13260- time.strptime() now properly escapes timezones and all other locale-specific
13261 strings for regex-specific symbols. Was breaking under Japanese Windows when
13262 the timezone was specified as "Tokyo (standard time)".
13263 Closes bug #1039270.
13264
13265- Updates for the email package:
13266
13267 + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
13268 + All deprecated APIs that in email 2.x issued warnings have been removed:
13269 _encoder argument to the MIMEText constructor, Message.add_payload(),
13270 Utils.dump_address_pair(), Utils.decode(), Utils.encode()
13271 + New deprecations: Generator.__call__(), Message.get_type(),
13272 Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
13273 the Parser constructor. These will be removed in email 3.1.
13274 + Support for Python earlier than 2.3 has been removed (see PEP 291).
13275 + All defect classes have been renamed to end in 'Defect'.
13276 + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
13277 added to messages that claim to be multipart but really aren't.
13278 + Updates to documentation.
13279
13280- re's findall() and finditer() functions now take an optional flags argument
13281 just like the compile(), search(), and match() functions. Also, documented
13282 the previously existing start and stop parameters for the findall() and
13283 finditer() methods of regular expression objects.
13284
13285- rfc822 Messages now support iterating over the headers.
13286
13287- The (undocumented) tarfile.Tarfile.membernames has been removed;
13288 applications should use the getmember function.
13289
13290- httplib now offers symbolic constants for the HTTP status codes.
13291
13292- SF bug #1028306: Trying to compare a ``datetime.date`` to a
13293 ``datetime.datetime`` mistakenly compared only the year, month and day.
13294 Now it acts like a mixed-type comparison: ``False`` for ``==``,
13295 ``True`` for ``!=``, and raises ``TypeError`` for other comparison
13296 operators. Because datetime is a subclass of date, comparing only the
13297 base class (date) members can still be done, if that's desired, by
13298 forcing using of the approprate date method; e.g.,
13299 ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
13300 and day members of ``a_date`` and ``a_datetime`` are equal.
13301
13302- bdist_rpm now supports command line options --force-arch,
13303 {pre,post}-install, {pre,post}-uninstall, and
13304 {prep,build,install,clean,verify}-script.
13305
13306- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
13307 decoding incomplete input (when the input stream is temporarily exhausted).
13308 ``codecs.StreamReader`` now implements buffering, which enables proper
13309 readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
13310 has a new argument ``chars`` which specifies the number of characters to
13311 return. ``codecs.StreamReader.readline()`` and
13312 ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
13313 Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
13314
13315- The documentation for doctest is greatly expanded, and now covers all
13316 the new public features (of which there are many).
13317
13318- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
13319 updates it. This isn't good, because every ``testmod()`` call
13320 contributes to bloating the "hidden" state of ``doctest.master``, but
13321 some old code apparently relies on it. For now, all we can do is
13322 encourage people to stitch doctests together via doctest's unittest
13323 integration features instead.
13324
13325- httplib now handles ipv6 address/port pairs.
13326
13327- SF bug #1017864: ConfigParser now correctly handles default keys,
13328 processing them with ``ConfigParser.optionxform`` when supplied,
13329 consistent with the handling of config file entries and runtime-set
13330 options.
13331
13332- SF bug #997050: Document, test, & check for non-string values in
13333 ConfigParser. Moved the new string-only restriction added in
13334 rev. 1.65 to the SafeConfigParser class, leaving existing
13335 ConfigParser & RawConfigParser behavior alone, and documented the
13336 conditions under which non-string values work.
13337
13338Build
13339-----
13340
13341- Building on darwin now includes /opt/local/include and /opt/local/lib for
13342 building extension modules. This is so as to include software installed as
13343 a DarwinPorts port <http://darwinports.opendarwin.org/>
13344
13345- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
13346 platform C computes true for ``x != x`` if and only if X is a NaN.
13347 Other platforms can override the default definition with a platform-
13348 specific spelling in that platform's pyconfig.h. You can also override
13349 pyport.h's default Py_IS_INFINITY definition now.
13350
13351C API
13352-----
13353
13354- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
13355 non-zero if PyEval_InitThreads() has been called.
13356
13357- The undocumented and unused extern int ``_PyThread_Started`` was removed.
13358
13359- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13360 are two of the very few advertised as being safe to call without holding
13361 the GIL. However, this wasn't true in a debug build, as bug 1041645
13362 demonstrated. In a debug build, Python redirects the ``PyMem`` family
13363 of calls to Python's small-object allocator, to get the benefit of
13364 its extra debugging capabilities. But Python's small-object allocator
13365 isn't threadsafe, relying on the GIL to avoid the expense of doing its
13366 own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
13367 call the platform ``malloc()`` directly now, regardless of build type.
13368
13369- PyLong_AsUnsignedLong[Mask] now support int objects as well.
13370
13371- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
13372 ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
13373 decoding.
13374
13375Tests
13376-----
13377
13378- test__locale ported to unittest
13379
13380Mac
13381---
13382
13383- ``plistlib`` now supports non-dict root objects. There is also a new
13384 interface for reading and writing plist files: ``readPlist(pathOrFile)``
13385 and ``writePlist(rootObject, pathOrFile)``
13386
13387Tools/Demos
13388-----------
13389
13390- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
13391 read the input files in universal-newline mode. This spares them
13392 from consuming a great deal of time to deduce the useless result that,
13393 e.g., a file with Windows line ends and a file with Linux line ends
13394 have no lines in common.
13395
13396
13397What's New in Python 2.4 alpha 3?
13398=================================
13399
13400*Release date: 02-SEP-2004*
13401
13402Core and builtins
13403-----------------
13404
13405- SF patch #1007189: ``from ... import ...`` statements now allow the name
13406 list to be surrounded by parentheses.
13407
13408- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
13409 multiplication was sped a little by optimizing the C code. Gradeschool
13410 squaring was sped by about a factor of 2, by exploiting that about half
13411 the digit products are duplicates in a square. Because exponentiation
13412 uses squaring often, this also speeds long power. For example, the time
13413 to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
13414 to this much. The cutoff for Karatsuba multiplication was raised,
13415 since gradeschool multiplication got quicker, and the cutoff was
13416 aggressively small regardless. The exponentiation algorithm was switched
13417 from right-to-left to left-to-right, which is more efficient for small
13418 bases. In addition, if the exponent is large, the algorithm now does
13419 5 bits (instead of 1 bit) at a time. That cut the time to compute
13420 17**1000000 on my box in half again, down to about 4.5 seconds.
13421
13422- OverflowWarning is no longer generated. PEP 237 scheduled this to
13423 occur in Python 2.3, but since OverflowWarning was disabled by default,
13424 nobody realized it was still being generated. On the chance that user
13425 code is still using them, the Python builtin OverflowWarning, and
13426 corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
13427
13428- Py_InitializeEx has been added.
13429
13430- Fix the order of application of decorators. The proper order is bottom-up;
13431 the first decorator listed is the last one called.
13432
13433- SF patch #1005778. Fix a seg fault if the list size changed while
13434 calling list.index(). This could happen if a rich comparison function
13435 modified the list.
13436
13437- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
13438 functions is now writable.
13439
13440- code_new (a.k.a new.code()) now checks its arguments sufficiently
13441 carefully that passing them on to PyCode_New() won't trigger calls
13442 to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
13443 that the returned code object might be entirely insane.
13444
13445- Subclasses of string can no longer be interned. The semantics of
13446 interning were not clear here -- a subclass could be mutable, for
13447 example -- and had bugs. Explicitly interning a subclass of string
13448 via intern() will raise a TypeError. Internal operations that attempt
13449 to intern a string subclass will have no effect.
13450
13451- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
13452 what xrange() intends, and repaired tests accordingly.
13453
13454Extension modules
13455-----------------
13456
13457- difflib now supports HTML side-by-side diff.
13458
13459- os.urandom has been added for systems that support sources of random
13460 data.
13461
Sean Reifscheider54cf12b2007-09-17 17:55:36 +000013462- Patch 1012740: truncate() on a writable cStringIO now resets the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013463 position to the end of the stream. This is consistent with the original
13464 StringIO module and avoids inadvertently resurrecting data that was
13465 supposed to have been truncated away.
13466
13467- Added socket.socketpair().
13468
13469- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
13470 members to xml.parsers.expat.XMLParser object.
13471
13472- The mpz, rotor, and xreadlines modules, all deprecated in earlier
13473 versions of Python, have now been removed.
13474
13475Library
13476-------
13477
13478- Patch #934356: if a module defines __all__, believe that rather than using
13479 heuristics for filtering out imported names.
13480
13481- Patch #941486: added os.path.lexists(), which returns True for broken
13482 symlinks, unlike os.path.exists().
13483
13484- the random module now uses os.urandom() for seeding if it is available.
13485 Added a new generator based on os.urandom().
13486
13487- difflib and diff.py can now generate HTML.
13488
13489- bdist_rpm now includes version and release in the BuildRoot, and
13490 replaces - by ``_`` in version and release.
13491
13492- distutils build/build_scripts now has an -e option to specify the
13493 path to the Python interpreter for installed scripts.
13494
13495- PEP 292 classes Template and SafeTemplate are added to the string module.
13496
13497- tarfile now generates GNU tar files by default.
13498
13499- HTTPResponse has now a getheaders method.
13500
13501- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
13502 Percivall.
13503
13504- logging.handlers.SMTPHandler.date_time has been removed;
13505 the class now uses email.Utils.formatdate to generate the time stamp.
13506
13507- A new function tkFont.nametofont was added to return an existing
13508 font. The Font class constructor now has an additional exists argument
13509 which, if True, requests to return/configure an existing font, rather
13510 than creating a new one.
13511
13512- Updated the decimal package's min() and max() methods to match the
13513 latest revision of the General Decimal Arithmetic Specification.
13514 Quiet NaNs are ignored and equal values are sorted based on sign
13515 and exponent.
13516
13517- The decimal package's Context.copy() method now returns deep copies.
13518
13519- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
13520 attribute will be kept around for backwards compatibility and atexit
13521 will just become the one preferred way to do it.
13522
13523- patch #675551: Add get_history_item and replace_history_item functions
13524 to the readline module.
13525
13526- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
13527 of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
13528 frame, u(p) to an older frame, not the other way around.
13529
13530- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
13531 path, as normalizing the path may alter the meaning of the path if it
13532 contains symlinks.
13533
13534- bug #851123: shutil.copyfile will raise an exception when trying to copy a
13535 file onto a link to itself. Thanks Gregory Ball.
13536
13537- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
13538 so as to properly list all functions in a module when the module itself is
13539 reached through a symlink. Thanks Johannes Gijsbers.
13540
13541- doctest refactoring continued. See the docs for details. As part of
13542 this effort, some old and little- (never?) used features are now
13543 deprecated: the Tester class, the module is_private() function, and the
13544 isprivate argument to testmod(). The Tester class supplied a feeble
13545 "by hand" way to combine multiple doctests, if you knew exactly what
13546 you were doing. The newer doctest features for unittest integration
13547 already did a better job of that, are stronger now than ever, and the
13548 new DocTestRunner class is a saner foundation if you want to do it by
13549 hand. The "private name" filtering gimmick was a mistake from the
13550 start, and testmod() changed long ago to ignore it by default. If
13551 you want to filter out tests, the new DocTestFinder class can be used
13552 to return a list of all doctests, and you can filter that list by
13553 any computable criteria before passing it to a DocTestRunner instance.
13554
13555- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
13556
13557Tools/Demos
13558-----------
13559
13560- IDLE's shortcut keys for windows are now case insensitive so that
13561 Control-V works the same as Control-v.
13562
13563- pygettext.py: Generate POT-Creation-Date header in ISO format.
13564
13565Build
13566-----
13567
13568- Backward incompatibility: longintrepr.h now triggers a compile-time
13569 error if SHIFT (the number of bits in a Python long "digit") isn't
13570 divisible by 5. This new requirement allows simple code for the new
13571 5-bits-at-a-time long_pow() implementation. If necessary, the
13572 restriction could be removed (by complicating long_pow(), or by
13573 falling back to the 1-bit-at-a-time algorithm), but there are no
13574 plans to do so.
13575
13576- bug #991962: When building with --disable-toolbox-glue on Darwin no
13577 attempt to build Mac-specific modules occurs.
13578
13579- The --with-tsc flag to configure to enable VM profiling with the
13580 processor's timestamp counter now works on PPC platforms.
13581
13582- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
13583 GCC's definition and avoid redefinition warnings.
13584
13585- Detect pthreads support (provided by gnu pth pthread emulation) on
13586 GNU/k*BSD systems.
13587
13588- bug #1005737, #1007249: Fixed several build problems and warnings
13589 found on old/legacy C compilers of HP-UX, IRIX and Tru64.
13590
13591C API
13592-----
13593
13594..
13595
13596Documentation
13597-------------
13598
13599- patch #1005936, bug #1009373: fix index entries which contain
13600 an underscore when viewed with Acrobat.
13601
13602- bug #990669: os.path.normpath may alter the meaning of a path if
13603 it contains symbolic links. This has been documented in a comment
13604 since 1992, but is now in the library reference as well.
13605
13606New platforms
13607-------------
13608
13609- FreeBSD 6 is now supported.
13610
13611Tests
13612-----
13613
13614..
13615
13616Windows
13617-------
13618
13619- Boosted the stack reservation for python.exe and pythonw.exe from
13620 the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
13621 bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
13622 within the default sys.getrecursionlimit() default value of 1000 were
13623 able to suffer undetected C stack overflows. The standard test program
13624 test_compiler was one such program. If a Python process on Windows
13625 "just vanishes" without a trace, and without an error message of any
13626 kind, but with an exit code of 128, undetected stack overflow may be
13627 the problem.
13628
13629Mac
13630---
13631
13632..
13633
13634
13635What's New in Python 2.4 alpha 2?
13636=================================
13637
13638*Release date: 05-AUG-2004*
13639
13640Core and builtins
13641-----------------
13642
13643- Patch #980695: Implements efficient string concatenation for statements
13644 of the form s=s+t and s+=t. This will vary across implementations.
13645 Accordingly, the str.join() method is strongly preferred for performance
13646 sensitive code.
13647
13648- PEP-0318, Function Decorators have been added to the language. These are
13649 implemented using the Java-style @decorator syntax, like so::
13650
13651 @staticmethod
13652 def foo(bar):
13653
13654 (The PEP needs to be updated to reflect the current state)
13655
13656- When importing a module M raises an exception, Python no longer leaves M
13657 in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
13658 succeed, picking up a module object from sys.modules reflecting as much
13659 of the initialization of M as completed before the exception was raised.
13660 Subsequent imports got no indication that M was in a partially-
13661 initialized state, and the importers could get into arbitrarily bad
13662 trouble as a result (the M they got was in an unintended state,
13663 arbitrarily far removed from M's author's intent). Now subsequent
13664 imports of M will continue raising exceptions (but if, for example, the
13665 source code for M is edited between import attempts, then perhaps later
13666 attempts will succeed, or raise a different exception).
13667
13668 This can break existing code, but in such cases the code was probably
13669 working before by accident. In the Python source, the only case of
13670 breakage discovered was in a test accidentally relying on a damaged
13671 module remaining in sys.modules. Cases are also known where tests
13672 deliberately provoking import errors remove damaged modules from
13673 sys.modules themselves, and such tests will break now if they do an
13674 unconditional del sys.modules[M].
13675
13676- u'%s' % obj will now try obj.__unicode__() first and fallback to
13677 obj.__str__() if no __unicode__ method can be found.
13678
13679- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
13680 PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
13681
13682- Allow string and unicode return types from .encode()/.decode()
13683 methods on string and unicode objects. Added unicode.decode()
13684 which was missing for no apparent reason.
13685
13686- An attempt to fix the mess that is Python's behaviour with
13687 signal handlers and threads, complicated by readline's behaviour.
13688 It's quite possible that there are still bugs here.
13689
13690- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
13691 types that support garbage collection.
13692
13693- Compiler now treats None as a constant.
13694
13695- The type of values returned by __int__, __float__, __long__,
13696 __oct__, and __hex__ are now checked. Returning an invalid type
13697 will cause a TypeError to be raised. This matches the behavior of
13698 Jython.
13699
13700- Implemented bind_textdomain_codeset() in locale module.
13701
13702- Added a workaround for proper string operations in BSDs. str.split
13703 and str.is* methods can now work correctly with UTF-8 locales.
13704
13705- Bug #989185: unicode.iswide() and unicode.width() is dropped and
13706 the East Asian Width support is moved to unicodedata extension
13707 module.
13708
13709- Patch #941229: The source code encoding in interactive mode
13710 now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
13711 allows for non-latin-1 users to write unicode strings directly.
13712
13713Extension modules
13714-----------------
13715
13716- cpickle now supports the same keyword arguments as pickle.
13717
13718Library
13719-------
13720
13721- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
13722 TIS-620
13723
13724- Thanks to Edward Loper, doctest has been massively refactored, and
13725 many new features were added. Full docs will appear later. For now
13726 the doctest module comments and new test cases give good coverage.
13727 The refactoring provides many hook points for customizing behavior
13728 (such as how to report errors, and how to compare expected to actual
13729 output). New features include a <BLANKLINE> marker for expected
13730 output containing blank lines, options to produce unified or context
13731 diffs when actual output doesn't match expectations, an option to
13732 normalize whitespace before comparing, and an option to use an
13733 ellipsis to signify "don't care" regions of output.
13734
13735- Tkinter now supports the wish -sync and -use options.
13736
13737- The following methods in time support passing of None: ctime(), gmtime(),
13738 and localtime(). If None is provided, the current time is used (the
13739 same as when the argument is omitted).
13740 [SF bug 658254, patch 663482]
13741
Martin Panterc04fb562016-02-10 05:44:01 +000013742- nntplib does now allow ignoring a .netrc file.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013743
13744- urllib2 now recognizes Basic authentication even if other authentication
13745 schemes are offered.
13746
13747- Bug #1001053. wave.open() now accepts unicode filenames.
13748
13749- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
13750 underlying file object (provided it has a fileno() method). This is
13751 needed if you want to use os.fsync() on a GzipFile.
13752
13753- imaplib has two new methods: deleteacl and myrights.
13754
13755- nntplib has two new methods: description and descriptions. They
13756 use a more RFC-compliant way of getting a newsgroup description.
13757
13758- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
13759 raised during interpreter shutdown from a registered function with atexit
13760 when dummy_threading is being used.
13761
13762- Bug #857297/Patch #916874. Fix an error when extracting a hard link
13763 from a tarfile.
13764
13765- Patch #846659. Fix an error in tarfile.py when using
13766 GNU longname/longlink creation.
13767
Georg Brandl93dc9eb2010-03-14 10:56:14 +000013768- The obsolete FCNTL.py has been deleted. The built-in fcntl module
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000013769 has been available (on platforms that support fcntl) since Python
13770 1.5a3, and all FCNTL.py did is export fcntl's names, after generating
13771 a deprecation warning telling you to use fcntl directly.
13772
13773- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
13774 iso2022_jp_2004, shift_jis_2004.
13775
13776- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
13777 implementations, exploiting Conditions (which didn't exist at the time
13778 Queue was introduced). A minor semantic change is that the Full and
13779 Empty exceptions raised by non-blocking calls now occur only if the
13780 queue truly was full or empty at the instant the queue was checked (of
13781 course the Queue may no longer be full or empty by the time a calling
13782 thread sees those exceptions, though). Before, the exceptions could
13783 also be raised if it was "merely inconvenient" for the implementation
13784 to determine the true state of the Queue (because the Queue was locked
13785 by some other method in progress).
13786
13787- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
13788 case of comparing two empty lists. This affected both context_diff() and
13789 unified_diff(),
13790
13791- Bug #980938: smtplib now prints debug output to sys.stderr.
13792
13793- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
13794 returning the last point in the path that was not part of any loop. Thanks
13795 AM Kuchling.
13796
13797- Bug #980327: ntpath not handles compressing erroneous slashes between the
13798 drive letter and the rest of the path. Also clearly handles UNC addresses now
13799 as well. Thanks Paul Moore.
13800
13801- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
13802 for file sizes (compressed and uncompressed) was being stored as signed
13803 instead of unsigned.
13804
13805- decimal.py now only uses signals in the IBM spec. The other conditions are
13806 no longer part of the public API.
13807
13808- codecs module now has two new generic APIs: encode() and decode()
13809 which don't restrict the return types (unlike the unicode and
13810 string methods of the same name).
13811
13812- Non-blocking SSL sockets work again; they were broken in Python 2.3.
13813 SF patch 945642.
13814
13815- doctest unittest integration improvements:
13816
13817 o Improved the unitest test output for doctest-based unit tests
13818
13819 o Can now pass setUp and tearDown functions when creating
13820 DocTestSuites.
13821
13822- The threading module has a new class, local, for creating objects
13823 that provide thread-local data.
13824
13825- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
13826 no longer returns spurious empty fields.
13827
13828- Implemented bind_textdomain_codeset() in gettext module.
13829
13830- Introduced in gettext module the l*gettext() family of functions,
13831 which return translation strings encoded in the preferred encoding,
13832 as informed by locale module's getpreferredencoding().
13833
13834- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
13835
13836 - Add expansion of default values in help text: the string
13837 "%default" in an option's help string is expanded to str() of
13838 that option's default value, or "none" if no default value.
13839
13840 - Bug #955889: option default values that happen to be strings are
13841 now processed in the same way as values from the command line; this
13842 allows generation of nicer help when using custom types. Can
13843 be disabled with parser.set_process_default_values(False).
13844
13845 - Bug #960515: don't crash when generating help for callback
13846 options that specify 'type', but not 'dest' or 'metavar'.
13847
13848 - Feature #815264: change the default help format for short options
13849 that take an argument from e.g. "-oARG" to "-o ARG"; add
13850 set_short_opt_delimiter() and set_long_opt_delimiter() methods to
13851 HelpFormatter to allow (slight) customization of the formatting.
13852
13853 - Patch #736940: internationalize Optik: all built-in user-
13854 targeted literal strings are passed through gettext.gettext(). (If
13855 you want translations (.po files), they're not included with Python
13856 -- you'll find them in the Optik source distribution from
13857 http://optik.sourceforge.net/ .)
13858
13859 - Bug #878453: respect $COLUMNS environment variable for
13860 wrapping help output.
13861
13862 - Feature #988122: expand "%prog" in the 'description' passed
13863 to OptionParser, just like in the 'usage' and 'version' strings.
13864 (This is *not* done in the 'description' passed to OptionGroup.)
13865
13866C API
13867-----
13868
13869- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
13870 error occurs while loading the module, these now delete the module's
13871 entry from sys.modules. All ways of loading modules eventually call
13872 one of these, so this is an error-case change in semantics for all
13873 ways of loading modules. In rare cases, a module loader may wish
13874 to keep a module object in sys.modules despite that the module's
13875 code cannot be executed. In such cases, the module loader must
13876 arrange to reinsert the name and module object in sys.modules.
13877 PyImport_ReloadModule() has been changed to reinsert the original
13878 module object into sys.modules if the module reload fails, so that
13879 its visible semantics have not changed.
13880
13881- A large pile of datetime field-extraction macros is now documented,
13882 thanks to Anthony Tuininga (patch #986010).
13883
13884Documentation
13885-------------
13886
13887- Improved the tutorial on creating types in C.
13888
13889 - point out the importance of reassigning data members before
13890 assigning their values
13891
13892 - correct my misconception about return values from visitprocs. Sigh.
13893
13894 - mention the labor saving Py_VISIT and Py_CLEAR macros.
13895
13896- Major rewrite of the math module docs, to address common confusions.
13897
13898Tests
13899-----
13900
13901- The test data files for the decimal test suite are now installed on
13902 platforms that use the Makefile.
13903
13904- SF patch 995225: The test file testtar.tar accidentally contained
13905 CVS keywords (like $Id$), which could cause spurious failures in
13906 test_tarfile.py depending on how the test file was checked out.
13907
13908
13909What's New in Python 2.4 alpha 1?
13910=================================
13911
13912*Release date: 08-JUL-2004*
13913
13914Core and builtins
13915-----------------
13916
13917- weakref.ref is now the type object also known as
13918 weakref.ReferenceType; it can be subclassed like any other new-style
13919 class. There's less per-entry overhead in WeakValueDictionary
13920 objects now (one object instead of three).
13921
13922- Bug #951851: Python crashed when reading import table of certain
13923 Windows DLLs.
13924
13925- Bug #215126. The locals argument to eval(), execfile(), and exec now
13926 accept any mapping type.
13927
13928- marshal now shares interned strings. This change introduces
13929 a new .pyc magic.
13930
13931- Bug #966623. classes created with type() in an exec(, {}) don't
13932 have a __module__, but code in typeobject assumed it would always
13933 be there.
13934
13935- Python no longer relies on the LC_NUMERIC locale setting to be
13936 the "C" locale; as a result, it no longer tries to prevent changing
13937 the LC_NUMERIC category.
13938
13939- Bug #952807: Unpickling pickled instances of subclasses of
13940 datetime.date, datetime.datetime and datetime.time could yield insane
13941 objects. Thanks to Jiwon Seo for a fix.
13942
13943- Bug #845802: Python crashes when __init__.py is a directory.
13944
13945- Unicode objects received two new methods: iswide() and width().
13946 These query East Asian width information, as specified in Unicode
13947 TR11.
13948
13949- Improved the tuple hashing algorithm to give fewer collisions in
13950 common cases. Fixes bug #942952.
13951
13952- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
13953
13954- Enabled the profiling of C extension functions (and builtins) - check
13955 new documentation and modified profile and bdb modules for more details
13956
13957- Set file.name to the object passed to open (instead of a new string)
13958
13959- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
13960
13961- Optimized the byte coding for multiple assignments like "a,b=b,a" and
13962 "a,b,c=1,2,3". Improves their speed by 25% to 30%.
13963
13964- Limit the nested depth of a tuple for the second argument to isinstance()
13965 and issubclass() to the recursion limit of the interpreter.
13966 Fixes bug #858016 .
13967
13968- Optimized dict iterators, creating separate types for each
13969 and having them reveal their length. Also optimized the
13970 methods: keys(), values(), and items().
13971
13972- Implemented a newcode opcode, LIST_APPEND, that simplifies
13973 the generated bytecode for list comprehensions and further
13974 improves their performance (about 35%).
13975
13976- Implemented rich comparisons for floats, which seems to make
13977 comparisons involving NaNs somewhat less surprising when the
13978 underlying C compiler actually implements C99 semantics.
13979
13980- Optimized list.extend() to save memory and no longer create
13981 intermediate sequences. Also, extend() now pre-allocates the
13982 needed memory whenever the length of the iterable is known in
13983 advance -- this halves the time to extend the list.
13984
13985- Optimized list resize operations to make fewer calls to the system
13986 realloc(). Significantly speeds up list appends, list pops,
13987 list comprehensions, and the list constructor (when the input iterable
13988 length is not known).
13989
13990- Changed the internal list over-allocation scheme. For larger lists,
13991 overallocation ranged between 3% and 25%. Now, it is a constant 12%.
13992 For smaller lists (n<8), overallocation was upto eight elements. Now,
13993 the overallocation is no more than three elements -- this improves space
13994 utilization for applications that have large numbers of small lists.
13995
13996- Most list bodies now get re-used rather than freed. Speeds up list
13997 instantiation and deletion by saving calls to malloc() and free().
13998
13999- The dict.update() method now accepts all the same argument forms
14000 as the dict() constructor. This now includes item lists and/or
14001 keyword arguments.
14002
14003- Support for arbitrary objects supporting the read-only buffer
14004 interface as the co_code field of code objects (something that was
14005 only possible to create from C code) has been removed.
14006
14007- Made omitted callback and None equivalent for weakref.ref() and
14008 weakref.proxy(); the None case wasn't handled correctly in all
14009 cases.
14010
14011- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
14012 assumed that initial existing entries in an object's weakref list
14013 would not be removed while allocating a new weakref object. Since
14014 GC could be invoked at that time, however, that assumption was
14015 invalid. In a truly obscure case of GC being triggered during
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030014016 creation for a new weakref object for a referent which already
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014017 has a weakref without a callback which is only referenced from
14018 cyclic trash, a memory error can occur. This consistently created a
14019 segfault in a debug build, but provided less predictable behavior in
14020 a release build.
14021
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014022- input() built-in function now respects compiler flags such as
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014023 __future__ statements. SF patch 876178.
14024
14025- Removed PendingDeprecationWarning from apply(). apply() remains
14026 deprecated, but the nuisance warning will not be issued.
14027
14028- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
14029 collection twice, both before and after tearing down modules. The
14030 call after tearing down modules has been disabled, because too much
14031 of Python has been torn down then for __del__ methods and weakref
14032 callbacks to execute sanely. The most common symptom was a sequence
14033 of uninformative messages on stderr when Python shut down, produced
14034 by threads trying to raise exceptions, but unable to report the nature
14035 of their problems because too much of the sys module had already been
14036 destroyed.
14037
14038- Removed FutureWarnings related to hex/oct literals and conversions
14039 and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
14040 This addresses most of the remaining semantic changes promised by
14041 PEP 237, except for repr() of a long, which still shows the trailing
14042 'L'. The PEP appears to promise warnings for operations that
14043 changed semantics compared to Python 2.3, but this is not
14044 implemented; we've suffered through enough warnings related to
14045 hex/oct literals and I think it's best to be silent now.
14046
14047- For str and unicode objects, the ljust(), center(), and rjust()
14048 methods now accept an optional argument specifying a fill
14049 character other than a space.
14050
14051- When method objects have an attribute that can be satisfied either
14052 by the function object or by the method object, the function
14053 object's attribute usually wins. Christian Tismer pointed out that
Serhiy Storchaka56a6d852014-12-01 18:28:43 +020014054 this is really a mistake, because this only happens for special
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014055 methods (like __reduce__) where the method object's version is
14056 really more appropriate than the function's attribute. So from now
14057 on, all method attributes will have precedence over function
14058 attributes with the same name.
14059
14060- Critical bugfix, for SF bug 839548: if a weakref with a callback,
14061 its callback, and its weakly referenced object, all became part of
14062 cyclic garbage during a single run of garbage collection, the order
14063 in which they were torn down was unpredictable. It was possible for
14064 the callback to see partially-torn-down objects, leading to immediate
14065 segfaults, or, if the callback resurrected garbage objects, to
14066 resurrect insane objects that caused segfaults (or other surprises)
14067 later. In one sense this wasn't surprising, because Python's cyclic gc
14068 had no knowledge of Python's weakref objects. It does now. When
14069 weakrefs with callbacks become part of cyclic garbage now, those
14070 weakrefs are cleared first. The callbacks don't trigger then,
14071 preventing the problems. If you need callbacks to trigger, then just
14072 as when cyclic gc is not involved, you need to write your code so
14073 that weakref objects outlive the objects they weakly reference.
14074
14075- Critical bugfix, for SF bug 840829: if cyclic garbage collection
14076 happened to occur during a weakref callback for a new-style class
14077 instance, subtle memory corruption was the result (in a release build;
14078 in a debug build, a segfault occurred reliably very soon after).
14079 This has been repaired.
14080
14081- Compiler flags set in PYTHONSTARTUP are now active in __main__.
14082
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014083- Added two built-in types, set() and frozenset().
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014084
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014085- Added a reversed() built-in function that returns a reverse iterator
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014086 over a sequence.
14087
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014088- Added a sorted() built-in function that returns a new sorted list
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014089 from any iterable.
14090
14091- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
14092
14093- list.sort() now supports three keyword arguments: cmp, key, and reverse.
14094 The key argument can be a function of one argument that extracts a
14095 comparison key from the original record: mylist.sort(key=str.lower).
14096 The reverse argument is a boolean value and if True will change the
14097 sort order as if the comparison arguments were reversed. In addition,
14098 the documentation has been amended to provide a guarantee that all sorts
14099 starting with Py2.3 are guaranteed to be stable (the relative order of
14100 records with equal keys is unchanged).
14101
14102- Added test whether wchar_t is signed or not. A signed wchar_t is not
14103 usable as internal unicode type base for Py_UNICODE since the
14104 unicode implementation assumes an unsigned type.
14105
14106- Fixed a bug in the cache of length-one Unicode strings that could
14107 lead to a seg fault. The specific problem occurred when an earlier,
14108 non-fatal error left an uninitialized Unicode object in the
14109 freelist.
14110
14111- The % formatting operator now supports '%F' which is equivalent to
14112 '%f'. This has always been documented but never implemented.
14113
14114- complex(obj) could leak a little memory if obj wasn't a string or
14115 number.
14116
14117- zip() with no arguments now returns an empty list instead of raising
14118 a TypeError exception.
14119
14120- obj.__contains__() now returns True/False instead of 1/0. SF patch
14121 820195.
14122
14123- Python no longer tries to be smart about recursive comparisons.
14124 When comparing containers with cyclic references to themselves it
14125 will now just hit the recursion limit. See SF patch 825639.
14126
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014127- str and unicode built-in types now have an rsplit() method that is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014128 same as split() except that it scans the string from the end
14129 working towards the beginning. See SF feature request 801847.
14130
14131- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
14132 to clear the error when attempts to get the __getstate__ attribute
14133 fail caused intermittent errors and odd behavior.
14134
14135- buffer objects based on other objects no longer cache a pointer to
14136 the data and the data length. Instead, the appropriate tp_as_buffer
14137 method is called as necessary.
14138
14139- fixed: if a file is opened with an explicit buffer size >= 1, repeated
14140 close() calls would attempt to free() the buffer already free()ed on
14141 the first call.
14142
14143
14144Extension modules
14145-----------------
14146
14147- Added socket.getservbyport(), and make the second argument in
14148 getservbyname() and getservbyport() optional.
14149
14150- time module code that deals with input POSIX timestamps will now raise
14151 ValueError if more than a second is lost in precision when the
14152 timestamp is cast to the platform C time_t type. There's no chance
14153 that the platform will do anything sensible with the result in such
14154 cases. This includes ctime(), localtime() and gmtime(). Assorted
14155 fromtimestamp() and utcfromtimestamp() methods in the datetime module
14156 were also protected. Closes bugs #919012 and 975996.
14157
14158- fcntl.ioctl now warns if the mutate flag is not specified.
14159
Martin Panterc04fb562016-02-10 05:44:01 +000014160- nt now properly allows referring to UNC roots, e.g. in nt.stat().
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014161
14162- the weakref module now supports additional objects: array.array,
14163 sre.pattern_objects, file objects, and sockets.
14164
14165- operator.isMappingType() and operator.isSequenceType() now give
14166 fewer false positives.
14167
14168- socket.sslerror is now a subclass of socket.error . Also added
14169 socket.error to the socket module's C API.
14170
14171- Bug #920575: A problem where the _locale module segfaults on
14172 nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
14173
14174- array objects now support the copy module. Also, their resizing
14175 scheme has been updated to match that used for list objects. This improves
14176 the performance (speed and memory usage) of append() operations.
14177 Also, array.array() and array.extend() now accept any iterable argument
14178 for repeated appends without needing to create another temporary array.
14179
14180- cStringIO.writelines() now accepts any iterable argument and writes
14181 the lines one at a time rather than joining them and writing once.
14182 Made a parallel change to StringIO.writelines(). Saves memory and
14183 makes suitable for use with generator expressions.
14184
14185- time.strftime() now checks that the values in its time tuple argument
14186 are within the proper boundaries to prevent possible crashes from the
14187 platform's C library implementation of strftime(). Can possibly
14188 break code that uses values outside the range that didn't cause
14189 problems previously (such as sitting day of year to 0). Fixes bug
14190 #897625.
14191
14192- The socket module now supports Bluetooth sockets, if the
14193 system has <bluetooth/bluetooth.h>
14194
14195- Added a collections module containing a new datatype, deque(),
14196 offering high-performance, thread-safe, memory friendly appends
14197 and pops on either side of the deque.
14198
14199- Several modules now take advantage of collections.deque() for
14200 improved performance: Queue, mutex, shlex, threading, and pydoc.
14201
14202- The operator module has two new functions, attrgetter() and
14203 itemgetter() which are useful for creating fast data extractor
14204 functions for map(), list.sort(), itertools.groupby(), and
14205 other functions that expect a function argument.
14206
14207- socket.SHUT_{RD,WR,RDWR} was added.
14208
14209- os.getsid was added.
14210
14211- The pwd module incorrectly advertised its struct type as
14212 struct_pwent; this has been renamed to struct_passwd. (The old name
14213 is still supported for backwards compatibility.)
14214
14215- The xml.parsers.expat module now provides Expat 1.95.7.
14216
14217- socket.IPPROTO_IPV6 was added.
14218
14219- readline.clear_history was added.
14220
14221- select.select() now accepts sequences for its first three arguments.
14222
14223- cStringIO now supports the f.closed attribute.
14224
14225- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
14226
14227- curses module now supports use_default_colors(). [patch #739124]
14228
14229- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
14230
14231- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
14232
14233- Implemented non-recursive SRE matching scheme (#757624).
14234
14235- Implemented (?(id/name)yes|no) support in SRE (#572936).
14236
14237- random.seed() with no arguments or None uses time.time() as a default
14238 seed. Modified to match Py2.2 behavior and use fractional seconds so
14239 that successive runs are more likely to produce different sequences.
14240
14241- random.Random has a new method, getrandbits(k), which returns an int
14242 with k random bits. This method is now an optional part of the API
14243 for user defined generators. Any generator that defines genrandbits()
14244 can now use randrange() for ranges with a length >= 2**53. Formerly,
14245 randrange would return only even numbers for ranges that large (see
14246 SF bug #812202). Generators that do not define genrandbits() now
14247 issue a warning when randrange() is called with a range that large.
14248
14249- itertools has a new function, groupby() for aggregating iterables
14250 into groups sharing the same key (as determined by a key function).
14251 It offers some of functionality of SQL's groupby keyword and of
14252 the Unix uniq filter.
14253
14254- itertools now has a new tee() function which produces two independent
14255 iterators from a single iterable.
14256
14257- itertools.izip() with no arguments now returns an empty iterator instead
14258 of raising a TypeError exception.
14259
14260- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
14261 as parameter.
14262
14263Library
14264-------
14265
14266- Added a new module: cProfile, a C profiler with the same interface as the
14267 profile module. cProfile avoids some of the drawbacks of the hotshot
14268 profiler and provides a bit more information than the other two profilers.
14269 Based on "lsprof" (patch #1212837).
14270
14271- Bug #1266283: The new function "lexists" is now in os.path.__all__.
14272
14273- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
14274 the documented behavior: the function passed to the onerror()
14275 handler can now also be os.listdir.
14276
14277- Bug #754449: threading.Thread objects no longer mask exceptions raised during
14278 interpreter shutdown with another exception from attempting to handle the
14279 original exception.
14280
14281- Added decimal.py per PEP 327.
14282
14283- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
14284 "netloc" portion of a URL.
14285
14286- Bug #919012: shutil.move() will not try to move a directory into itself.
14287 Thanks Johannes Gijsbers.
14288
14289- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
14290
14291- Bug #823209: cmath.log() now takes an optional base argument so that its
14292 API matches math.log().
14293
14294- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
14295 that generate a -debuginfo.rpm
14296
14297- os.path.devnull has been added for all supported platforms.
14298
14299- Fixed #877165: distutils now picks the right C++ compiler command
14300 on cygwin and mingw32.
14301
14302- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
14303
14304- refactored site.py into functions. Also wrote regression tests for the
14305 module.
14306
14307- The distutils install command now supports the --home option and
14308 installation scheme for all platforms.
14309
14310- asyncore.loop now has a repeat count parameter that defaults to
14311 looping forever.
14312
14313- The distutils sdist command now ignores all .svn directories, in
14314 addition to CVS and RCS directories. .svn directories hold
14315 administrative files for the Subversion source control system.
14316
14317- Added a new module: cookielib. Automatic cookie handling for HTTP
14318 clients. Also, support for cookielib has been added to urllib2, so
14319 urllib2.urlopen() can transparently handle cookies.
14320
14321- stringprep.py now uses built-in set() instead of sets.Set().
14322
14323- Bug #876278: Unbounded recursion in modulefinder
14324
14325- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
14326 Applications relying on the wrong order need to be corrected.
14327
14328- Bug #926075: Fixed a bug that returns a wrong pattern object
14329 for a string or unicode object in sre.compile() when a different
14330 type pattern with the same value exists.
14331
14332- Added countcallers arg to trace.Trace class (--trackcalls command line arg
14333 when run from the command prompt).
14334
14335- Fixed a caching bug in platform.platform() where the argument of 'terse' was
14336 not taken into consideration when caching value.
14337
14338- Added two new command-line arguments for profile (output file and
14339 default sort).
14340
14341- Added global runctx function to profile module
14342
14343- Add hlist missing entryconfigure and entrycget methods.
14344
14345- The ptcp154 codec was added for Kazakh character set support.
14346
14347- Support non-anonymous ftp URLs in urllib2.
14348
14349- The encodings package will now apply codec name aliases
14350 first before starting to try the import of the codec module.
14351 This simplifies overriding built-in codecs with external
14352 packages, e.g. the included CJK codecs with the JapaneseCodecs
14353 package, by adjusting the aliases dictionary in encodings.aliases
14354 accordingly.
14355
14356- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
14357 decoding standards.
14358
14359- urllib2 now supports processors. A processor is a handler that
14360 implements an xxx_request or xxx_response method. These methods are
14361 called for all requests.
14362
14363- distutils compilers now compile source files in the same order as
14364 they are passed to the compiler.
14365
14366- pprint.pprint() and pprint.pformat() now have additional parameters
14367 indent, width and depth.
14368
14369- Patch #750542: pprint now will pretty print subclasses of list, tuple
14370 and dict too, as long as they don't overwrite __repr__().
14371
14372- Bug #848614: distutils' msvccompiler fails to find the MSVC6
14373 compiler because of incomplete registry entries.
14374
14375- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
14376
14377- Patch #841977: modulefinder didn't find extension modules in packages
14378
14379- imaplib.IMAP4.thread was added.
14380
14381- Plugged a minor hole in tempfile.mktemp() due to the use of
14382 os.path.exists(), switched to using os.lstat() directly if possible.
14383
14384- bisect.py and heapq.py now have underlying C implementations
14385 for better performance.
14386
14387- heapq.py has two new functions, nsmallest() and nlargest().
14388
14389- traceback.format_exc has been added (similar to print_exc but it returns
14390 a string).
14391
14392- xmlrpclib.MultiCall has been added.
14393
14394- poplib.POP3_SSL has been added.
14395
14396- tmpfile.mkstemp now returns an absolute path even if dir is relative.
14397
14398- urlparse is RFC 2396 compliant.
14399
14400- The fieldnames argument to the csv module's DictReader constructor is now
14401 optional. If omitted, the first row of the file will be used as the
14402 list of fieldnames.
14403
14404- encodings.bz2_codec was added for access to bz2 compression
14405 using "a long string".encode('bz2')
14406
14407- Various improvements to unittest.py, realigned with PyUnit CVS.
14408
14409- dircache now passes exceptions to the caller, instead of returning
14410 empty lists.
14411
14412- The bsddb module and dbhash module now support the iterator and
14413 mapping protocols which make them more substitutable for dictionaries
14414 and shelves.
14415
14416- The csv module's DictReader and DictWriter classes now accept keyword
14417 arguments. This was an omission in the initial implementation.
14418
14419- The email package handles some RFC 2231 parameters with missing
14420 CHARSET fields better. It also includes a patch to parameter
14421 parsing when semicolons appear inside quotes.
14422
14423- sets.py now runs under Py2.2. In addition, the argument restrictions
14424 for most set methods (but not the operators) have been relaxed to
14425 allow any iterable.
14426
14427- _strptime.py now has a behind-the-scenes caching mechanism for the most
14428 recent TimeRE instance used along with the last five unique directive
14429 patterns. The overall module was also made more thread-safe.
14430
14431- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
14432 and removed in Py2.4.
14433
14434- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
14435
14436- Patch #873597: CJK codecs are imported into rank of default codecs.
14437
14438Tools/Demos
14439-----------
14440
14441- A hotshotmain script was added to the Tools/scripts directory that
14442 makes it easy to run a script under control of the hotshot profiler.
14443
14444- The db2pickle and pickle2db scripts can now dump/load gdbm files.
14445
14446- The file order on the command line of the pickle2db script was reversed.
14447 It is now [ picklefile ] dbfile. This provides better symmetry with
14448 db2pickle. The file arguments to both scripts are now source followed by
14449 destination in situations where both files are given.
14450
14451- The pydoc script will display a link to the module documentation for
14452 modules determined to be part of the core distribution. The documentation
14453 base directory defaults to http://www.python.org/doc/current/lib/ but can
14454 be changed by setting the PYTHONDOCS environment variable.
14455
14456- texcheck.py now detects double word errors.
14457
14458- md5sum.py mistakenly opened input files in text mode by default, a
14459 silent and dangerous change from previous releases. It once again
14460 opens input files in binary mode by default. The -t and -b flags
14461 remain for compatibility with the 2.3 release, but -b is the default
14462 now.
14463
14464- py-electric-colon now works when pending-delete/delete-selection mode is
14465 in effect
14466
14467- py-help-at-point is no longer bound to the F1 key - it's still bound to
14468 C-c C-h
14469
14470- Pynche was fixed to not crash when there is no ~/.pynche file and no
14471 -d option was given.
14472
14473Build
14474-----
14475
14476- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
14477 build under OS X.
14478
14479- Profiling using gprof is now available if Python is configured with
14480 --enable-profiling.
14481
14482- Profiling the VM using the Pentium TSC is now possible if Python
14483 is configured --with-tsc.
14484
14485- In order to find libraries, setup.py now also looks in /lib64, for use
14486 on AMD64.
14487
14488- Bug #934635: Fixed a bug where the configure script couldn't detect
14489 getaddrinfo() properly if the KAME stack had SCTP support.
14490
14491- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
14492 removed.
14493
14494- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
14495 supported (see PEP 11).
14496
14497- Universal newline support can no longer be disabled (see PEP 11).
14498
14499- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
14500
14501- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
14502 (see PEP 11).
14503
14504- Tests for sizeof(char) were removed since ANSI C mandates that
14505 sizeof(char) must be 1.
14506
14507C API
14508-----
14509
14510- Thanks to Anthony Tuininga, the datetime module now supplies a C API
14511 containing type-check macros and constructors. See new docs in the
14512 Python/C API Reference Manual for details.
14513
14514- Private function _PyTime_DoubleToTimet added, to convert a Python
14515 timestamp (C double) to platform time_t with some out-of-bounds
14516 checking. Declared in new header file timefuncs.h. It would be
14517 good to expose some other internal timemodule.c functions there.
14518
14519- New public functions PyEval_EvaluateFrame and PyGen_New to expose
14520 generator objects.
14521
14522- New public functions Py_IncRef() and Py_DecRef(), exposing the
14523 functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
14524 runtime dynamic embedding of Python. See patch #938302, by Bob
14525 Ippolito.
14526
14527- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
14528 underlying array of PyObject pointers. Useful for high speed looping.
14529
14530- Created a new method flag, METH_COEXIST, which causes a method to be loaded
14531 even if already defined by a slot wrapper. This allows a __contains__
14532 method, for example, to co-exist with a defined sq_contains slot. This
14533 is helpful because the PyCFunction can take advantage of optimized calls
14534 whenever METH_O or METH_NOARGS flags are defined.
14535
14536- Added a new function, PyDict_Contains(d, k) which is like
14537 PySequence_Contains() but is specific to dictionaries and executes
14538 about 10% faster.
14539
14540- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
14541 Each return the singleton they mention after Py_INCREF()ing them.
14542
14543- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
14544 variable length argument list of Python objects without having to invoke
14545 the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
14546 is equivalent to Py_BuildValue("(OOO)", a, b, c).
14547
14548Windows
14549-------
14550
14551- The _winreg module could segfault when reading very large registry
14552 values, due to unchecked alloca() calls (SF bug 851056). The fix is
14553 uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
14554 as appropriate, followed by a size check.
14555
14556- file.truncate() could misbehave if the file was open for update
14557 (modes r+, rb+, w+, wb+), and the most recent file operation before
14558 the truncate() call was an input operation. SF bug 801631.
14559
14560
14561What's New in Python 2.3 final?
14562===============================
14563
14564*Release date: 29-Jul-2003*
14565
14566IDLE
14567----
14568
14569- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
14570 This was unique to Windows, and was fixed by adding an -n switch to
14571 the command the Windows installer creates to execute "Edit with IDLE"
14572 context-menu actions.
14573
14574- IDLE displays a new message upon startup: some "personal firewall"
14575 kinds of programs (for example, ZoneAlarm) open a dialog of their
14576 own when any program opens a socket. IDLE does use sockets, talking
14577 on the computer's internal loopback interface. This connection is not
14578 visible on any external interface and no data is sent to or received
14579 from the Internet. So, if you get such a dialog when opening IDLE,
14580 asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
14581 and rest assured no communication external to your machine is taking
14582 place. If you don't allow it, IDLE won't be able to start.
14583
14584
14585What's New in Python 2.3 release candidate 2?
14586=============================================
14587
14588*Release date: 24-Jul-2003*
14589
14590Core and builtins
14591-----------------
14592
14593- It is now possible to import from zipfiles containing additional
14594 data bytes before the zip compatible archive. Zipfiles containing a
14595 comment at the end are still unsupported.
14596
14597Extension modules
14598-----------------
14599
14600- A longstanding bug in the parser module's initialization could cause
14601 fatal internal refcount confusion when the module got initialized more
14602 than once. This has been fixed.
14603
14604- Fixed memory leak in pyexpat; using the parser's ParseFile() method
14605 with open files that aren't instances of the standard file type
14606 caused an instance of the bound .read() method to be leaked on every
14607 call.
14608
14609- Fixed some leaks in the locale module.
14610
14611Library
14612-------
14613
14614- Lib/encodings/rot_13.py when used as a script, now more properly
14615 uses the first Python interpreter on your path.
14616
14617- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
14618 fix a locale related bug in the test suite. Although another patch
14619 was needed to actually fix the problem, the cache code was not
14620 restored.
14621
14622IDLE
14623----
14624
14625- Calltips patches.
14626
14627Build
14628-----
14629
14630- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
14631 on Panther (OSX 10.3).
14632
14633C API
14634-----
14635
14636Windows
14637-------
14638
14639- The tempfile module could do insane imports on Windows if PYTHONCASEOK
14640 was set, making temp file creation impossible. Repaired.
14641
14642- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
14643
14644Mac
14645---
14646
14647- Various fixes to pimp.
14648
14649- Scripts runs with pythonw no longer had full window manager access.
14650
14651- Don't force boot-disk-only install, for reasons unknown it causes
14652 more problems than it solves.
14653
14654
14655What's New in Python 2.3 release candidate 1?
14656=============================================
14657
14658*Release date: 18-Jul-2003*
14659
14660Core and builtins
14661-----------------
14662
14663- The new function sys.getcheckinterval() returns the last value set
14664 by sys.setcheckinterval().
14665
14666- Several bugs in the symbol table phase of the compiler have been
14667 fixed. Errors could be lost and compilation could fail without
14668 reporting an error. SF patch 763201.
14669
14670- The interpreter is now more robust about importing the warnings
14671 module. In an executable generated by freeze or similar programs,
14672 earlier versions of 2.3 would fail if the warnings module could
14673 not be found on the file system. Fixes SF bug 771097.
14674
14675- A warning about assignments to module attributes that shadow
14676 builtins, present in earlier releases of 2.3, has been removed.
14677
Georg Brandl93dc9eb2010-03-14 10:56:14 +000014678- It is not possible to create subclasses of built-in types like str
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000014679 and tuple that define an itemsize. Earlier releases of Python 2.3
14680 allowed this by mistake, leading to crashes and other problems.
14681
14682- The thread_id is now initialized to 0 in a non-thread build. SF bug
14683 770247.
14684
14685- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
14686
14687Extension modules
14688-----------------
14689
14690- weakref.proxy() can now handle "del obj[i]" for proxy objects
14691 defining __delitem__. Formerly, it generated a SystemError.
14692
14693- SSL no longer crashes the interpreter when the remote side disconnects.
14694
14695- On Unix the mmap module can again be used to map device files.
14696
14697- time.strptime now exclusively uses the Python implementation
14698 contained within the _strptime module.
14699
14700- The print slot of weakref proxy objects was removed, because it was
14701 not consistent with the object's repr slot.
14702
14703- The mmap module only checks file size for regular files, not
14704 character or block devices. SF patch 708374.
14705
14706- The cPickle Pickler garbage collection support was fixed to traverse
14707 the find_class attribute, if present.
14708
14709- There are several fixes for the bsddb3 wrapper module.
14710
14711 bsddb3 no longer crashes if an environment is closed before a cursor
14712 (SF bug 763298).
14713
14714 The DB and DBEnv set_get_returns_none function was extended to take
14715 a level instead of a boolean flag. The new level 2 means that in
14716 addition, cursor.set()/.get() methods return None instead of raising
14717 an exception.
14718
14719 A typo was fixed in DBCursor.join_item(), preventing a crash.
14720
14721Library
14722-------
14723
14724- distutils now supports MSVC 7.1
14725
14726- doctest now examines all docstrings by default. Previously, it would
14727 skip over functions with private names (as indicated by the underscore
14728 naming convention). The old default created too much of a risk that
14729 user tests were being skipped inadvertently. Note, this change could
14730 break code in the unlikely case that someone had intentionally put
14731 failing tests in the docstrings of private functions. The breakage
14732 is easily fixable by specifying the old behavior when calling testmod()
14733 or Tester().
14734
14735- There were several fixes to the way dumbdbms are closed. It's vital
14736 that a dumbdbm database be closed properly, else the on-disk data
14737 and directory files can be left in mutually inconsistent states.
14738 dumbdbm.py's _Database.__del__() method attempted to close the
14739 database properly, but a shutdown race in _Database._commit() could
14740 prevent this from working, so that a program trusting __del__() to
14741 get the on-disk files in synch could be badly surprised. The race
14742 has been repaired. A sync() method was also added so that shelve
14743 can guarantee data is written to disk.
14744
14745 The close() method can now be called more than once without complaint.
14746
14747- The classes in threading.py are now new-style classes. That they
14748 weren't before was an oversight.
14749
14750- The urllib2 digest authentication handlers now define the correct
14751 auth_header. The earlier versions would fail at runtime.
14752
14753- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
14754 when there are no lines.
14755
14756- SF bug 763637: fix exception in Tkinter with after_cancel
14757 which could occur with Tk 8.4
14758
14759- SF bug 770601: CGIHTTPServer.py now passes the entire environment
14760 to child processes.
14761
14762- SF bug 765238: add filter to fnmatch's __all__.
14763
14764- SF bug 748201: make time.strptime() error messages more helpful.
14765
14766- SF patch 764470: Do not dump the args attribute of a Fault object in
14767 xmlrpclib.
14768
14769- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
14770 responses.
14771
14772- SF patch 766650: The whichdb module was fixed to recognize dbm files
14773 generated by gdbm on OS/2 EMX.
14774
14775- SF bugs 763047 and 763052: fixes bug of timezone value being left as
14776 -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
14777 is true when it should only when time.daylight is true.
14778
14779- SF bug 764548: re now allows subclasses of str and unicode to be
14780 used as patterns.
14781
14782- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
14783 of varying sizes. Tk 8.4 returns a different number of values
14784 than Tk 8.3.
14785
14786- SF bug 763023: difflib.ratio() did not catch zero division.
14787
14788- The Queue module now has an __all__ attribute.
14789
14790Tools/Demos
14791-----------
14792
14793- See Lib/idlelib/NEWS.txt for IDLE news.
14794
14795- SF bug 753592: webchecker/wsgui now handles user supplied directories.
14796
14797- The trace.py script has been removed. It is now in the standard library.
14798
14799Build
14800-----
14801
14802- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
14803
14804- The socket module compiles on IRIX 6.5.10.
14805
14806- An irix64 system is treated the same way as an irix6 system (SF
14807 patch 764560).
14808
14809- Several definitions were missing on FreeBSD 5.x unless the
14810 __BSD_VISIBLE symbol was defined. configure now defines it as
14811 needed.
14812
14813C API
14814-----
14815
14816- Unicode objects now support mbcs as a built-in encoding, so the C
14817 API can use it without deferring to the encodings package.
14818
14819Windows
14820-------
14821
14822- The Windows implementation of PyThread_start_new_thread() never
14823 checked error returns from Windows functions correctly. As a result,
14824 it could claim to start a new thread even when the Microsoft
14825 _beginthread() function failed (due to "too many threads" -- this is
14826 on the order of thousands when it happens). In these cases, the
14827 Python exception ::
14828
14829 thread.error: can't start new thread
14830
14831 is raised now.
14832
14833- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
14834 use. The interpreter now calls WSACleanup() from Py_Finalize()
14835 instead of from DLL teardown.
14836
14837Mac
14838---
14839
14840- Bundlebuilder now inherits default values in the right way. It was
14841 previously possible for app bundles to get a type of "BNDL" instead
14842 of "APPL." Other improvements include, a --build-id option to
14843 specify the CFBundleIdentifier and using the --python option to set
14844 the executable in the bundle.
14845
14846- Fixed two bugs in MacOSX framework handling.
14847
14848- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
14849
14850- Python is now compiled with -mno-fused-madd, making all tests pass
14851 on Panther.
14852
14853What's New in Python 2.3 beta 2?
14854================================
14855
14856*Release date: 29-Jun-2003*
14857
14858Core and builtins
14859-----------------
14860
14861- A program can now set the environment variable PYTHONINSPECT to some
14862 string value in Python, and cause the interpreter to enter the
14863 interactive prompt at program exit, as if Python had been invoked
14864 with the -i option.
14865
14866- list.index() now accepts optional start and stop arguments. Similar
14867 changes were made to UserList.index(). SF feature request 754014.
14868
14869- SF patch 751998 fixes an unwanted side effect of the previous fix
14870 for SF bug 742860 (the next item).
14871
14872- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
14873 wasn't threadsafe, was very inefficient (expected time O(len(dict))
14874 instead of O(1)), and could raise a spurious RuntimeError if another
14875 thread mutated the dict during __delitem__, or if a comparison function
14876 mutated it. It also neglected to raise KeyError when the key wasn't
14877 present; didn't raise TypeError when the key wasn't of a weakly
14878 referencable type; and broke various more-or-less obscure dict
14879 invariants by using a sequence of equality comparisons over the whole
14880 set of dict keys instead of computing the key's hash code to narrow
14881 the search to those keys with the same hash code. All of these are
14882 considered to be bugs. A new implementation of __delitem__ repairs all
14883 that, but note that fixing these bugs may change visible behavior in
14884 code relying (whether intentionally or accidentally) on old behavior.
14885
14886- SF bug 734869: Fixed a compiler bug that caused a fatal error when
14887 compiling a list comprehension that contained another list comprehension
14888 embedded in a lambda expression.
14889
14890- SF bug 705231: builtin pow() no longer lets the platform C pow()
14891 raise -1.0 to integer powers, because (at least) glibc gets it wrong
14892 in some cases. The result should be -1.0 if the power is odd and 1.0
14893 if the power is even, and any float with a sufficiently large exponent
14894 is (mathematically) an exact even integer.
14895
14896- SF bug 759227: A new-style class that implements __nonzero__() must
14897 return a bool or int (but not an int subclass) from that method. This
14898 matches the restriction on classic classes.
14899
14900- The encoding attribute has been added for file objects, and set to
14901 the terminal encoding on Unix and Windows.
14902
14903- The softspace attribute of file objects became read-only by oversight.
14904 It's writable again.
14905
14906- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
14907 tuple. By default, the iterators now access data elements directly
14908 instead of going through __getitem__. If __getitem__ access is
14909 preferred, then __iter__ can be overridden.
14910
14911- SF bug 735247: The staticmethod and super types participate in
14912 garbage collection. Before this change, it was possible for leaks to
14913 occur in functions with non-global free variables that used these types.
14914
14915Extension modules
14916-----------------
14917
14918- the socket module has a new exception, socket.timeout, to allow
14919 timeouts to be handled separately from other socket errors.
14920
14921- SF bug 751276: cPickle has fixed to propagate exceptions raised in
14922 user code. In earlier versions, cPickle caught and ignored any
14923 exception when it performed operations that it expected to raise
14924 specific exceptions like AttributeError.
14925
14926- cPickle Pickler and Unpickler objects now participate in garbage
14927 collection.
14928
14929- mimetools.choose_boundary() could return duplicate strings at times,
14930 especially likely on Windows. The strings returned are now guaranteed
14931 unique within a single program run.
14932
14933- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
14934 dummy_thread has also been modified to try to simulate the behavior.
14935
14936- array.array.insert() now treats negative indices as being relative
14937 to the end of the array, just like list.insert() does. (SF bug #739313)
14938
14939- The datetime module classes datetime, time, and timedelta are now
14940 properly subclassable.
14941
14942- _tkinter.{get|set}busywaitinterval was added.
14943
14944- itertools.islice() now accepts stop=None as documented.
14945 Fixes SF bug #730685.
14946
14947- the bsddb185 module is built in one restricted instance -
14948 /usr/include/db.h exists and defines HASHVERSION to be 2. This is true
14949 for many BSD-derived systems.
14950
14951
14952Library
14953-------
14954
14955- Some happy doctest extensions from Jim Fulton have been added to
14956 doctest.py. These are already being used in Zope3. The two
14957 primary ones:
14958
14959 doctest.debug(module, name) extracts the doctests from the named object
14960 in the given module, puts them in a temp file, and starts pdb running
14961 on that file. This is great when a doctest fails.
14962
14963 doctest.DocTestSuite(module=None) returns a synthesized unittest
14964 TestSuite instance, to be run by the unittest framework, which
14965 runs all the doctests in the module. This allows writing tests in
14966 doctest style (which can be clearer and shorter than writing tests
14967 in unittest style), without losing unittest's powerful testing
14968 framework features (which doctest lacks).
14969
14970- For compatibility with doctests created before 2.3, if an expected
14971 output block consists solely of "1" and the actual output block
14972 consists solely of "True", it's accepted as a match; similarly
14973 for "0" and "False". This is quite un-doctest-like, but is practical.
14974 The behavior can be disabled by passing the new doctest module
14975 constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
14976 argument.
14977
14978- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
14979 a bare except caught to much and reported all errors as a problem
14980 in the archive.
14981
14982- The logging module now has a new function, makeLogRecord() making
14983 LogHandler easier to interact with DatagramHandler and SocketHandler.
14984
14985- The cgitb module has been extended to support plain text display (SF patch
14986 569574).
14987
14988- A brand new version of IDLE (from the IDLEfork project at
14989 SourceForge) is now included as Lib/idlelib. The old Tools/idle is
14990 no more.
14991
14992- Added a new module: trace (documentation missing). This module used
14993 to be distributed in Tools/scripts. It uses sys.settrace() to trace
14994 code execution -- either function calls or individual lines. It can
14995 generate tracing output during execution or a post-mortem report of
14996 code coverage.
14997
14998- The threading module has new functions settrace() and setprofile()
14999 that cooperate with the functions of the same name in the sys
15000 module. A function registered with the threading module will
15001 be used for all threads it creates. The new trace module uses this
15002 to provide tracing for code running in threads.
15003
15004- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
15005 Taschuk. Copying a new-style class that had a reference to itself
15006 didn't work. (The same thing worked fine for old-style classes.)
15007 Builtin functions are now treated as atomic, fixing bug #746304.
15008
15009- difflib.py has two new functions: context_diff() and unified_diff().
15010
15011- More fixes to urllib (SF 549151): (a) When redirecting, always use
15012 GET. This is common practice and more-or-less sanctioned by the
15013 HTTP standard. (b) Add a handler for 307 redirection, which becomes
15014 an error for POST, but a regular redirect for GET and HEAD
15015
15016- Added optional 'onerror' argument to os.walk(), to control error
15017 handling.
15018
15019- inspect.is{method|data}descriptor was added, to allow pydoc display
15020 __doc__ of data descriptors.
15021
15022- Fixed socket speed loss caused by use of the _socketobject wrapper class
15023 in socket.py.
15024
15025- timeit.py now checks the current directory for imports.
15026
15027- urllib2.py now knows how to order proxy classes, so the user doesn't
15028 have to insert it in front of other classes, nor do dirty tricks like
15029 inserting a "dummy" HTTPHandler after a ProxyHandler when building an
15030 opener with proxy support.
15031
15032- Iterators have been added for dbm keys.
15033
15034- random.Random objects can now be pickled.
15035
15036Tools/Demos
15037-----------
15038
15039- pydoc now offers help on keywords and topics.
15040
15041- Tools/idle is gone; long live Lib/idlelib.
15042
15043- diff.py prints file diffs in context, unified, or ndiff formats,
15044 providing a command line interface to difflib.py.
15045
15046- texcheck.py is a new script for making a rough validation of Python LaTeX
15047 files.
15048
15049Build
15050-----
15051
15052- Setting DESTDIR during 'make install' now allows specifying a
15053 different root directory.
15054
15055C API
15056-----
15057
15058- PyType_Ready(): If a type declares that it participates in gc
15059 (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
15060 tp_free slot is the default _PyObject_Del, and type does not define
15061 a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
15062 Previously _PyObject_Del was inherited, which could at best lead to a
15063 segfault. In addition, if even after this magic the type's tp_free
15064 slot is _PyObject_Del or NULL, and the type is a base type
15065 (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
15066 type, its dealloc function must call type->tp_free, and since the type
15067 is gc'able, tp_free must not be NULL or _PyObject_Del.
15068
15069- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
15070 from C) to interrupt a thread by sending it an exception. It is
15071 intentional that you have to write your own C extension to call it
15072 from Python.
15073
15074
15075New platforms
15076-------------
15077
15078None this time.
15079
15080Tests
15081-----
15082
15083- test_imp rewritten so that it doesn't raise RuntimeError if run as a
15084 side effect of being imported ("import test.autotest").
15085
15086Windows
15087-------
15088
15089- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
15090
15091- The installer always suggested that Python be installed on the C:
15092 drive, due to a hardcoded "C:" generated by the Wise installation
15093 wizard. People with machines where C: is not the system drive
15094 usually want Python installed on whichever drive is their system drive
15095 instead. We removed the hardcoded "C:", and two testers on machines
15096 where C: is not the system drive report that the installer now
15097 suggests their system drive. Note that you can always select the
15098 directory you want in the "Select Destination Directory" dialog --
15099 that's what it's for.
15100
15101Mac
15102---
15103
15104- There's a new module called "autoGIL", which offers a mechanism to
15105 automatically release the Global Interpreter Lock when an event loop
15106 goes to sleep, allowing other threads to run. It's currently only
15107 supported on OSX, in the Mach-O version.
15108- The OSA modules now allow direct access to properties of the
15109 toplevel application class (in AppleScript terminology).
15110- The Package Manager can now update itself.
15111
15112SourceForge Bugs and Patches Applied
15113------------------------------------
15114
15115430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
15116598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
15117622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
15118661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
15119683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
15120697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
15121713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
15122724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
15123727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
15124729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
15125730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
15126731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
15127732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
15128733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
15129735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
15130740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
15131744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
15132745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
15133747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
15134749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
15135751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
15136753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
15137755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
15138757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
15139760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
15140
15141
15142What's New in Python 2.3 beta 1?
15143================================
15144
15145*Release date: 25-Apr-2003*
15146
15147Core and builtins
15148-----------------
15149
15150- New format codes B, H, I, k and K have been implemented for
15151 PyArg_ParseTuple and PyBuild_Value.
15152
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015153- New built-in function sum(seq, start=0) returns the sum of all the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015154 items in iterable object seq, plus start (items are normally numbers,
15155 and cannot be strings).
15156
15157- bool() called without arguments now returns False rather than
15158 raising an exception. This is consistent with calling the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015159 constructors for the other built-in types -- called without argument
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015160 they all return the false value of that type. (SF patch #724135)
15161
15162- In support of PEP 269 (making the pgen parser generator accessible
15163 from Python), some changes to the pgen code structure were made; a
15164 few files that used to be linked only with pgen are now linked with
15165 Python itself.
15166
15167- The repr() of a weakref object now shows the __name__ attribute of
15168 the referenced object, if it has one.
15169
15170- super() no longer ignores data descriptors, except __class__. See
15171 the thread started at
15172 http://mail.python.org/pipermail/python-dev/2003-April/034338.html
15173
15174- list.insert(i, x) now interprets negative i as it would be
15175 interpreted by slicing, so negative values count from the end of the
15176 list. This was the only place where such an interpretation was not
15177 placed on a list index.
15178
15179- range() now works even if the arguments are longs with magnitude
15180 larger than sys.maxint, as long as the total length of the sequence
15181 fits. E.g., range(2**100, 2**101, 2**100) is the following list:
15182 [1267650600228229401496703205376L]. (SF patch #707427.)
15183
15184- Some horridly obscure problems were fixed involving interaction
15185 between garbage collection and old-style classes with "ambitious"
15186 getattr hooks. If an old-style instance didn't have a __del__ method,
15187 but did have a __getattr__ hook, and the instance became reachable
15188 only from an unreachable cycle, and the hook resurrected or deleted
15189 unreachable objects when asked to resolve "__del__", anything up to
15190 a segfault could happen. That's been repaired.
15191
15192- dict.pop now takes an optional argument specifying a default
15193 value to return if the key is not in the dict. If a default is not
15194 given and the key is not found, a KeyError will still be raised.
15195 Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
15196 [SF patch #693753] (contributed by Michael Stone.)
15197
15198- sys.getfilesystemencoding() was added to expose
15199 Py_FileSystemDefaultEncoding.
15200
15201- New function sys.exc_clear() clears the current exception. This is
15202 rarely needed, but can sometimes be useful to release objects
15203 referenced by the traceback held in sys.exc_info()[2]. (SF patch
15204 #693195.)
15205
15206- On 64-bit systems, a dictionary could contain duplicate long/int keys
15207 if the key value was larger than 2**32. See SF bug #689659.
15208
15209- Fixed SF bug #663074. The codec system was using global static
15210 variables to store internal data. As a result, any attempts to use the
15211 unicode system with multiple active interpreters, or successive
15212 interpreter executions, would fail.
15213
15214- "%c" % u"a" now returns a unicode string instead of raising a
Martin Panter7462b6492015-11-02 03:37:02 +000015215 TypeError. u"%c" % 0xffffffff now raises an OverflowError instead
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015216 of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
15217
15218Extension modules
15219-----------------
15220
15221- The socket module now provides the functions inet_pton and inet_ntop
15222 for converting between string and packed representation of IP
15223 addresses. There is also a new module variable, has_ipv6, which is
15224 True iff the current Python has IPv6 support. See SF patch #658327.
15225
15226- Tkinter wrappers around Tcl variables now pass objects directly
15227 to Tcl, instead of first converting them to strings.
15228
15229- The .*? pattern in the re module is now special-cased to avoid the
15230 recursion limit. (SF patch #720991 -- many thanks to Gary Herron
15231 and Greg Chapman.)
15232
15233- New function sys.call_tracing() allows pdb to debug code
15234 recursively.
15235
15236- New function gc.get_referents(obj) returns a list of objects
15237 directly referenced by obj. In effect, it exposes what the object's
15238 tp_traverse slot does, and can be helpful when debugging memory
15239 leaks.
15240
15241- The iconv module has been removed from this release.
15242
15243- The platform-independent routines for packing floats in IEEE formats
15244 (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
15245 pickling of floats) ignored that rounding can cause a carry to
15246 propagate. The worst consequence was that, in rare cases, <f and >f
15247 could produce strings that, when unpacked again, were a factor of 2
15248 away from the original float. This has been fixed. See SF bug
15249 #705836.
15250
15251- New function time.tzset() provides access to the C library tzset()
15252 function, if supported. (SF patch #675422.)
15253
15254- Using createfilehandler, deletefilehandler, createtimerhandler functions
15255 on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
15256 See SF bug #692416.
15257
15258- Modified the fcntl.ioctl() function to allow modification of a passed
15259 mutable buffer (for details see the reference documentation).
15260
15261- Made user requested changes to the itertools module.
15262 Subsumed the times() function into repeat().
15263 Added chain() and cycle().
15264
15265- The rotor module is now deprecated; the encryption algorithm it uses
15266 is not believed to be secure, and including crypto code with Python
15267 has implications for exporting and importing it in various countries.
15268
15269- The socket module now always uses the _socketobject wrapper class, even on
15270 platforms which have dup(2). The makefile() method is built directly
15271 on top of the socket without duplicating the file descriptor, allowing
15272 timeouts to work properly.
15273
15274Library
15275-------
15276
15277- New generator function os.walk() is an easy-to-use alternative to
15278 os.path.walk(). See os module docs for details. os.path.walk()
15279 isn't deprecated at this time, but may become deprecated in a
15280 future release.
15281
15282- Added new module "platform" which provides a wide range of tools
15283 for querying platform dependent features.
15284
15285- netrc now allows ASCII punctuation characters in passwords.
15286
15287- shelve now supports the optional writeback argument, and exposes
15288 pickle protocol versions.
15289
15290- Several methods of nntplib.NNTP have grown an optional file argument
15291 which specifies a file where to divert the command's output
15292 (already supported by the body() method). (SF patch #720468)
15293
15294- The self-documenting XML server library DocXMLRPCServer was added.
15295
15296- Support for internationalized domain names has been added through
15297 the 'idna' and 'punycode' encodings, the 'stringprep' module, the
15298 'mkstringprep' tool, and enhancements to the socket and httplib
15299 modules.
15300
15301- htmlentitydefs has two new dictionaries: name2codepoint maps
15302 HTML entity names to Unicode codepoints (as integers).
15303 codepoint2name is the reverse mapping. See SF patch #722017.
15304
15305- pdb has a new command, "debug", which lets you step through
15306 arbitrary code from the debugger's (pdb) prompt.
15307
15308- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
15309 return 'not a == b' rather than 'a != b'. This gives the desired
15310 result for classes that define __eq__ without defining __ne__.
15311
15312- sgmllib now supports SGML marked sections, in particular the
15313 MS Office extensions.
15314
15315- The urllib module now offers support for the iterator protocol.
15316 SF patch 698520 contributed by Brett Cannon.
15317
15318- New module timeit provides a simple framework for timing the
15319 execution speed of expressions and statements.
15320
15321- sets.Set objects now support mixed-type __eq__ and __ne__, instead
15322 of raising TypeError. If x is a Set object and y is a non-Set object,
15323 x == y is False, and x != y is True. This is akin to the change made
15324 for mixed-type comparisons of datetime objects in 2.3a2; more info
15325 about the rationale is in the NEWS entry for that. See also SF bug
15326 report <http://www.python.org/sf/693121>.
15327
15328- On Unix platforms, if os.listdir() is called with a Unicode argument,
15329 it now returns Unicode strings. (This behavior was added earlier
15330 to the Windows NT/2k/XP version of os.listdir().)
15331
15332- Distutils: both 'py_modules' and 'packages' keywords can now be specified
15333 in core.setup(). Previously you could supply one or the other, but
15334 not both of them. (SF patch #695090 from Bernhard Herzog)
15335
15336- New csv package makes it easy to read/write CSV files.
15337
15338- Module shlex has been extended to allow posix-like shell parsings,
15339 including a split() function for easy spliting of quoted strings and
15340 commands. An iterator interface was also implemented.
15341
15342Tools/Demos
15343-----------
15344
15345- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
15346 See the module docstring for details.
15347
15348Build
15349-----
15350
15351- Fix problem building on OSF1 because the compiler only accepted
15352 preprocessor directives that start in column 1. (SF bug #691793.)
15353
15354C API
15355-----
15356
15357- Added PyGC_Collect(), equivalent to calling gc.collect().
15358
15359- PyThreadState_GetDict() was changed not to raise an exception or
15360 issue a fatal error when no current thread state is available. This
15361 makes it possible to print dictionaries when no thread is active.
15362
15363- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
15364 need compatibility with previous versions can use this:
15365
15366 #ifndef PY_LONG_LONG
15367 #define PY_LONG_LONG LONG_LONG
15368 #endif
15369
15370- Added PyObject_SelfIter() to fill the tp_iter slot for the
15371 typical case where the method returns its self argument.
15372
15373- The extended type structure used for heap types (new-style
15374 classes defined by Python code using a class statement) is now
15375 exported from object.h as PyHeapTypeObject. (SF patch #696193.)
15376
15377New platforms
15378-------------
15379
15380None this time.
15381
15382Tests
15383-----
15384
15385- test_timeout now requires -u network to be passed to regrtest to run.
15386 See SF bug #692988.
15387
15388Windows
15389-------
15390
15391- os.fsync() now exists on Windows, and calls the Microsoft _commit()
15392 function.
15393
15394- New function winsound.MessageBeep() wraps the Win32 API
15395 MessageBeep().
15396
15397Mac
15398---
15399
15400- os.listdir() now returns Unicode strings on MacOS X when called with
15401 a Unicode argument. See the general news item under "Library".
15402
15403- A new method MacOS.WMAvailable() returns true if it is safe to access
15404 the window manager, false otherwise.
15405
15406- EasyDialogs dialogs are now movable-modal, and if the application is
15407 currently in the background they will ask to be moved to the foreground
15408 before displaying.
15409
15410- OSA Scripting support has improved a lot, and gensuitemodule.py can now
15411 be used by mere mortals. The documentation is now also more or less
15412 complete.
15413
15414- The IDE (in a framework build) now includes introductory documentation
15415 in Apple Help Viewer format.
15416
15417
15418What's New in Python 2.3 alpha 2?
15419=================================
15420
15421*Release date: 19-Feb-2003*
15422
15423Core and builtins
15424-----------------
15425
15426- Negative positions returned from PEP 293 error callbacks are now
15427 treated as being relative to the end of the input string. Positions
15428 that are out of bounds raise an IndexError.
15429
15430- sys.path[0] (the directory from which the script is loaded) is now
15431 turned into an absolute pathname, unless it is the empty string.
15432 (SF patch #664376.)
15433
15434- Finally fixed the bug in compile() and exec where a string ending
15435 with an indented code block but no newline would raise SyntaxError.
15436 This would have been a four-line change in parsetok.c... Except
15437 codeop.py depends on this behavior, so a compilation flag had to be
15438 invented that causes the tokenizer to revert to the old behavior;
15439 this required extra changes to 2 .h files, 2 .c files, and 2 .py
15440 files. (Fixes SF bug #501622.)
15441
15442- If a new-style class defines neither __new__ nor __init__, its
15443 constructor would ignore all arguments. This is changed now: the
15444 constructor refuses arguments in this case. This might break code
15445 that worked under Python 2.2. The simplest fix is to add a no-op
15446 __init__: ``def __init__(self, *args, **kw): pass``.
15447
15448- Through a bytecode optimizer bug (and I bet you didn't even know
15449 Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
15450 with a leading minus sign would come out with the wrong sign.
15451 ("Unsigned" hex/oct constants are those with a face value in the
15452 range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
15453 always been interpreted as negative numbers through sign folding.)
15454 E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
15455 come out as -4294967295. This was the case in Python 2.2 through
15456 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
15457 value, but according to PEP 237 it really needs to be 1 now. This
15458 will be backported to Python 2.2.3 a well. (SF #660455)
15459
15460- int(s, base) sometimes sign-folds hex and oct constants; it only
15461 does this when base is 0 and s.strip() starts with a '0'. When the
15462 sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
15463 machine, which returns -1, a FutureWarning is now issued; in Python
15464 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
15465 int("0xffffffff", 16) right now. (PEP 347)
15466
15467- super(X, x): x may now be a proxy for an X instance, i.e.
15468 issubclass(x.__class__, X) but not issubclass(type(x), X).
15469
15470- isinstance(x, X): if X is a new-style class, this is now equivalent
15471 to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
15472 only type(x) was tested. (For classic classes this was already the
15473 case.)
15474
15475- compile(), eval() and the exec statement now fully support source code
15476 passed as unicode strings.
15477
15478- int subclasses can be initialized with longs if the value fits in an int.
15479 See SF bug #683467.
15480
15481- long(string, base) takes time linear in len(string) when base is a power
15482 of 2 now. It used to take time quadratic in len(string).
15483
15484- filter returns now Unicode results for Unicode arguments.
15485
15486- raw_input can now return Unicode objects.
15487
15488- List objects' sort() method now accepts None as the comparison function.
15489 Passing None is semantically identical to calling sort() with no
15490 arguments.
15491
15492- Fixed crash when printing a subclass of str and __str__ returned self.
15493 See SF bug #667147.
15494
15495- Fixed an invalid RuntimeWarning and an undetected error when trying
15496 to convert a long integer into a float which couldn't fit.
15497 See SF bug #676155.
15498
15499- Function objects now have a __module__ attribute that is bound to
15500 the name of the module in which the function was defined. This
15501 applies for C functions and methods as well as functions and methods
15502 defined in Python. This attribute is used by pickle.whichmodule(),
15503 which changes the behavior of whichmodule slightly. In Python 2.2
15504 whichmodule() returns "__main__" for functions that are not defined
15505 at the top-level of a module (examples: methods, nested functions).
15506 Now whichmodule() will return the proper module name.
15507
15508Extension modules
15509-----------------
15510
15511- operator.isNumberType() now checks that the object has a nb_int or
15512 nb_float slot, rather than simply checking whether it has a non-NULL
15513 tp_as_number pointer.
15514
15515- The imp module now has ways to acquire and release the "import
15516 lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
15517 reentrant lock, so releasing the lock only truly releases it when
15518 this is the last release_lock() call. You can check with
15519 imp.lock_held(). (SF bug #580952 and patch #683257.)
15520
15521- Change to cPickle to match pickle.py (see below and PEP 307).
15522
15523- Fix some bugs in the parser module. SF bug #678518.
15524
15525- Thanks to Scott David Daniels, a subtle bug in how the zlib
15526 extension implemented flush() was fixed. Scott also rewrote the
15527 zlib test suite using the unittest module. (SF bug #640230 and
15528 patch #678531.)
15529
15530- Added an itertools module containing high speed, memory efficient
15531 looping constructs inspired by tools from Haskell and SML.
15532
15533- The SSL module now handles sockets with a timeout set correctly (SF
15534 patch #675750, fixing SF bug #675552).
15535
15536- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
15537
15538- Fixed broken threadstate swap in readline that could cause fatal
15539 errors when a readline hook was being invoked while a background
15540 thread was active. (SF bugs #660476 and #513033.)
15541
15542- fcntl now exposes the strops.h I_* constants.
15543
15544- Fix a crash on Solaris that occurred when calling close() on
15545 an mmap'ed file which was already closed. (SF patch #665913)
15546
15547- Fixed several serious bugs in the zipimport implementation.
15548
15549- datetime changes:
15550
15551 The date class is now properly subclassable. (SF bug #720908)
15552
15553 The datetime and datetimetz classes have been collapsed into a single
15554 datetime class, and likewise the time and timetz classes into a single
15555 time class. Previously, a datetimetz object with tzinfo=None acted
15556 exactly like a datetime object, and similarly for timetz. This wasn't
15557 enough of a difference to justify distinct classes, and life is simpler
15558 now.
15559
15560 today() and now() now round system timestamps to the closest
15561 microsecond <http://www.python.org/sf/661086>. This repairs an
15562 irritation most likely seen on Windows systems.
15563
15564 In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
15565 ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
15566 as 0 instead, but a tzinfo subclass wishing to participate in
15567 time zone conversion has to take a stand on whether it supports
15568 DST; if you don't care about DST, then code dst() to return 0 minutes,
15569 meaning that DST is never in effect).
15570
15571 The tzinfo methods utcoffset() and dst() must return a timedelta object
15572 (or None) now. In 2.3a1 they could also return an int or long, but that
15573 was an unhelpfully redundant leftover from an earlier version wherein
15574 they couldn't return a timedelta. TOOWTDI.
15575
15576 The example tzinfo class for local time had a bug. It was replaced
15577 by a later example coded by Guido.
15578
15579 datetime.astimezone(tz) no longer raises an exception when the
15580 input datetime has no UTC equivalent in tz. For typical "hybrid" time
15581 zones (a single tzinfo subclass modeling both standard and daylight
15582 time), this case can arise one hour per year, at the hour daylight time
15583 ends. See new docs for details. In short, the new behavior mimics
15584 the local wall clock's behavior of repeating an hour in local time.
15585
15586 dt.astimezone() can no longer be used to convert between naive and aware
15587 datetime objects. If you merely want to attach, or remove, a tzinfo
15588 object, without any conversion of date and time members, use
15589 dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
15590 tzinfo subclass instance.
15591
15592 A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
15593 to give complete control over how a UTC time is to be converted to
15594 a local time. The default astimezone() implementation calls fromutc()
15595 as its last step, so a tzinfo subclass can affect that too by overriding
15596 fromutc(). It's expected that the default fromutc() implementation will
15597 be suitable as-is for "almost all" time zone subclasses, but the
15598 creativity of political time zone fiddling appears unbounded -- fromutc()
15599 allows the highly motivated to emulate any scheme expressible in Python.
15600
15601 datetime.now(): The optional tzinfo argument was undocumented (that's
15602 repaired), and its name was changed to tz ("tzinfo" is overloaded enough
15603 already). With a tz argument, now(tz) used to return the local date
15604 and time, and attach tz to it, without any conversion of date and time
15605 members. This was less than useful. Now now(tz) returns the current
15606 date and time as local time in tz's time zone, akin to ::
15607
15608 tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
15609
15610 where "utc" is an instance of a tzinfo subclass modeling UTC. Without
15611 a tz argument, now() continues to return the current local date and time,
15612 as a naive datetime object.
15613
15614 datetime.fromtimestamp(): Like datetime.now() above, this had less than
15615 useful behavior when the optional tinzo argument was specified. See
15616 also SF bug report <http://www.python.org/sf/660872>.
15617
15618 date and datetime comparison: In order to prevent comparison from
15619 falling back to the default compare-object-addresses strategy, these
15620 raised TypeError whenever they didn't understand the other object type.
15621 They still do, except when the other object has a "timetuple" attribute,
15622 in which case they return NotImplemented now. This gives other
15623 datetime objects (e.g., mxDateTime) a chance to intercept the
15624 comparison.
15625
15626 date, time, datetime and timedelta comparison: When the exception
15627 for mixed-type comparisons in the last paragraph doesn't apply, if
15628 the comparison is == then False is returned, and if the comparison is
15629 != then True is returned. Because dict lookup and the "in" operator
15630 only invoke __eq__, this allows, for example, ::
15631
15632 if some_datetime in some_sequence:
15633
15634 and ::
15635
15636 some_dict[some_timedelta] = whatever
15637
15638 to work as expected, without raising TypeError just because the
15639 sequence is heterogeneous, or the dict has mixed-type keys. [This
15640 seems like a good idea to implement for all mixed-type comparisons
15641 that don't want to allow falling back to address comparison.]
15642
15643 The constructors building a datetime from a timestamp could raise
15644 ValueError if the platform C localtime()/gmtime() inserted "leap
15645 seconds". Leap seconds are ignored now. On such platforms, it's
15646 possible to have timestamps that differ by a second, yet where
15647 datetimes constructed from them are equal.
15648
15649 The pickle format of date, time and datetime objects has changed
15650 completely. The undocumented pickler and unpickler functions no
15651 longer exist. The undocumented __setstate__() and __getstate__()
15652 methods no longer exist either.
15653
15654Library
15655-------
15656
15657- The logging module was updated slightly; the WARN level was renamed
15658 to WARNING, and the matching function/method warn() to warning().
15659
15660- The pickle and cPickle modules were updated with a new pickling
15661 protocol (documented by pickletools.py, see below) and several
15662 extensions to the pickle customization API (__reduce__, __setstate__
15663 etc.). The copy module now uses more of the pickle customization
15664 API to copy objects that don't implement __copy__ or __deepcopy__.
15665 See PEP 307 for details.
15666
15667- The distutils "register" command now uses http://www.python.org/pypi
15668 as the default repository. (See PEP 301.)
15669
Skip Montanaro7a98be22007-08-16 14:35:24 +000015670- the platform dependent path related variables sep, altsep,
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015671 pathsep, curdir, pardir and defpath are now defined in the platform
15672 dependent path modules (e.g. ntpath.py) rather than os.py, so these
15673 variables are now available via os.path. They continue to be
15674 available from the os module.
15675 (see <http://www.python.org/sf/680789>).
15676
15677- array.array was added to the types repr.py knows about (see
15678 <http://www.python.org/sf/680789>).
15679
15680- The new pickletools.py contains lots of documentation about pickle
15681 internals, and supplies some helpers for working with pickles, such as
15682 a symbolic pickle disassembler.
15683
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015684- xmlrpclib.py now supports the built-in boolean type.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015685
15686- py_compile has a new 'doraise' flag and a new PyCompileError
15687 exception.
15688
15689- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
15690 class.
15691
15692- The sets module now raises TypeError in __cmp__, to clarify that
15693 sets are not intended to be three-way-compared; the comparison
15694 operators are overloaded as subset/superset tests.
15695
15696- Bastion.py and rexec.py are disabled. These modules are not safe in
15697 Python 2.2. or 2.3.
15698
15699- realpath is now exported when doing ``from poxixpath import *``.
15700 It is also exported for ntpath, macpath, and os2emxpath.
15701 See SF bug #659228.
15702
15703- New module tarfile from Lars Gustäbel provides a comprehensive interface
15704 to tar archive files with transparent gzip and bzip2 compression.
15705 See SF patch #651082.
15706
15707- urlparse can now parse imap:// URLs. See SF feature request #618024.
15708
15709- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
15710 the gain value which is passed to Tk. SF bug# 602259.
15711
15712- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
15713 See SF patch #642974.
15714
15715- The dospath module was deleted. Use the ntpath module when manipulating
15716 DOS paths from other platforms.
15717
15718Tools/Demos
15719-----------
15720
15721- Two new scripts (db2pickle.py and pickle2db.py) were added to the
15722 Tools/scripts directory to facilitate conversion from the old bsddb module
15723 to the new one. While the user-visible API of the new module is
15724 compatible with the old one, it's likely that the version of the
15725 underlying database library has changed. To convert from the old library,
15726 run the db2pickle.py script using the old version of Python to convert it
15727 to a pickle file. After upgrading Python, run the pickle2db.py script
15728 using the new version of Python to reconstitute your database. For
15729 example:
15730
15731 % python2.2 db2pickle.py -h some.db > some.pickle
15732 % python2.3 pickle2db.py -h some.db.new < some.pickle
15733
15734 Run the scripts without any args to get a usage message.
15735
15736
15737Build
15738-----
15739
15740- The audio driver tests (test_ossaudiodev.py and
15741 test_linuxaudiodev.py) are no longer run by default. This is
15742 because they don't always work, depending on your hardware and
15743 software. To run these tests, you must use an invocation like ::
15744
15745 ./python Lib/test/regrtest.py -u audio test_ossaudiodev
15746
15747- On systems which build using the configure script, compiler flags which
15748 used to be lumped together using the OPT flag have been split into two
15749 groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
15750 debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
15751 compiler flags that are required to get a clean compile. On some
15752 platforms (many Linux flavors in particular) BASECFLAGS will be empty by
15753 default. On others, such as Mac OS X and SCO, it will contain required
15754 flags. This change allows people building Python to override OPT without
15755 fear of clobbering compiler flags which are required to get a clean build.
15756
15757- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
15758 relevant search lists in setup.py. This allows users building Python to
15759 take advantage of the many packages available from the fink project
15760 <http://fink.sf.net/>.
15761
15762- A new Makefile target, scriptsinstall, installs a number of useful scripts
15763 from the Tools/scripts directory.
15764
15765C API
15766-----
15767
15768- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
15769 instead of a plain ``PyObject *``. (SF patch #686601.)
15770
15771- PyNumber_Check() now checks that the object has a nb_int or nb_float
15772 slot, rather than simply checking whether it has a non-NULL
15773 tp_as_number pointer.
15774
15775- A C type that inherits from a base type that defines tp_as_buffer
15776 will now inherit the tp_as_buffer pointer if it doesn't define one.
15777 (SF #681367)
15778
15779- The PyArg_Parse functions now issue a DeprecationWarning if a float
15780 argument is provided when an integer is specified (this affects the 'b',
15781 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
15782 raise a TypeError.
15783
15784Tests
15785-----
15786
15787- Several tests weren't being run from regrtest.py (test_timeout.py,
15788 test_tarfile.py, test_netrc.py, test_multifile.py,
15789 test_importhooks.py and test_imp.py). Now they are. (Note to
15790 developers: please read Lib/test/README when creating a new test, to
15791 make sure to do it right! All tests need to use either unittest or
15792 pydoc.)
15793
15794- Added test_posix.py, a test suite for the posix module.
15795
15796- Added test_hexoct.py, a test suite for hex/oct constant folding.
15797
15798Windows
15799-------
15800
15801- The timeout code for socket connect() didn't work right; this has
15802 now been fixed. test_timeout.py should pass (at least most of the
15803 time).
15804
15805- distutils' msvccompiler class now passes the preprocessor options to
15806 the resource compiler. See SF patch #669198.
15807
15808- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
15809 release without strong cryptography.
15810
15811- sys.path[0], if it contains a directory name, is now always an
15812 absolute pathname. (SF patch #664376.)
15813
15814- The new logging package is now installed by the Windows installer. It
15815 wasn't in 2.3a1 due to oversight.
15816
15817Mac
15818---
15819
15820- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
15821 and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
15822
15823- Most of the standard library now uses pathnames or FSRefs in preference
15824 of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
15825 in stead of macfs. macfs will probably be deprecated in the future.
15826
15827- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
15828 This also makes macfs.FSSpec.SetDates() work again.
15829
15830- There is a new module pimp, the package install manager for Python, and
15831 accompanying applet PackageManager. These allow you to easily download
15832 and install pretested extension packages either in source or binary
15833 form. Only in MacPython-OSX.
15834
15835- Applets are now built with bundlebuilder in MacPython-OSX, which should make
15836 them more robust and also provides a path towards BuildApplication. The
15837 downside of this change is that applets can no longer be run from the
15838 Terminal window, this will hopefully be fixed in the 2.3b1.
15839
15840
15841What's New in Python 2.3 alpha 1?
15842=================================
15843
15844*Release date: 31-Dec-2002*
15845
15846Type/class unification and new-style classes
15847--------------------------------------------
15848
15849- One can now assign to __bases__ and __name__ of new-style classes.
15850
15851- dict() now accepts keyword arguments so that dict(one=1, two=2)
15852 is the equivalent of {"one": 1, "two": 2}. Accordingly,
15853 the existing (but undocumented) 'items' keyword argument has
15854 been eliminated. This means that dict(items=someMapping) now has
15855 a different meaning than before.
15856
15857- int() now returns a long object if the argument is outside the
15858 integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
15859 all return long objects instead of raising an OverflowError.
15860
15861- Assignment to __class__ is disallowed if either the old or the new
15862 class is a statically allocated type object (such as defined by an
15863 extension module). This prevents anomalies like 2.__class__ = bool.
15864
15865- New-style object creation and deallocation have been sped up
15866 significantly; they are now faster than classic instance creation
15867 and deallocation.
15868
15869- The __slots__ variable can now mention "private" names, and the
15870 right thing will happen (e.g. __slots__ = ["__foo"]).
15871
15872- The built-ins slice() and buffer() are now callable types. The
15873 types classobj (formerly class), code, function, instance, and
15874 instancemethod (formerly instance-method), which have no built-in
15875 names but are accessible through the types module, are now also
15876 callable. The type dict-proxy is renamed to dictproxy.
15877
15878- Cycles going through the __class__ link of a new-style instance are
15879 now detected by the garbage collector.
15880
15881- Classes using __slots__ are now properly garbage collected.
15882 [SF bug 519621]
15883
15884- Tightened the __slots__ rules: a slot name must be a valid Python
15885 identifier.
15886
15887- The constructor for the module type now requires a name argument and
15888 takes an optional docstring argument. Previously, this constructor
15889 ignored its arguments. As a consequence, deriving a class from a
15890 module (not from the module type) is now illegal; previously this
15891 created an unnamed module, just like invoking the module type did.
15892 [SF bug 563060]
15893
15894- A new type object, 'basestring', is added. This is a common base type
15895 for 'str' and 'unicode', and can be used instead of
15896 types.StringTypes, e.g. to test whether something is "a string":
15897 isinstance(x, basestring) is True for Unicode and 8-bit strings. This
15898 is an abstract base class and cannot be instantiated directly.
15899
15900- Changed new-style class instantiation so that when C's __new__
15901 method returns something that's not a C instance, its __init__ is
15902 not called. [SF bug #537450]
15903
15904- Fixed super() to work correctly with class methods. [SF bug #535444]
15905
15906- If you try to pickle an instance of a class that has __slots__ but
15907 doesn't define or override __getstate__, a TypeError is now raised.
15908 This is done by adding a bozo __getstate__ to the class that always
15909 raises TypeError. (Before, this would appear to be pickled, but the
15910 state of the slots would be lost.)
15911
15912Core and builtins
15913-----------------
15914
15915- Import from zipfiles is now supported. The name of a zipfile placed
15916 on sys.path causes the import statement to look for importable Python
15917 modules (with .py, pyc and .pyo extensions) and packages inside the
15918 zipfile. The zipfile import follows the specification (though not
15919 the sample implementation) of PEP 273. The semantics of __path__ are
15920 compatible with those that have been implemented in Jython since
15921 Jython 2.1.
15922
15923- PEP 302 has been accepted. Although it was initially developed to
15924 support zipimport, it offers a new, general import hook mechanism.
15925 Several new variables have been added to the sys module:
15926 sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
15927 make extending the import statement much more convenient than
15928 overriding the __import__ built-in function. For a description of
15929 these, see PEP 302.
15930
15931- A frame object's f_lineno attribute can now be written to from a
15932 trace function to change which line will execute next. A command to
15933 exploit this from pdb has been added. [SF patch #643835]
15934
Georg Brandl93dc9eb2010-03-14 10:56:14 +000015935- The _codecs support module for codecs.py was turned into a built-in
15936 module to assure that at least the built-in codecs are available
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000015937 to the Python parser for source code decoding according to PEP 263.
15938
15939- issubclass now supports a tuple as the second argument, just like
15940 isinstance does. ``issubclass(X, (A, B))`` is equivalent to
15941 ``issubclass(X, A) or issubclass(X, B)``.
15942
15943- Thanks to Armin Rigo, the last known way to provoke a system crash
15944 by cleverly arranging for a comparison function to mutate a list
15945 during a list.sort() operation has been fixed. The effect of
15946 attempting to mutate a list, or even to inspect its contents or
15947 length, while a sort is in progress, is not defined by the language.
15948 The C implementation of Python 2.3 attempts to detect mutations,
15949 and raise ValueError if one occurs, but there's no guarantee that
15950 all mutations will be caught, or that any will be caught across
15951 releases or implementations.
15952
15953- Unicode file name processing for Windows (PEP 277) is implemented.
15954 All platforms now have an os.path.supports_unicode_filenames attribute,
15955 which is set to True on Windows NT/2000/XP, and False elsewhere.
15956
15957- Codec error handling callbacks (PEP 293) are implemented.
15958 Error handling in unicode.encode or str.decode can now be customized.
15959
15960- A subtle change to the semantics of the built-in function intern():
15961 interned strings are no longer immortal. You must keep a reference
15962 to the return value intern() around to get the benefit.
15963
15964- Use of 'None' as a variable, argument or attribute name now
15965 issues a SyntaxWarning. In the future, None may become a keyword.
15966
15967- SET_LINENO is gone. co_lnotab is now consulted to determine when to
15968 call the trace function. C code that accessed f_lineno should call
15969 PyCode_Addr2Line instead (f_lineno is still there, but only kept up
15970 to date when there is a trace function set).
15971
15972- There's a new warning category, FutureWarning. This is used to warn
15973 about a number of situations where the value or sign of an integer
15974 result will change in Python 2.4 as a result of PEP 237 (integer
15975 unification). The warnings implement stage B0 mentioned in that
15976 PEP. The warnings are about the following situations:
15977
15978 - Octal and hex literals without 'L' prefix in the inclusive range
15979 [0x80000000..0xffffffff]; these are currently negative ints, but
15980 in Python 2.4 they will be positive longs with the same bit
15981 pattern.
15982
15983 - Left shifts on integer values that cause the outcome to lose
15984 bits or have a different sign than the left operand. To be
15985 precise: x<<n where this currently doesn't yield the same value
15986 as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
15987
15988 - Conversions from ints to string that show negative values as
15989 unsigned ints in the inclusive range [0x80000000..0xffffffff];
15990 this affects the functions hex() and oct(), and the string
15991 formatting codes %u, %o, %x, and %X. In Python 2.4, these will
15992 show signed values (e.g. hex(-1) currently returns "0xffffffff";
15993 in Python 2.4 it will return "-0x1").
15994
15995- The bits manipulated under the cover by sys.setcheckinterval() have
15996 been changed. Both the check interval and the ticker used to be
15997 per-thread values. They are now just a pair of global variables.
15998 In addition, the default check interval was boosted from 10 to 100
15999 bytecode instructions. This may have some effect on systems that
16000 relied on the old default value. In particular, in multi-threaded
16001 applications which try to be highly responsive, response time will
16002 increase by some (perhaps imperceptible) amount.
16003
16004- When multiplying very large integers, a version of the so-called
16005 Karatsuba algorithm is now used. This is most effective if the
16006 inputs have roughly the same size. If they both have about N digits,
16007 Karatsuba multiplication has O(N**1.58) runtime (the exponent is
16008 log_base_2(3)) instead of the previous O(N**2). Measured results may
16009 be better or worse than that, depending on platform quirks. Besides
16010 the O() improvement in raw instruction count, the Karatsuba algorithm
16011 appears to have much better cache behavior on extremely large integers
16012 (starting in the ballpark of a million bits). Note that this is a
16013 simple implementation, and there's no intent here to compete with,
16014 e.g., GMP. It gives a very nice speedup when it applies, but a package
16015 devoted to fast large-integer arithmetic should run circles around it.
16016
16017- u'%c' will now raise a ValueError in case the argument is an
16018 integer outside the valid range of Unicode code point ordinals.
16019
16020- The tempfile module has been overhauled for enhanced security. The
16021 mktemp() function is now deprecated; new, safe replacements are
16022 mkstemp() (for files) and mkdtemp() (for directories), and the
16023 higher-level functions NamedTemporaryFile() and TemporaryFile().
16024 Use of some global variables in this module is also deprecated; the
16025 new functions have keyword arguments to provide the same
16026 functionality. All Lib, Tools and Demo modules that used the unsafe
16027 interfaces have been updated to use the safe replacements. Thanks
16028 to Zack Weinberg!
16029
16030- When x is an object whose class implements __mul__ and __rmul__,
16031 1.0*x would correctly invoke __rmul__, but 1*x would erroneously
16032 invoke __mul__. This was due to the sequence-repeat code in the int
16033 type. This has been fixed now.
16034
16035- Previously, "str1 in str2" required str1 to be a string of length 1.
16036 This restriction has been relaxed to allow str1 to be a string of
16037 any length. Thus "'el' in 'hello world'" returns True now.
16038
16039- File objects are now their own iterators. For a file f, iter(f) now
16040 returns f (unless f is closed), and f.next() is similar to
16041 f.readline() when EOF is not reached; however, f.next() uses a
16042 readahead buffer that messes up the file position, so mixing
16043 f.next() and f.readline() (or other methods) doesn't work right.
16044 Calling f.seek() drops the readahead buffer, but other operations
16045 don't. It so happens that this gives a nice additional speed boost
16046 to "for line in file:"; the xreadlines method and corresponding
16047 module are now obsolete. Thanks to Oren Tirosh!
16048
16049- Encoding declarations (PEP 263, phase 1) have been implemented. A
16050 comment of the form "# -*- coding: <encodingname> -*-" in the first
16051 or second line of a Python source file indicates the encoding.
16052
16053- list.sort() has a new implementation. While cross-platform results
16054 may vary, and in data-dependent ways, this is much faster on many
16055 kinds of partially ordered lists than the previous implementation,
16056 and reported to be just as fast on randomly ordered lists on
16057 several major platforms. This sort is also stable (if A==B and A
16058 precedes B in the list at the start, A precedes B after the sort too),
16059 although the language definition does not guarantee stability. A
16060 potential drawback is that list.sort() may require temp space of
16061 len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
16062 for list.sort() to raise MemoryError now, even if a comparison function
16063 does not. See <http://www.python.org/sf/587076> for full details.
16064
16065- All standard iterators now ensure that, once StopIteration has been
16066 raised, all future calls to next() on the same iterator will also
16067 raise StopIteration. There used to be various counterexamples to
Martin Panter8d56c022016-05-29 04:13:35 +000016068 this behavior, which could have caused confusion or subtle program
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016069 breakage, without any benefits. (Note that this is still an
16070 iterator's responsibility; the iterator framework does not enforce
16071 this.)
16072
16073- Ctrl+C handling on Windows has been made more consistent with
16074 other platforms. KeyboardInterrupt can now reliably be caught,
16075 and Ctrl+C at an interactive prompt no longer terminates the
16076 process under NT/2k/XP (it never did under Win9x). Ctrl+C will
16077 interrupt time.sleep() in the main thread, and any child processes
16078 created via the popen family (on win2k; we can't make win9x work
16079 reliably) are also interrupted (as generally happens on for Linux/Unix.)
16080 [SF bugs 231273, 439992 and 581232]
16081
16082- sys.getwindowsversion() has been added on Windows. This
16083 returns a tuple with information about the version of Windows
16084 currently running.
16085
16086- Slices and repetitions of buffer objects now consistently return
16087 a string. Formerly, strings would be returned most of the time,
16088 but a buffer object would be returned when the repetition count
16089 was one or when the slice range was all inclusive.
16090
16091- Unicode objects in sys.path are no longer ignored but treated
16092 as directory names.
16093
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016094- Fixed string.startswith and string.endswith built-in methods
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016095 so they accept negative indices. [SF bug 493951]
16096
16097- Fixed a bug with a continue inside a try block and a yield in the
16098 finally clause. [SF bug 567538]
16099
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016100- Most built-in sequences now support "extended slices", i.e. slices
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016101 with a third "stride" parameter. For example, "hello world"[::-1]
16102 gives "dlrow olleh".
16103
16104- A new warning PendingDeprecationWarning was added to provide
16105 direction on features which are in the process of being deprecated.
16106 The warning will not be printed by default. To see the pending
16107 deprecations, use -Walways::PendingDeprecationWarning::
16108 as a command line option or warnings.filterwarnings() in code.
16109
16110- Deprecated features of xrange objects have been removed as
16111 promised. The start, stop, and step attributes and the tolist()
16112 method no longer exist. xrange repetition and slicing have been
16113 removed.
16114
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016115- New built-in function enumerate(x), from PEP 279. Example:
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016116 enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
16117 The argument can be an arbitrary iterable object.
16118
16119- The assert statement no longer tests __debug__ at runtime. This means
16120 that assert statements cannot be disabled by assigning a false value
16121 to __debug__.
16122
16123- A method zfill() was added to str and unicode, that fills a numeric
16124 string to the left with zeros. For example,
16125 "+123".zfill(6) -> "+00123".
16126
16127- Complex numbers supported divmod() and the // and % operators, but
16128 these make no sense. Since this was documented, they're being
16129 deprecated now.
16130
16131- String and unicode methods lstrip(), rstrip() and strip() now take
16132 an optional argument that specifies the characters to strip. For
16133 example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
16134
16135- There's a new dictionary constructor (a class method of the dict
16136 class), dict.fromkeys(iterable, value=None). It constructs a
16137 dictionary with keys taken from the iterable and all values set to a
16138 single value. It can be used for building sets and for removing
16139 duplicates from sequences.
16140
16141- Added a new dict method pop(key). This removes and returns the
16142 value corresponding to key. [SF patch #539949]
16143
16144- A new built-in type, bool, has been added, as well as built-in
16145 names for its two values, True and False. Comparisons and sundry
16146 other operations that return a truth value have been changed to
16147 return a bool instead. Read PEP 285 for an explanation of why this
16148 is backward compatible.
16149
16150- Fixed two bugs reported as SF #535905: under certain conditions,
16151 deallocating a deeply nested structure could cause a segfault in the
16152 garbage collector, due to interaction with the "trashcan" code;
16153 access to the current frame during destruction of a local variable
16154 could access a pointer to freed memory.
16155
16156- The optional object allocator ("pymalloc") has been enabled by
16157 default. The recommended practice for memory allocation and
16158 deallocation has been streamlined. A header file is included,
16159 Misc/pymemcompat.h, which can be bundled with 3rd party extensions
16160 and lets them use the same API with Python versions from 1.5.2
16161 onwards.
16162
16163- PyErr_Display will provide file and line information for all exceptions
16164 that have an attribute print_file_and_line, not just SyntaxErrors.
16165
16166- The UTF-8 codec will now encode and decode Unicode surrogates
16167 correctly and without raising exceptions for unpaired ones.
16168
16169- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
16170 instead of 'r' when opening a text file for reading changes the line
16171 ending convention so that any of '\r', '\r\n', and '\n' is
16172 recognized (even mixed in one file); all three are converted to
16173 '\n', the standard Python line end character.
16174
16175- file.xreadlines() now raises a ValueError if the file is closed:
16176 Previously, an xreadlines object was returned which would raise
16177 a ValueError when the xreadlines.next() method was called.
16178
16179- sys.exit() inadvertently allowed more than one argument.
16180 An exception will now be raised if more than one argument is used.
16181
16182- Changed evaluation order of dictionary literals to conform to the
16183 general left to right evaluation order rule. Now {f1(): f2()} will
16184 evaluate f1 first.
16185
16186- Fixed bug #521782: when a file was in non-blocking mode, file.read()
16187 could silently lose data or wrongly throw an unknown error.
16188
16189- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
16190 slots are now always tried after trying the corresponding nb_* slots.
16191 This fixes a number of minor bugs (see bug #624807).
16192
16193- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
16194
16195Extension modules
16196-----------------
16197
16198- Added three operators to the operator module:
16199 operator.pow(a,b) which is equivalent to: a**b.
16200 operator.is_(a,b) which is equivalent to: a is b.
16201 operator.is_not(a,b) which is equivalent to: a is not b.
16202
16203- posix.openpty now works on all systems that have /dev/ptmx.
16204
16205- A module zipimport exists to support importing code from zip
16206 archives.
16207
16208- The new datetime module supplies classes for manipulating dates and
16209 times. The basic design came from the Zope "fishbowl process", and
16210 favors practical commercial applications over calendar esoterica. See
16211
16212 http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
16213
16214- _tkinter now returns Tcl objects, instead of strings. Objects which
16215 have Python equivalents are converted to Python objects, other objects
16216 are wrapped. This can be configured through the wantobjects method,
16217 or Tkinter.wantobjects.
16218
16219- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
16220 been added as the package bsddb. The traditional bsddb module is
16221 still available in source code, but not built automatically anymore,
16222 and is now named bsddb185. This supports Berkeley DB versions from
16223 3.0 to 4.1. For help converting your databases from the old module (which
16224 probably used an obsolete version of Berkeley DB) to the new module, see
16225 the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
16226 section above.
16227
16228- unicodedata was updated to Unicode 3.2. It supports normalization
16229 and names for Hangul syllables and CJK unified ideographs.
16230
16231- resource.getrlimit() now returns longs instead of ints.
16232
16233- readline now dynamically adjusts its input/output stream if
16234 sys.stdin/stdout changes.
16235
16236- The _tkinter module (and hence Tkinter) has dropped support for
16237 Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
16238 supported.
16239
16240- cPickle.BadPickleGet is now a class.
16241
16242- The time stamps in os.stat_result are floating point numbers
16243 after stat_float_times has been called.
16244
16245- If the size passed to mmap.mmap() is larger than the length of the
16246 file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
16247
16248- The xreadlines module is slated for obsolescence.
16249
16250- The strptime function in the time module is now always available (a
16251 Python implementation is used when the C library doesn't define it).
16252
16253- The 'new' module is no longer an extension, but a Python module that
16254 only exists for backwards compatibility. Its contents are no longer
16255 functions but callable type objects.
16256
16257- The bsddb.*open functions can now take 'None' as a filename.
16258 This will create a temporary in-memory bsddb that won't be
16259 written to disk.
16260
16261- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
16262 posix.getpgid have been added where available.
16263
16264- The locale module now exposes the C library's gettext interface. It
16265 also has a new function getpreferredencoding.
16266
16267- A security hole ("double free") was found in zlib-1.1.3, a popular
16268 third party compression library used by some Python modules. The
16269 hole was quickly plugged in zlib-1.1.4, and the Windows build of
16270 Python now ships with zlib-1.1.4.
16271
16272- pwd, grp, and resource return enhanced tuples now, with symbolic
16273 field names.
16274
16275- array.array is now a type object. A new format character
16276 'u' indicates Py_UNICODE arrays. For those, .tounicode and
16277 .fromunicode methods are available. Arrays now support __iadd__
16278 and __imul__.
16279
16280- dl now builds on every system that has dlfcn.h. Failure in case
16281 of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
16282 is called.
16283
16284- The sys module acquired a new attribute, api_version, which evaluates
16285 to the value of the PYTHON_API_VERSION macro with which the
16286 interpreter was compiled.
16287
16288- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
16289 when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
16290 returns (None, None, 'ab'), as expected. Also fixed handling of
16291 lastindex/lastgroup match attributes in similar cases. For example,
16292 when running the expression r'(a)(b)?b' over 'ab', lastindex must be
16293 1, not 2.
16294
16295- Fixed bug #581080: sre scanner was not checking the buffer limit
16296 before increasing the current pointer. This was creating an infinite
16297 loop in the search function, once the pointer exceeded the buffer
16298 limit.
16299
16300- The os.fdopen function now enforces a file mode starting with the
16301 letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
16302 bug #623464.
16303
16304- The linuxaudiodev module is now deprecated; it is being replaced by
16305 ossaudiodev. The interface has been extended to cover a lot more of
16306 OSS (see www.opensound.com), including most DSP ioctls and the
16307 OSS mixer API. Documentation forthcoming in 2.3a2.
16308
16309Library
16310-------
16311
16312- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
16313
16314- Freeze's modulefinder.py has been moved to the standard library;
16315 slightly improved so it will issue less false missing submodule
16316 reports (see sf path #643711 for details). Documentation will follow
16317 with Python 2.3a2.
16318
16319- os.path exposes getctime.
16320
16321- unittest.py now has two additional methods called assertAlmostEqual()
16322 and failIfAlmostEqual(). They implement an approximate comparison
16323 by rounding the difference between the two arguments and comparing
16324 the result to zero. Approximate comparison is essential for
16325 unit tests of floating point results.
16326
16327- calendar.py now depends on the new datetime module rather than
16328 the time module. As a result, the range of allowable dates
16329 has been increased.
16330
16331- pdb has a new 'j(ump)' command to select the next line to be
16332 executed.
16333
16334- The distutils created windows installers now can run a
16335 postinstallation script.
16336
16337- doctest.testmod can now be called without argument, which means to
16338 test the current module.
16339
16340- When canceling a server that implemented threading with a keyboard
16341 interrupt, the server would shut down but not terminate (waiting on
16342 client threads). A new member variable, daemon_threads, was added to
16343 the ThreadingMixIn class in SocketServer.py to make it explicit that
16344 this behavior needs to be controlled.
16345
16346- A new module, optparse, provides a fancy alternative to getopt for
16347 command line parsing. It is a slightly modified version of Greg
16348 Ward's Optik package.
16349
16350- UserDict.py now defines a DictMixin class which defines all dictionary
16351 methods for classes that already have a minimum mapping interface.
16352 This greatly simplifies writing classes that need to be substitutable
16353 for dictionaries (such as the shelve module).
16354
16355- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
16356 all dictionary methods. This eases the transition to persistent
16357 storage for scripts originally written with dictionaries in mind.
16358
16359- shelve.open and the various classes in shelve.py now accept an optional
16360 binary flag, which defaults to False. If True, the values stored in the
16361 shelf are binary pickles.
16362
16363- A new package, logging, implements the logging API defined by PEP
16364 282. The code is written by Vinay Sajip.
16365
16366- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
16367 modules are iterators now.
16368
16369- gzip.py now handles files exceeding 2GB. Files over 4GB also work
16370 now (provided the OS supports it, and Python is configured with large
16371 file support), but in that case the underlying gzip file format can
16372 record only the least-significant 32 bits of the file size, so that
16373 some tools working with gzipped files may report an incorrect file
16374 size.
16375
16376- xml.sax.saxutils.unescape has been added, to replace entity references
16377 with their entity value.
16378
16379- Queue.Queue.{put,get} now support an optional timeout argument.
16380
16381- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
16382 option of tkFileDialog is exposed as function askopenfile{,name}s.
16383
16384- Various configure methods of Tkinter have been stream-lined, so that
16385 tag_configure, image_configure, window_configure now return a
16386 dictionary when invoked with no argument.
16387
16388- Importing the readline module now no longer has the side effect of
16389 calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
16390 whatever locale is explicitly set by the user, is preserved. If you
16391 want repr() of 8-bit strings in your preferred encoding to preserve
16392 all printable characters of that encoding, you have to add the
16393 following code to your $PYTHONSTARTUP file or to your application's
16394 main():
16395
16396 import locale
16397 locale.setlocale(locale.LC_CTYPE, "")
16398
16399- shutil.move was added. shutil.copytree now reports errors as an
16400 exception at the end, instead of printing error messages.
16401
16402- Encoding name normalization was generalized to not only
16403 replace hyphens with underscores, but also all other non-alphanumeric
16404 characters (with the exception of the dot which is used for Python
16405 package names during lookup). The aliases.py mapping was updated
16406 to the new standard.
16407
16408- mimetypes has two new functions: guess_all_extensions() which
16409 returns a list of all known extensions for a mime type, and
16410 add_type() which adds one mapping between a mime type and
16411 an extension to the database.
16412
16413- New module: sets, defines the class Set that implements a mutable
16414 set type using the keys of a dict to represent the set. There's
16415 also a class ImmutableSet which is useful when you need sets of sets
16416 or when you need to use sets as dict keys, and a class BaseSet which
16417 is the base class of the two.
16418
16419- Added random.sample(population,k) for random sampling without replacement.
16420 Returns a k length list of unique elements chosen from the population.
16421
16422- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
16423 OverflowError. That is, it now accepts any combination of 'start'
16424 and 'stop' arguments so long as each is in the range of Python's
16425 bounded integers.
16426
16427- Thanks to Raymond Hettinger, random.random() now uses a new core
16428 generator. The Mersenne Twister algorithm is implemented in C,
16429 threadsafe, faster than the previous generator, has an astronomically
16430 large period (2**19937-1), creates random floats to full 53-bit
16431 precision, and may be the most widely tested random number generator
16432 in existence.
16433
16434 The random.jumpahead(n) method has different semantics for the new
16435 generator. Instead of jumping n steps ahead, it uses n and the
16436 existing state to create a new state. This means that jumpahead()
16437 continues to support multi-threaded code needing generators of
16438 non-overlapping sequences. However, it will break code which relies
16439 on jumpahead moving a specific number of steps forward.
16440
16441 The attributes random.whseed and random.__whseed have no meaning for
16442 the new generator. Code using these attributes should switch to a
16443 new class, random.WichmannHill which is provided for backward
16444 compatibility and to make an alternate generator available.
16445
16446- New "algorithms" module: heapq, implements a heap queue. Thanks to
16447 Kevin O'Connor for the code and François Pinard for an entertaining
16448 write-up explaining the theory and practical uses of heaps.
16449
16450- New encoding for the Palm OS character set: palmos.
16451
16452- binascii.crc32() and the zipfile module had problems on some 64-bit
16453 platforms. These have been fixed. On a platform with 8-byte C longs,
16454 crc32() now returns a signed-extended 4-byte result, so that its value
16455 as a Python int is equal to the value computed a 32-bit platform.
16456
16457- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
16458 argument.
16459
16460- Some fixes in the copy module: when an object is copied through its
16461 __reduce__ method, there was no check for a __setstate__ method on
16462 the result [SF patch 565085]; deepcopy should treat instances of
16463 custom metaclasses the same way it treats instances of type 'type'
16464 [SF patch 560794].
16465
16466- Sockets now support timeout mode. After s.settimeout(T), where T is
16467 a float expressing seconds, subsequent operations raise an exception
16468 if they cannot be completed within T seconds. To disable timeout
16469 mode, use s.settimeout(None). There's also a module function,
16470 socket.setdefaulttimeout(T), which sets the default for all sockets
16471 created henceforth.
16472
16473- getopt.gnu_getopt was added. This supports GNU-style option
16474 processing, where options can be mixed with non-option arguments.
16475
16476- Stop using strings for exceptions. String objects used for
16477 exceptions are now classes deriving from Exception. The objects
16478 changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
16479 tabnanny.NannyNag, and xdrlib.Error.
16480
16481- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
16482 BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
16483 Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
16484 big endian systems were added to the codecs module. The old names
16485 BOM32_* and BOM64_* were off by a factor of 2.
16486
16487- Added conversion functions math.degrees() and math.radians().
16488
16489- math.log() now takes an optional argument: math.log(x[, base]).
16490
16491- ftplib.retrlines() now tests for callback is None rather than testing
16492 for False. Was causing an error when given a callback object which
16493 was callable but also returned len() as zero. The change may
16494 create new breakage if the caller relied on the undocumented behavior
16495 and called with callback set to [] or some other False value not
16496 identical to None.
16497
16498- random.gauss() uses a piece of hidden state used by nothing else,
16499 and the .seed() and .whseed() methods failed to reset it. In other
16500 words, setting the seed didn't completely determine the sequence of
16501 results produced by random.gauss(). It does now. Programs repeatedly
16502 mixing calls to a seed method with calls to gauss() may see different
16503 results now.
16504
16505- The pickle.Pickler class grew a clear_memo() method to mimic that
16506 provided by cPickle.Pickler.
16507
16508- difflib's SequenceMatcher class now does a dynamic analysis of
16509 which elements are so frequent as to constitute noise. For
16510 comparing files as sequences of lines, this generally works better
16511 than the IS_LINE_JUNK function, and function ndiff's linejunk
16512 argument defaults to None now as a result. A happy benefit is
16513 that SequenceMatcher may run much faster now when applied
16514 to large files with many duplicate lines (for example, C program
16515 text with lots of repeated "}" and "return NULL;" lines).
16516
16517- New Text.dump() method in Tkinter module.
16518
16519- New distutils commands for building packagers were added to
16520 support pkgtool on Solaris and swinstall on HP-UX.
16521
16522- distutils now has a new abstract binary packager base class
16523 command/bdist_packager, which simplifies writing packagers.
16524 This will hopefully provide the missing bits to encourage
16525 people to submit more packagers, e.g. for Debian, FreeBSD
16526 and other systems.
16527
16528- The UTF-16, -LE and -BE stream readers now raise a
16529 NotImplementedError for all calls to .readline(). Previously, they
16530 used to just produce garbage or fail with an encoding error --
16531 UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
16532 work well with these.
16533
16534- compileall now supports quiet operation.
16535
16536- The BaseHTTPServer now implements optional HTTP/1.1 persistent
16537 connections.
16538
16539- socket module: the SSL support was broken out of the main
16540 _socket module C helper and placed into a new _ssl helper
16541 which now gets imported by socket.py if available and working.
16542
16543- encodings package: added aliases for all supported IANA character
16544 sets
16545
16546- ftplib: to safeguard the user's privacy, anonymous login will use
16547 "anonymous@" as default password, rather than the real user and host
16548 name.
16549
16550- webbrowser: tightened up the command passed to os.system() so that
16551 arbitrary shell code can't be executed because a bogus URL was
16552 passed in.
16553
16554- gettext.translation has an optional fallback argument, and
16555 gettext.find an optional all argument. Translations will now fallback
16556 on a per-message basis. The module supports plural forms, by means
16557 of gettext.[d]ngettext and Translation.[u]ngettext.
16558
16559- distutils bdist commands now offer a --skip-build option.
16560
16561- warnings.warn now accepts a Warning instance as first argument.
16562
16563- The xml.sax.expatreader.ExpatParser class will no longer create
16564 circular references by using itself as the locator that gets passed
16565 to the content handler implementation. [SF bug #535474]
16566
16567- The email.Parser.Parser class now properly parses strings regardless
16568 of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
16569 or CRLF). Also, the Header class's constructor default arguments
16570 has changed slightly so that an explicit maxlinelen value is always
16571 honored, and so unicode conversion error handling can be specified.
16572
16573- distutils' build_ext command now links C++ extensions with the C++
16574 compiler available in the Makefile or CXX environment variable, if
16575 running under \*nix.
16576
16577- New module bz2: provides a comprehensive interface for the bz2 compression
16578 library. It implements a complete file interface, one-shot (de)compression
16579 functions, and types for sequential (de)compression.
16580
16581- New pdb command 'pp' which is like 'p' except that it pretty-prints
16582 the value of its expression argument.
16583
16584- Now bdist_rpm distutils command understands a verify_script option in
16585 the config file, including the contents of the referred filename in
16586 the "%verifyscript" section of the rpm spec file.
16587
16588- Fixed bug #495695: webbrowser module would run graphic browsers in a
16589 unix environment even if DISPLAY was not set. Also, support for
16590 skipstone browser was included.
16591
16592- Fixed bug #636769: rexec would run unallowed code if subclasses of
16593 strings were used as parameters for certain functions.
16594
16595Tools/Demos
16596-----------
16597
16598- pygettext.py now supports globbing on Windows, and accepts module
16599 names in addition to accepting file names.
16600
16601- The SGI demos (Demo/sgi) have been removed. Nobody thought they
16602 were interesting any more. (The SGI library modules and extensions
16603 are still there; it is believed that at least some of these are
16604 still used and useful.)
16605
16606- IDLE supports the new encoding declarations (PEP 263); it can also
16607 deal with legacy 8-bit files if they use the locale's encoding. It
16608 allows non-ASCII strings in the interactive shell and executes them
16609 in the locale's encoding.
16610
16611- freeze.py now produces binaries which can import shared modules,
16612 unlike before when this failed due to missing symbol exports in
16613 the generated binary.
16614
16615Build
16616-----
16617
16618- On Unix, IDLE is now installed automatically.
16619
16620- The fpectl module is not built by default; it's dangerous or useless
16621 except in the hands of experts.
16622
16623- The public Python C API will generally be declared using PyAPI_FUNC
16624 and PyAPI_DATA macros, while Python extension module init functions
16625 will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
16626 are deprecated.
16627
16628- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
16629 get into infinite loops, when a new-style class got garbage-collected.
16630 Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
16631 that new-style classes be immortal in COUNT_ALLOCS builds. Note that
16632 COUNT_ALLOCS is not enabled by default, in either release or debug
16633 builds, and that new-style classes are immortal only in COUNT_ALLOCS
16634 builds.
16635
16636- Compiling out the cyclic garbage collector is no longer an option.
16637 The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
16638 that it's always defined (for the benefit of any extension modules
16639 that may be conditionalizing on it). A bonus is that any extension
16640 type participating in cyclic gc can choose to participate in the
16641 Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
16642 to require editing the core to teach the trashcan mechanism about the
16643 new type.
16644
16645- According to Annex F of the current C standard,
16646
16647 The Standard C macro HUGE_VAL and its float and long double analogs,
16648 HUGE_VALF and HUGE_VALL, expand to expressions whose values are
16649 positive infinities.
16650
16651 Python only uses the double HUGE_VAL, and only to #define its own symbol
16652 Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
16653 pyport.h used to try to worm around that, but the workarounds triggered
16654 other bugs on other platforms, so we gave up. If your platform defines
16655 HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
16656 that works on your platform. The only instance of this I'm sure about
16657 is on an unknown subset of Cray systems, described here:
16658
16659 http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
16660
16661 Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
16662
16663- The configure option --without-doc-strings can be used to remove the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016664 doc strings from the built-in functions and modules; this reduces the
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016665 size of the executable.
16666
16667- The universal newlines option (PEP 278) is on by default. On Unix
16668 it can be disabled by passing --without-universal-newlines to the
16669 configure script. On other platforms, remove
16670 WITH_UNIVERSAL_NEWLINES from pyconfig.h.
16671
16672- On Unix, a shared libpython2.3.so can be created with --enable-shared.
16673
16674- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
16675 preprocessor symbols were eliminated. The internal decisions they
16676 controlled stopped being experimental long ago.
16677
16678- The tools used to build the documentation now work under Cygwin as
16679 well as Unix.
16680
16681- The bsddb and dbm module builds have been changed to try and avoid version
16682 skew problems and disable linkage with Berkeley DB 1.85 unless the
16683 installer knows what s/he's doing. See the section on building these
16684 modules in the README file for details.
16685
16686C API
16687-----
16688
16689- PyNumber_Check() now returns true for string and unicode objects.
16690 This is a result of these types having a partially defined
16691 tp_as_number slot. (This is not a feature, but an indication that
16692 PyNumber_Check() is not very useful to determine numeric behavior.
16693 It may be deprecated.)
16694
16695- The string object's layout has changed: the pointer member
16696 ob_sinterned has been replaced by an int member ob_sstate. On some
16697 platforms (e.g. most 64-bit systems) this may change the offset of
16698 the ob_sval member, so as a precaution the API_VERSION has been
16699 incremented. The apparently unused feature of "indirect interned
16700 strings", supported by the ob_sinterned member, is gone. Interned
16701 strings are now usually mortal; there is a new API,
16702 PyString_InternImmortal() that creates immortal interned strings.
16703 (The ob_sstate member can only take three values; however, while
16704 making it a char saves a few bytes per string object on average, in
16705 it also slowed things down a bit because ob_sval was no longer
16706 aligned.)
16707
16708- The Py_InitModule*() functions now accept NULL for the 'methods'
16709 argument. Modules without global functions are becoming more common
16710 now that factories can be types rather than functions.
16711
16712- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
16713 level.
16714
16715- New functions PyErr_SetExcFromWindowsErr() and
16716 PyErr_SetExcFromWindowsErrWithFilename(). Similar to
16717 PyErr_SetFromWindowsErrWithFilename() and
Martin Panterc04fb562016-02-10 05:44:01 +000016718 PyErr_SetFromWindowsErr(), but they allow specifying
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016719 the exception type to raise. Available on Windows.
16720
16721- Py_FatalError() is now declared as taking a const char* argument. It
16722 was previously declared without const. This should not affect working
16723 code.
16724
16725- Added new macro PySequence_ITEM(o, i) that directly calls
16726 sq_item without rechecking that o is a sequence and without
16727 adjusting for negative indices.
16728
16729- PyRange_New() now raises ValueError if the fourth argument is not 1.
16730 This is part of the removal of deprecated features of the xrange
16731 object.
16732
16733- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
16734 coercion if both arguments have the same type but this type has the
16735 CHECKTYPES flag set. This is to better support proxies.
16736
16737- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
16738 "``void (*)(void *)``".
16739
16740- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
16741
16742- A type can now inherit its metatype from its base type. Previously,
16743 when PyType_Ready() was called, if ob_type was found to be NULL, it
16744 was always set to &PyType_Type; now it is set to base->ob_type,
16745 where base is tp_base, defaulting to &PyObject_Type.
16746
16747- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
16748
16749- The PyCore_* family of APIs have been removed.
16750
16751- The "u#" parser marker will now pass through Unicode objects as-is
16752 without going through the buffer API.
16753
16754- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
16755
16756- An old #define of ANY as void has been removed from pyport.h. This
16757 hasn't been used since Python's pre-ANSI days, and the #define has
16758 been marked as obsolete since then. SF bug 495548 says it created
16759 conflicts with other packages, so keeping it around wasn't harmless.
16760
16761- Because Python's magic number scheme broke on January 1st, we decided
16762 to stop Python development. Thanks for all the fish!
16763
16764- Some of us don't like fish, so we changed Python's magic number
16765 scheme to a new one. See Python/import.c for details.
16766
16767New platforms
16768-------------
16769
16770- OpenVMS is now supported.
16771
16772- AtheOS is now supported.
16773
16774- the EMX runtime environment on OS/2 is now supported.
16775
16776- GNU/Hurd is now supported.
16777
16778Tests
16779-----
16780
16781- The regrtest.py script's -u option now provides a way to say "allow
16782 all resources except this one." For example, to allow everything
16783 except bsddb, give the option '-uall,-bsddb'.
16784
16785Windows
16786-------
16787
16788- The Windows distribution now ships with version 4.0.14 of the
16789 Sleepycat Berkeley database library. This should be a huge
16790 improvement over the previous Berkeley DB 1.85, which had many
16791 bugs.
16792 XXX What are the licensing issues here?
16793 XXX If a user has a database created with a previous version of
16794 XXX Python, what must they do to convert it?
16795 XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
16796 XXX The version # is likely to change before 2.3a1.
16797
16798- The Windows distribution now ships with a Secure Sockets Library (SLL)
16799 module (_ssl.pyd)
16800
16801- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
16802 previously shipped with Tcl/Tk 8.3.2).
16803
16804- When Python is built under a Microsoft compiler, sys.version now
16805 includes the compiler version number (_MSC_VER). For example, under
16806 MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
16807 the value of _MSC_VER under MSVC 6.
16808
16809- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
16810 of that has been fixed in the installer (disabled Wise's "delete in-
16811 use files" uninstall option).
16812
16813- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
16814
16815- The installer now installs Start menu shortcuts under (the local
16816 equivalent of) "All Users" when doing an Admin install.
16817
16818- file.truncate([newsize]) now works on Windows for all newsize values.
16819 It used to fail if newsize didn't fit in 32 bits, reflecting a
16820 limitation of MS _chsize (which is no longer used).
16821
16822- os.waitpid() is now implemented for Windows, and can be used to block
16823 until a specified process exits. This is similar to, but not exactly
16824 the same as, os.waitpid() on POSIX systems. If you're waiting for
16825 a specific process whose pid was obtained from one of the spawn()
16826 functions, the same Python os.waitpid() code works across platforms.
16827 See the docs for details. The docs were changed to clarify that
16828 spawn functions return, and waitpid requires, a process handle on
16829 Windows (not the same thing as a Windows process id).
16830
16831- New tempfile.TemporaryFile implementation for Windows: this doesn't
16832 need a TemporaryFileWrapper wrapper anymore, and should be immune
16833 to a nasty problem: before 2.3, if you got a temp file on Windows, it
16834 got wrapped in an object whose close() method first closed the
16835 underlying file, then deleted the file. This usually worked fine.
16836 However, the spawn family of functions on Windows create (at a low C
16837 level) the same set of open files in the spawned process Q as were
16838 open in the spawning process P. If a temp file f was among them, then
16839 doing f.close() in P first closed P's C-level file handle on f, but Q's
16840 C-level file handle on f remained open, so the attempt in P to delete f
16841 blew up with a "Permission denied" error (Windows doesn't allow
16842 deleting open files). This was surprising, subtle, and difficult to
16843 work around.
16844
16845- The os module now exports all the symbolic constants usable with the
16846 low-level os.open() on Windows: the new constants in 2.3 are
16847 O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
16848 The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
16849 O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
16850 to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
16851 (so specify both if you want both; note that neither is useful unless
16852 specified with O_CREAT too).
16853
16854Mac
16855----
16856
16857- Mac/Relnotes is gone, the release notes are now here.
16858
16859- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
16860 version) now fully supports unicode strings as arguments to various file
16861 system calls, eg. open(), file(), os.stat() and os.listdir().
16862
16863- The current naming convention for Python on the Macintosh is that MacPython
16864 refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
16865 CFM-based version that runs on both OS9 and OSX.
16866
16867- All MacPython-OS9 functionality is now available in an OSX unix build,
16868 including the Carbon modules, the IDE, OSA support, etc. A lot of this
16869 will only work correctly in a framework build, though, because you cannot
16870 talk to the window manager unless your application is run from a .app
16871 bundle. There is a command line tool "pythonw" that runs your script
16872 with an interpreter living in such a .app bundle, this interpreter should
16873 be used to run any Python script using the window manager (including
16874 Tkinter or wxPython scripts).
16875
16876- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
16877 MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
16878 are specifically for MacPython-OS9 (CFM support, preference resources, etc).
16879
16880- A new utility PythonLauncher will start a Python interpreter when a .py or
16881 .pyw script is double-clicked in the Finder. By default .py scripts are
16882 run with a normal Python interpreter in a Terminal window and .pyw
16883 files are run with a window-aware pythonw interpreter without a Terminal
16884 window, but all this can be customized.
16885
16886- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
16887 possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
16888 releases.
16889
16890- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
16891 line interface too.
16892
16893- All the Carbon classes are now PEP253 compliant, meaning that you can
16894 subclass them from Python. Most of the attributes have gone, you should
16895 now use the accessor function call API, which is also what Apple's
16896 documentation uses. Some attributes such as grafport.visRgn are still
16897 available for convenience.
16898
16899- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
Georg Brandl93dc9eb2010-03-14 10:56:14 +000016900 and Folder (APIs from Folders.h). The old macfs built-in module is
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000016901 gone, and replaced by a Python wrapper around the new modules.
16902
16903- Pathname handling should now be fully consistent: MacPython-OSX always uses
16904 unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
16905 (also when running on Mac OS X).
16906
16907- New Carbon modules Help and AH give access to the Carbon Help Manager.
16908 There are hooks in the IDE to allow accessing the Python documentation
16909 (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
16910 See Mac/OSX/README for converting the Python documentation to a
16911 Help Viewer compatible form and installing it.
16912
16913- OSA support has been redesigned and the generated Python classes now
16914 mirror the inheritance defined by the underlying OSA classes.
16915
16916- MacPython no longer maps both \r and \n to \n on input for any text file.
16917 This feature has been replaced by universal newline support (PEP278).
16918
16919- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
16920 mac-roman (or whatever your local Mac encoding was) but "ascii", like on
16921 other platforms. If you really need sourcefiles with Mac characters in them
16922 you can change this in site.py.
16923
16924
16925What's New in Python 2.2 final?
16926===============================
16927
16928*Release date: 21-Dec-2001*
16929
16930Type/class unification and new-style classes
16931--------------------------------------------
16932
16933- pickle.py, cPickle: allow pickling instances of new-style classes
16934 with a custom metaclass.
16935
16936Core and builtins
16937-----------------
16938
16939- weakref proxy object: when comparing, unwrap both arguments if both
16940 are proxies.
16941
16942Extension modules
16943-----------------
16944
16945- binascii.b2a_base64(): fix a potential buffer overrun when encoding
16946 very short strings.
16947
16948- cPickle: the obscure "fast" mode was suspected of causing stack
16949 overflows on the Mac. Hopefully fixed this by setting the recursion
16950 limit much smaller. If the limit is too low (it only affects
16951 performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
16952 when compiling cPickle.c (or in pyconfig.h).
16953
16954Library
16955-------
16956
16957- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
16958 close or delete time).
16959
16960- rfc822.py: fixed a bug where the address '<>' was converted to None
16961 instead of an empty string (also fixes the email.Utils module).
16962
16963- xmlrpclib.py: version 1.0.0; uses precision for doubles.
16964
16965- test suite: the pickle and cPickle tests were not executing any code
16966 when run from the standard regression test.
16967
16968Tools/Demos
16969-----------
16970
16971Build
16972-----
16973
16974C API
16975-----
16976
16977New platforms
16978-------------
16979
16980Tests
16981-----
16982
16983Windows
16984-------
16985
16986- distutils package: fixed broken Windows installers (bdist_wininst).
16987
16988- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
16989 instances are deleted at process exit time.
16990
16991- socket.py: prevent mysterious warnings when socket instances are
16992 deleted at process exit time.
16993
16994- posixmodule.c: fix a Windows crash with stat() of a filename ending
16995 in backslash.
16996
16997Mac
16998----
16999
17000- The Carbon toolbox modules have been upgraded to Universal Headers
17001 3.4, and experimental CoreGraphics and CarbonEvents modules have
17002 been added. All only for framework-enabled MacOSX.
17003
17004
17005What's New in Python 2.2c1?
17006===========================
17007
17008*Release date: 14-Dec-2001*
17009
17010Type/class unification and new-style classes
17011--------------------------------------------
17012
17013- Guido's tutorial introduction to the new type/class features has
17014 been extensively updated. See
17015
17016 http://www.python.org/2.2/descrintro.html
17017
17018 That remains the primary documentation in this area.
17019
17020- Fixed a leak: instance variables declared with __slots__ were never
17021 deleted!
17022
17023- The "delete attribute" method of descriptor objects is called
17024 __delete__, not __del__. In previous releases, it was mistakenly
17025 called __del__, which created an unfortunate overloading condition
17026 with finalizers. (The "get attribute" and "set attribute" methods
17027 are still called __get__ and __set__, respectively.)
17028
17029- Some subtle issues with the super built-in were fixed:
17030
17031 (a) When super itself is subclassed, its __get__ method would still
17032 return an instance of the base class (i.e., of super).
17033
17034 (b) super(C, C()).__class__ would return C rather than super. This
17035 is confusing. To fix this, I decided to change the semantics of
17036 super so that it only applies to code attributes, not to data
17037 attributes. After all, overriding data attributes is not
17038 supported anyway.
17039
17040 (c) The __get__ method didn't check whether the argument was an
17041 instance of the type used in creation of the super instance.
17042
17043- Previously, hash() of an instance of a subclass of a mutable type
17044 (list or dictionary) would return some value, rather than raising
17045 TypeError. This has been fixed. Also, directly calling
17046 dict.__hash__ and list.__hash__ now raises the same TypeError
17047 (previously, these were the same as object.__hash__).
17048
17049- New-style objects now support deleting their __dict__. This is for
17050 all intents and purposes equivalent to assigning a brand new empty
17051 dictionary, but saves space if the object is not used further.
17052
17053Core and builtins
17054-----------------
17055
17056- -Qnew now works as documented in PEP 238: when -Qnew is passed on
17057 the command line, all occurrences of "/" use true division instead
17058 of classic division. See the PEP for details. Note that "all"
17059 means all instances in library and 3rd-party modules, as well as in
17060 your own code. As the PEP says, -Qnew is intended for use only in
17061 educational environments with control over the libraries in use.
17062 Note that test_coercion.py in the standard Python test suite fails
17063 under -Qnew; this is expected, and won't be repaired until true
17064 division becomes the default (in the meantime, test_coercion is
17065 testing the current rules).
17066
17067- complex() now only allows the first argument to be a string
17068 argument, and raises TypeError if either the second arg is a string
17069 or if the second arg is specified when the first is a string.
17070
17071Extension modules
17072-----------------
17073
17074- gc.get_referents was renamed to gc.get_referrers.
17075
17076Library
17077-------
17078
17079- Functions in the os.spawn() family now release the global interpreter
17080 lock around calling the platform spawn. They should always have done
17081 this, but did not before 2.2c1. Multithreaded programs calling
17082 an os.spawn function with P_WAIT will no longer block all Python threads
17083 until the spawned program completes. It's possible that some programs
17084 relies on blocking, although more likely by accident than by design.
17085
17086- webbrowser defaults to netscape.exe on OS/2 now.
17087
17088- Tix.ResizeHandle exposes detach_widget, hide, and show.
17089
17090- The charset alias windows_1252 has been added.
17091
17092- types.StringTypes is a tuple containing the defined string types;
17093 usually this will be (str, unicode), but if Python was compiled
17094 without Unicode support it will be just (str,).
17095
17096- The pulldom and minidom modules were synchronized to PyXML.
17097
17098Tools/Demos
17099-----------
17100
17101- A new script called Tools/scripts/google.py was added, which fires
17102 off a search on Google.
17103
17104Build
17105-----
17106
17107- Note that release builds of Python should arrange to define the
17108 preprocessor symbol NDEBUG on the command line (or equivalent).
17109 In the 2.2 pre-release series we tried to define this by magic in
17110 Python.h instead, but it proved to cause problems for extension
17111 authors. The Unix, Windows and Mac builds now all define NDEBUG in
17112 release builds via cmdline (or equivalent) instead. Ports to
17113 other platforms should do likewise.
17114
17115- It is no longer necessary to use --with-suffix when building on a
17116 case-insensitive file system (such as Mac OS X HFS+). In the build
17117 directory an extension is used, but not in the installed python.
17118
17119C API
17120-----
17121
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017122- New function PyDict_MergeFromSeq2() exposes the built-in dict
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017123 constructor's logic for updating a dictionary from an iterable object
17124 producing key-value pairs.
17125
17126- PyArg_ParseTupleAndKeywords() requires that the number of entries in
17127 the keyword list equal the number of argument specifiers. This
17128 wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
17129 dump core in some bad cases. This has been repaired. As a result,
17130 PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
17131 previously went unchallenged.
17132
17133New platforms
17134-------------
17135
17136Tests
17137-----
17138
17139Windows
17140-------
17141
17142Mac
17143----
17144
17145- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
17146 without any trailing digits.
17147
17148- Changed logic for finding python home in Mac OS X framework Pythons.
17149 Now sys.executable points to the executable again, in stead of to
17150 the shared library. The latter is used only for locating the python
17151 home.
17152
17153
17154What's New in Python 2.2b2?
17155===========================
17156
17157*Release date: 16-Nov-2001*
17158
17159Type/class unification and new-style classes
17160--------------------------------------------
17161
17162- Multiple inheritance mixing new-style and classic classes in the
17163 list of base classes is now allowed, so this works now:
17164
17165 class Classic: pass
17166 class Mixed(Classic, object): pass
17167
17168 The MRO (method resolution order) for each base class is respected
17169 according to its kind, but the MRO for the derived class is computed
17170 using new-style MRO rules if any base class is a new-style class.
17171 This needs to be documented.
17172
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017173- The new built-in dictionary() constructor, and dictionary type, have
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017174 been renamed to dict. This reflects a decade of common usage.
17175
17176- dict() now accepts an iterable object producing 2-sequences. For
17177 example, dict(d.items()) == d for any dictionary d. The argument,
17178 and the elements of the argument, can be any iterable objects.
17179
17180- New-style classes can now have a __del__ method, which is called
17181 when the instance is deleted (just like for classic classes).
17182
17183- Assignment to object.__dict__ is now possible, for objects that are
17184 instances of new-style classes that have a __dict__ (unless the base
17185 class forbids it).
17186
17187- Methods of built-in types now properly check for keyword arguments
17188 (formerly these were silently ignored). The only built-in methods
17189 that take keyword arguments are __call__, __init__ and __new__.
17190
17191- The socket function has been converted to a type; see below.
17192
17193Core and builtins
17194-----------------
17195
17196- Assignment to __debug__ raises SyntaxError at compile-time. This
17197 was promised when 2.1c1 was released as "What's New in Python 2.1c1"
17198 (see below) says.
17199
17200- Clarified the error messages for unsupported operands to an operator
17201 (like 1 + '').
17202
17203Extension modules
17204-----------------
17205
17206- mmap has a new keyword argument, "access", allowing a uniform way for
17207 both Windows and Unix users to create read-only, write-through and
17208 copy-on-write memory mappings. This was previously possible only on
17209 Unix. A new keyword argument was required to support this in a
17210 uniform way because the mmap() signatures had diverged across
17211 platforms. Thanks to Jay T Miller for repairing this!
17212
17213- By default, the gc.garbage list now contains only those instances in
17214 unreachable cycles that have __del__ methods; in 2.1 it contained all
17215 instances in unreachable cycles. "Instances" here has been generalized
17216 to include instances of both new-style and old-style classes.
17217
17218- The socket module defines a new method for socket objects,
17219 sendall(). This is like send() but may make multiple calls to
17220 send() until all data has been sent. Also, the socket function has
17221 been converted to a subclassable type, like list and tuple (etc.)
17222 before it; socket and SocketType are now the same thing.
17223
17224- Various bugfixes to the curses module. There is now a test suite
17225 for the curses module (you have to run it manually).
17226
17227- binascii.b2a_base64 no longer places an arbitrary restriction of 57
17228 bytes on its input.
17229
17230Library
17231-------
17232
17233- tkFileDialog exposes a Directory class and askdirectory
17234 convenience function.
17235
17236- Symbolic group names in regular expressions must be unique. For
17237 example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
17238 single name can't mean both "group 1" and "group 2" simultaneously.
17239 Python 2.2 detects this error at regexp compilation time;
17240 previously, the error went undetected, and results were
17241 unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
17242 pattern.subn() methods have been rewritten in C. Also, an
17243 experimental function/method finditer() has been added, which works
17244 like findall() but returns an iterator.
17245
17246- Tix exposes more commands through the classes DirSelectBox,
17247 DirSelectDialog, ListNoteBook, Meter, CheckList, and the
17248 methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
17249 tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
17250
17251- Traceback objects are now scanned by cyclic garbage collection, so
17252 cycles created by casual use of sys.exc_info() no longer cause
17253 permanent memory leaks (provided garbage collection is enabled).
17254
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017255- mimetypes.py has optional support for non-standard, but commonly
17256 found types. guess_type() and guess_extension() now accept an
17257 optional 'strict' flag, defaulting to true, which controls whether
17258 recognize non-standard types or not. A few non-standard types we
17259 know about have been added. Also, when run as a script, there are
17260 new -l and -e options.
17261
17262- statcache is now deprecated.
17263
17264- email.Utils.formatdate() now produces the preferred RFC 2822 style
17265 dates with numeric timezones (it used to produce obsolete dates
17266 hard coded to "GMT" timezone). An optional 'localtime' flag is
17267 added to produce dates in the local timezone, with daylight savings
17268 time properly taken into account.
17269
17270- In pickle and cPickle, instead of masking errors in load() by
17271 transforming them into SystemError, we let the original exception
17272 propagate out. Also, implement support for __safe_for_unpickling__
17273 in pickle, as it already was supported in cPickle.
17274
17275Tools/Demos
17276-----------
17277
17278Build
17279-----
17280
17281- The dbm module is built using libdb1 if available. The bsddb module
17282 is built with libdb3 if available.
17283
17284- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
17285
17286C API
17287-----
17288
17289- New function PySequence_Fast_GET_SIZE() returns the size of a non-
17290 NULL result from PySequence_Fast(), more quickly than calling
17291 PySequence_Size().
17292
17293- New argument unpacking function PyArg_UnpackTuple() added.
17294
17295- New functions PyObject_CallFunctionObjArgs() and
17296 PyObject_CallMethodObjArgs() have been added to make it more
17297 convenient and efficient to call functions and methods from C.
17298
17299- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
17300 possible that this will propagate errors it didn't before.
17301
17302- New function PyObject_CheckReadBuffer(), which returns true if its
17303 argument supports the single-segment readable buffer interface.
17304
17305New platforms
17306-------------
17307
17308- We've finally confirmed that this release builds on HP-UX 11.00,
17309 *with* threads, and passes the test suite.
17310
17311- Thanks to a series of patches from Michael Muller, Python may build
17312 again under OS/2 Visual Age C++.
17313
17314- Updated RISCOS port by Dietmar Schwertberger.
17315
17316Tests
17317-----
17318
17319- Added a test script for the curses module. It isn't run automatically;
17320 regrtest.py must be run with '-u curses' to enable it.
17321
17322Windows
17323-------
17324
17325Mac
17326----
17327
17328- PythonScript has been moved to unsupported and is slated to be
17329 removed completely in the next release.
17330
17331- It should now be possible to build applets that work on both OS9 and
17332 OSX.
17333
17334- The core is now linked with CoreServices not Carbon; as a side
17335 result, default 8bit encoding on OSX is now ASCII.
17336
17337- Python should now build on OSX 10.1.1
17338
17339
17340What's New in Python 2.2b1?
17341===========================
17342
17343*Release date: 19-Oct-2001*
17344
17345Type/class unification and new-style classes
17346--------------------------------------------
17347
17348- New-style classes are now always dynamic (except for built-in and
17349 extension types). There is no longer a performance penalty, and I
17350 no longer see another reason to keep this baggage around. One relic
17351 remains: the __dict__ of a new-style class is a read-only proxy; you
17352 must set the class's attribute to modify it. As a consequence, the
17353 __defined__ attribute of new-style types no longer exists, for lack
17354 of need: there is once again only one __dict__ (although in the
17355 future a __cache__ may be resurrected with a similar function, if I
17356 can prove that it actually speeds things up).
17357
17358- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
17359 always returned None, even when there was a class docstring).
17360
17361- doctest now finds and runs docstrings attached to new-style classes,
17362 class methods, static methods, and properties.
17363
17364Core and builtins
17365-----------------
17366
17367- A very subtle syntactical pitfall in list comprehensions was fixed.
17368 For example: [a+b for a in 'abc', for b in 'def']. The comma in
17369 this example is a mistake. Previously, this would silently let 'a'
17370 iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
17371 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
17372 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
17373 Note that [a for a in <singleton>] is a convoluted way to say
17374 [<singleton>] anyway, so it's not like any expressiveness is lost.
17375
17376- getattr(obj, name, default) now only catches AttributeError, as
17377 documented, rather than returning the default value for all
17378 exceptions (which could mask bugs in a __getattr__ hook, for
17379 example).
17380
17381- Weak reference objects are now part of the core and offer a C API.
17382 A bug which could allow a core dump when binary operations involved
17383 proxy reference has been fixed. weakref.ReferenceError is now a
17384 built-in exception.
17385
17386- unicode(obj) now behaves more like str(obj), accepting arbitrary
17387 objects, and calling a __unicode__ method if it exists.
17388 unicode(obj, encoding) and unicode(obj, encoding, errors) still
17389 require an 8-bit string or character buffer argument.
17390
17391- isinstance() now allows any object as the first argument and a
17392 class, a type or something with a __bases__ tuple attribute for the
17393 second argument. The second argument may also be a tuple of a
17394 class, type, or something with __bases__, in which case isinstance()
17395 will return true if the first argument is an instance of any of the
17396 things contained in the second argument tuple. E.g.
17397
17398 isinstance(x, (A, B))
17399
17400 returns true if x is an instance of A or B.
17401
17402Extension modules
17403-----------------
17404
17405- thread.start_new_thread() now returns the thread ID (previously None).
17406
17407- binascii has now two quopri support functions, a2b_qp and b2a_qp.
17408
17409- readline now supports setting the startup_hook and the
17410 pre_event_hook, and adds the add_history() function.
17411
17412- os and posix supports chroot(), setgroups() and unsetenv() where
17413 available. The stat(), fstat(), statvfs() and fstatvfs() functions
17414 now return "pseudo-sequences" -- the various fields can now be
17415 accessed as attributes (e.g. os.stat("/").st_mtime) but for
17416 backwards compatibility they also behave as a fixed-length sequence.
17417 Some platform-specific fields (e.g. st_rdev) are only accessible as
17418 attributes.
17419
17420- time: localtime(), gmtime() and strptime() now return a
17421 pseudo-sequence similar to the os.stat() return value, with
17422 attributes like tm_year etc.
17423
17424- Decompression objects in the zlib module now accept an optional
17425 second parameter to decompress() that specifies the maximum amount
17426 of memory to use for the uncompressed data.
17427
17428- optional SSL support in the socket module now exports OpenSSL
17429 functions RAND_add(), RAND_egd(), and RAND_status(). These calls
17430 are useful on platforms like Solaris where OpenSSL does not
17431 automatically seed its PRNG. Also, the keyfile and certfile
17432 arguments to socket.ssl() are now optional.
17433
17434- posixmodule (and by extension, the os module on POSIX platforms) now
17435 exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
17436
17437Library
17438-------
17439
17440- doctest now excludes functions and classes not defined by the module
17441 being tested, thanks to Tim Hochberg.
17442
17443- HotShot, a new profiler implemented using a C-based callback, has
17444 been added. This substantially reduces the overhead of profiling,
17445 but it is still quite preliminary. Support modules and
17446 documentation will be added in upcoming releases (before 2.2 final).
17447
17448- profile now produces correct output in situations where an exception
17449 raised in Python is cleared by C code (e.g. hasattr()). This used
17450 to cause wrong output, including spurious claims of recursive
17451 functions and attribution of time spent to the wrong function.
17452
17453 The code and documentation for the derived OldProfile and HotProfile
17454 profiling classes was removed. The code hasn't worked for years (if
17455 you tried to use them, they raised exceptions). OldProfile
17456 intended to reproduce the behavior of the profiler Python used more
17457 than 7 years ago, and isn't interesting anymore. HotProfile intended
17458 to provide a faster profiler (but producing less information), and
17459 that's a worthy goal we intend to meet via a different approach (but
17460 without losing information).
17461
17462- Profile.calibrate() has a new implementation that should deliver
17463 a much better system-specific calibration constant. The constant can
17464 now be specified in an instance constructor, or as a Profile class or
17465 instance variable, instead of by editing profile.py's source code.
17466 Calibration must still be done manually (see the docs for the profile
17467 module).
17468
17469 Note that Profile.calibrate() must be overridden by subclasses.
17470 Improving the accuracy required exploiting detailed knowledge of
17471 profiler internals; the earlier method abstracted away the details
17472 and measured a simplified model instead, but consequently computed
17473 a constant too small by a factor of 2 on some modern machines.
17474
17475- quopri's encode and decode methods take an optional header parameter,
17476 which indicates whether output is intended for the header 'Q'
17477 encoding.
17478
17479- The SocketServer.ThreadingMixIn class now closes the request after
17480 finish_request() returns. (Not when it errors out though.)
17481
17482- The nntplib module's NNTP.body() method has grown a 'file' argument
17483 to allow saving the message body to a file.
17484
17485- The email package has added a class email.Parser.HeaderParser which
17486 only parses headers and does not recurse into the message's body.
17487 Also, the module/class MIMEAudio has been added for representing
17488 audio data (contributed by Anthony Baxter).
17489
17490- ftplib should be able to handle files > 2GB.
17491
17492- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
17493 ON, and OFF.
17494
17495- xml.dom.minidom NodeList objects now support the length attribute
17496 and item() method as required by the DOM specifications.
17497
17498Tools/Demos
17499-----------
17500
17501- Demo/dns was removed. It no longer serves any purpose; a package
17502 derived from it is now maintained by Anthony Baxter, see
17503 http://PyDNS.SourceForge.net.
17504
17505- The freeze tool has been made more robust, and two new options have
17506 been added: -X and -E.
17507
17508Build
17509-----
17510
17511- configure will use CXX in LINKCC if CXX is used to build main() and
17512 the system requires to link a C++ main using the C++ compiler.
17513
17514C API
17515-----
17516
17517- The documentation for the tp_compare slot is updated to require that
17518 the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
17519 not correct. This is not yet enforced but will be enforced in
17520 Python 2.3; even later, we may use -2 to indicate errors and +2 for
17521 "NotImplemented". Right now, -1 should be used for an error return.
17522
17523- PyLong_AsLongLong() now accepts int (as well as long) arguments.
17524 Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
17525 as long) arguments.
17526
17527- PyThread_start_new_thread() now returns a long int giving the thread
17528 ID, if one can be calculated; it returns -1 for error, 0 if no
17529 thread ID is calculated (this is an incompatible change, but only
17530 the thread module used this API). This code has only really been
17531 tested on Linux and Windows; other platforms please beware (and
17532 report any bugs or strange behavior).
17533
17534- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
17535 input.
17536
17537New platforms
17538-------------
17539
17540Tests
17541-----
17542
17543Windows
17544-------
17545
17546- Installer: If you install IDLE, and don't disable file-extension
17547 registration, a new "Edit with IDLE" context (right-click) menu entry
17548 is created for .py and .pyw files.
17549
17550- The signal module now supports SIGBREAK on Windows, thanks to Steven
17551 Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
17552 action remains to call Win32 ExitProcess(). This can be changed via
17553 signal.signal(). For example::
17554
17555 # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
17556 # (SIGINT) behavior.
17557 import signal
17558 signal.signal(signal.SIGBREAK, signal.default_int_handler)
17559
17560 try:
17561 while 1:
17562 pass
17563 except KeyboardInterrupt:
17564 # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
17565 # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
17566 # program without the possibility for any Python-level cleanup).
17567 print "Clean exit"
17568
17569
17570What's New in Python 2.2a4?
17571===========================
17572
17573*Release date: 28-Sep-2001*
17574
17575Type/class unification and new-style classes
17576--------------------------------------------
17577
17578- pydoc and inspect are now aware of new-style classes;
17579 e.g. help(list) at the interactive prompt now shows proper
17580 documentation for all operations on list objects.
17581
17582- Applications using Jim Fulton's ExtensionClass module can now safely
17583 be used with Python 2.2. In particular, Zope 2.4.1 now works with
17584 Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
17585 examples also work again. It is hoped that Gtk and Boost also work
17586 with 2.2a4 and beyond. (If you can confirm this, please write
17587 webmaster@python.org; if there are still problems, please open a bug
17588 report on SourceForge.)
17589
17590- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
17591 These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
17592 in the constructed property object. fget, fset and fdel weren't
Martin Panterc04fb562016-02-10 05:44:01 +000017593 discoverable from Python in 2.2a3. __doc__ is new, and allows
17594 associating a docstring with a property.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017595
17596- Comparison overloading is now more completely implemented. For
17597 example, a str subclass instance can properly be compared to a str
17598 instance, and it can properly overload comparison. Ditto for most
17599 other built-in object types.
17600
17601- The repr() of new-style classes has changed; instead of <type
17602 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
17603 *except* for built-in types, which are still rendered as <type
17604 'Foo'> (to avoid upsetting existing code that might parse or
17605 otherwise rely on repr() of certain type objects).
17606
17607- The repr() of new-style objects is now always <Foo object at XXX>;
17608 previously, it was sometimes <Foo instance at XXX>.
17609
17610- For new-style classes, what was previously called __getattr__ is now
17611 called __getattribute__. This method, if defined, is called for
17612 *every* attribute access. A new __getattr__ hook more similar to the
17613 one in classic classes is defined which is called only if regular
17614 attribute access raises AttributeError; to catch *all* attribute
17615 access, you can use __getattribute__ (for new-style classes). If
17616 both are defined, __getattribute__ is called first, and if it raises
17617 AttributeError, __getattr__ is called.
17618
17619- The __class__ attribute of new-style objects can be assigned to.
17620 The new class must have the same C-level object layout as the old
17621 class.
17622
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017623- The built-in file type can be subclassed now. In the usual pattern,
17624 "file" is the name of the built-in type, and file() is a new built-in
17625 constructor, with the same signature as the built-in open() function.
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017626 file() is now the preferred way to open a file.
17627
17628- Previously, __new__ would only see sequential arguments passed to
17629 the type in a constructor call; __init__ would see both sequential
17630 and keyword arguments. This made no sense whatsoever any more, so
17631 now both __new__ and __init__ see all arguments.
17632
17633- Previously, hash() applied to an instance of a subclass of str or
17634 unicode always returned 0. This has been repaired.
17635
17636- Previously, an operation on an instance of a subclass of an
17637 immutable type (int, long, float, complex, tuple, str, unicode),
17638 where the subtype didn't override the operation (and so the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017639 operation was handled by the built-in type), could return that
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017640 instance instead a value of the base type. For example, if s was of
17641 a str subclass type, s[:] returned s as-is. Now it returns a str
17642 with the same value as s.
17643
17644- Provisional support for pickling new-style objects has been added.
17645
17646Core
17647----
17648
17649- file.writelines() now accepts any iterable object producing strings.
17650
17651- PyUnicode_FromEncodedObject() now works very much like
17652 PyObject_Str(obj) in that it tries to use __str__/tp_str
17653 on the object if the object is not a string or buffer. This
17654 makes unicode() behave like str() when applied to non-string/buffer
17655 objects.
17656
17657- PyFile_WriteObject now passes Unicode objects to the file's write
17658 method. As a result, all file-like objects which may be the target
17659 of a print statement must support Unicode objects, i.e. they must
17660 at least convert them into ASCII strings.
17661
17662- Thread scheduling on Solaris should be improved; it is no longer
17663 necessary to insert a small sleep at the start of a thread in order
17664 to let other runnable threads be scheduled.
17665
17666Library
17667-------
17668
17669- StringIO.StringIO instances and cStringIO.StringIO instances support
17670 read character buffer compatible objects for their .write() methods.
17671 These objects are converted to strings and then handled as such
17672 by the instances.
17673
17674- The "email" package has been added. This is basically a port of the
17675 mimelib package <http://sf.net/projects/mimelib> with API changes
17676 and some implementations updated to use iterators and generators.
17677
17678- difflib.ndiff() and difflib.Differ.compare() are generators now. This
17679 restores the ability of Tools/scripts/ndiff.py to start producing output
17680 before the entire comparison is complete.
17681
17682- StringIO.StringIO instances and cStringIO.StringIO instances support
17683 iteration just like file objects (i.e. their .readline() method is
17684 called for each iteration until it returns an empty string).
17685
17686- The codecs module has grown four new helper APIs to access
Georg Brandl93dc9eb2010-03-14 10:56:14 +000017687 built-in codecs: getencoder(), getdecoder(), getreader(),
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000017688 getwriter().
17689
17690- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
17691 simplifies writing XML RPC servers.
17692
17693- os.path.realpath(): a new function that returns the absolute pathname
17694 after interpretation of symbolic links. On non-Unix systems, this
17695 is an alias for os.path.abspath().
17696
17697- operator.indexOf() (PySequence_Index() in the C API) now works with any
17698 iterable object.
17699
17700- smtplib now supports various authentication and security features of
17701 the SMTP protocol through the new login() and starttls() methods.
17702
17703- hmac: a new module implementing keyed hashing for message
17704 authentication.
17705
17706- mimetypes now recognizes more extensions and file types. At the
17707 same time, some mappings not sanctioned by IANA were removed.
17708
17709- The "compiler" package has been brought up to date to the state of
17710 Python 2.2 bytecode generation. It has also been promoted from a
17711 Tool to a standard library package. (Tools/compiler still exists as
17712 a sample driver.)
17713
17714Build
17715-----
17716
17717- Large file support (LFS) is now automatic when the platform supports
17718 it; no more manual configuration tweaks are needed. On Linux, at
17719 least, it's possible to have a system whose C library supports large
17720 files but whose kernel doesn't; in this case, large file support is
17721 still enabled but doesn't do you any good unless you upgrade your
17722 kernel or share your Python executable with another system whose
17723 kernel has large file support.
17724
17725- The configure script now supplies plausible defaults in a
17726 cross-compilation environment. This doesn't mean that the supplied
17727 values are always correct, or that cross-compilation now works
17728 flawlessly -- but it's a first step (and it shuts up most of
17729 autoconf's warnings about AC_TRY_RUN).
17730
17731- The Unix build is now a bit less chatty, courtesy of the parser
17732 generator. The build is completely silent (except for errors) when
17733 using "make -s", thanks to a -q option to setup.py.
17734
17735C API
17736-----
17737
17738- The "structmember" API now supports some new flag bits to deny read
17739 and/or write access to attributes in restricted execution mode.
17740
17741New platforms
17742-------------
17743
17744- Compaq's iPAQ handheld, running the "familiar" Linux distribution
17745 (http://familiar.handhelds.org).
17746
17747Tests
17748-----
17749
17750- The "classic" standard tests, which work by comparing stdout to
17751 an expected-output file under Lib/test/output/, no longer stop at
17752 the first mismatch. Instead the test is run to completion, and a
17753 variant of ndiff-style comparison is used to report all differences.
17754 This is much easier to understand than the previous style of reporting.
17755
17756- The unittest-based standard tests now use regrtest's test_main()
17757 convention, instead of running as a side-effect of merely being
17758 imported. This allows these tests to be run in more natural and
17759 flexible ways as unittests, outside the regrtest framework.
17760
17761- regrtest.py is much better integrated with unittest and doctest now,
17762 especially in regard to reporting errors.
17763
17764Windows
17765-------
17766
17767- Large file support now also works for files > 4GB, on filesystems
17768 that support it (NTFS under Windows 2000). See "What's New in
17769 Python 2.2a3" for more detail.
17770
17771
17772What's New in Python 2.2a3?
17773===========================
17774
17775*Release Date: 07-Sep-2001*
17776
17777Core
17778----
17779
17780- Conversion of long to float now raises OverflowError if the long is too
17781 big to represent as a C double.
17782
17783- The 3-argument builtin pow() no longer allows a third non-None argument
17784 if either of the first two arguments is a float, or if both are of
17785 integer types and the second argument is negative (in which latter case
17786 the arguments are converted to float, so this is really the same
17787 restriction).
17788
17789- The builtin dir() now returns more information, and sometimes much
17790 more, generally naming all attributes of an object, and all attributes
17791 reachable from the object via its class, and from its class's base
17792 classes, and so on from them too. Example: in 2.2a2, dir([]) returned
17793 an empty list. In 2.2a3,
17794
17795 >>> dir([])
17796 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
17797 '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
17798 '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
17799 '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
17800 '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
17801 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
17802 'reverse', 'sort']
17803
17804 dir(module) continues to return only the module's attributes, though.
17805
17806- Overflowing operations on plain ints now return a long int rather
17807 than raising OverflowError. This is a partial implementation of PEP
17808 237. You can use -Wdefault::OverflowWarning to enable a warning for
17809 this situation, and -Werror::OverflowWarning to revert to the old
17810 OverflowError exception.
17811
17812- A new command line option, -Q<arg>, is added to control run-time
17813 warnings for the use of classic division. (See PEP 238.) Possible
17814 values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
17815 -Qold, meaning the / operator has its classic meaning and no
17816 warnings are issued. Using -Qwarn issues a run-time warning about
17817 all uses of classic division for int and long arguments; -Qwarnall
17818 also warns about classic division for float and complex arguments
17819 (for use with fixdiv.py).
17820 [Note: the remainder of this item (preserved below) became
17821 obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
17822
17823 Using -Qnew is questionable; it turns on new division by default, but
17824 only in the __main__ module. You can usefully combine -Qwarn or
17825 -Qwarnall and -Qnew: this gives the __main__ module new division, and
17826 warns about classic division everywhere else.
17827
17828- Many built-in types can now be subclassed. This applies to int,
17829 long, float, str, unicode, and tuple. (The types complex, list and
17830 dictionary can also be subclassed; this was introduced earlier.)
17831 Note that restrictions apply when subclassing immutable built-in
17832 types: you can only affect the value of the instance by overloading
17833 __new__. You can add mutable attributes, and the subclass instances
17834 will have a __dict__ attribute, but you cannot change the "value"
17835 (as implemented by the base class) of an immutable subclass instance
17836 once it is created.
17837
17838- The dictionary constructor now takes an optional argument, a
17839 mapping-like object, and initializes the dictionary from its
17840 (key, value) pairs.
17841
17842- A new built-in type, super, has been added. This facilitates making
17843 "cooperative super calls" in a multiple inheritance setting. For an
17844 explanation, see http://www.python.org/2.2/descrintro.html#cooperation
17845
17846- A new built-in type, property, has been added. This enables the
17847 creation of "properties". These are attributes implemented by
17848 getter and setter functions (or only one of these for read-only or
17849 write-only attributes), without the need to override __getattr__.
17850 See http://www.python.org/2.2/descrintro.html#property
17851
17852- The syntax of floating-point and imaginary literals has been
17853 liberalized, to allow leading zeroes. Examples of literals now
17854 legal that were SyntaxErrors before:
17855
17856 00.0 0e3 0100j 07.5 00000000000000000008.
17857
17858- An old tokenizer bug allowed floating point literals with an incomplete
17859 exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
17860
17861Library
17862-------
17863
17864- telnetlib includes symbolic names for the options, and support for
17865 setting an option negotiation callback. It also supports processing
17866 of suboptions.
17867
17868- The new C standard no longer requires that math libraries set errno to
17869 ERANGE on overflow. For platform libraries that exploit this new
17870 freedom, Python's overflow-checking was wholly broken. A new overflow-
17871 checking scheme attempts to repair that, but may not be reliable on all
17872 platforms (C doesn't seem to provide anything both useful and portable
17873 in this area anymore).
17874
17875- Asynchronous timeout actions are available through the new class
17876 threading.Timer.
17877
17878- math.log and math.log10 now return sensible results for even huge
17879 long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
17880
17881- A new function, imp.lock_held(), returns 1 when the import lock is
17882 currently held. See the docs for the imp module.
17883
17884- pickle, cPickle and marshal on 32-bit platforms can now correctly read
17885 dumps containing ints written on platforms where Python ints are 8 bytes.
17886 When read on a box where Python ints are 4 bytes, such values are
17887 converted to Python longs.
17888
17889- In restricted execution mode (using the rexec module), unmarshalling
17890 code objects is no longer allowed. This plugs a security hole.
17891
17892- unittest.TestResult instances no longer store references to tracebacks
17893 generated by test failures. This prevents unexpected dangling references
17894 to objects that should be garbage collected between tests.
17895
17896Tools
17897-----
17898
17899- Tools/scripts/fixdiv.py has been added which can be used to fix
17900 division operators as per PEP 238.
17901
17902Build
17903-----
17904
17905- If you are an adventurous person using Mac OS X you may want to look at
17906 Mac/OSX. There is a Makefile there that will build Python as a real Mac
17907 application, which can be used for experimenting with Carbon or Cocoa.
17908 Discussion of this on pythonmac-sig, please.
17909
17910C API
17911-----
17912
17913- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
17914
17915- Note that PyLong_AsDouble can fail! This has always been true, but no
17916 callers checked for it. It's more likely to fail now, because overflow
17917 errors are properly detected now. The proper way to check::
17918
17919 double x = PyLong_AsDouble(some_long_object);
17920 if (x == -1.0 && PyErr_Occurred()) {
17921 /* The conversion failed. */
17922 }
17923
17924- The GC API has been changed. Extensions that use the old API will still
17925 compile but will not participate in GC. To upgrade an extension
17926 module:
17927
17928 - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
17929
17930 - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
17931 PyObject_GC_Del to deallocate them
17932
17933 - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
17934 to PyObject_GC_UnTrack
17935
17936 - remove PyGC_HEAD_SIZE from object size calculations
17937
17938 - remove calls to PyObject_AS_GC and PyObject_FROM_GC
17939
17940- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
17941 These can be used safely to construct string objects from a
17942 sprintf-style format string (similar to the format string supported
17943 by PyErr_Format()).
17944
17945New platforms
17946-------------
17947
17948- Stephen Hansen contributed patches sufficient to get a clean compile
17949 under Borland C (Windows), but he reports problems running it and ran
17950 out of time to complete the port. Volunteers? Expect a MemoryError
17951 when importing the types module; this is probably shallow, and
17952 causing later failures too.
17953
17954Tests
17955-----
17956
17957Windows
17958-------
17959
17960- Large file support is now enabled on Win32 platforms as well as on
17961 Win64. This means that, for example, you can use f.tell() and f.seek()
17962 to manipulate files larger than 2 gigabytes (provided you have enough
17963 disk space, and are using a Windows filesystem that supports large
17964 partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
17965 filesize limit, and large file support makes no difference there.
17966 FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
17967 NTFS has no practical limit on file size, and files of any size can be
17968 used from Python now.
17969
17970- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
17971 points to command.com (patch from Brian Quinlan).
17972
17973
17974What's New in Python 2.2a2?
17975===========================
17976
17977*Release Date: 22-Aug-2001*
17978
17979Build
17980-----
17981
17982- Tim Peters developed a brand new Windows installer using Wise 8.1,
17983 generously donated to us by Wise Solutions.
17984
17985- configure supports a new option --enable-unicode, with the values
17986 ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
17987 type and supporting code is completely removed from the interpreter.
17988
17989- A new configure option --enable-framework builds a Mac OS X framework,
17990 which "make frameworkinstall" will install. This provides a starting
17991 point for more mac-like functionality, join pythonmac-sig@python.org
17992 if you are interested in helping.
17993
17994- The NeXT platform is no longer supported.
17995
17996- The 'new' module is now statically linked.
17997
17998Tools
17999-----
18000
18001- The new Tools/scripts/cleanfuture.py can be used to automatically
18002 edit out obsolete future statements from Python source code. See
18003 the module docstring for details.
18004
18005Tests
18006-----
18007
18008- regrtest.py now knows which tests are expected to be skipped on some
Martin Panterc04fb562016-02-10 05:44:01 +000018009 platforms, allowing clearer test result output to be given. regrtest
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000018010 also has optional --use/-u switch to run normally disabled tests
18011 which require network access or consume significant disk resources.
18012
18013- Several new tests in the standard test suite, with special thanks to
18014 Nick Mathewson.
18015
18016Core
18017----
18018
18019- The floor division operator // has been added as outlined in PEP
18020 238. The / operator still provides classic division (and will until
18021 Python 3.0) unless "from __future__ import division" is included, in
18022 which case the / operator will provide true division. The operator
18023 module provides truediv() and floordiv() functions. Augmented
18024 assignment variants are included, as are the equivalent overloadable
18025 methods and C API methods. See the PEP for a full discussion:
18026 <http://python.sf.net/peps/pep-0238.html>
18027
18028- Future statements are now effective in simulated interactive shells
18029 (like IDLE). This should "just work" by magic, but read Michael
18030 Hudson's "Future statements in simulated shells" PEP 264 for full
18031 details: <http://python.sf.net/peps/pep-0264.html>.
18032
18033- The type/class unification (PEP 252-253) was integrated into the
18034 trunk and is not so tentative any more (the exact specification of
18035 some features is still tentative). A lot of work has done on fixing
18036 bugs and adding robustness and features (performance still has to
18037 come a long way).
18038
18039- Warnings about a mismatch in the Python API during extension import
18040 now use the Python warning framework (which makes it possible to
18041 write filters for these warnings).
18042
18043- A function's __dict__ (aka func_dict) will now always be a
18044 dictionary. It used to be possible to delete it or set it to None,
18045 but now both actions raise TypeErrors. It is still legal to set it
18046 to a dictionary object. Getting func.__dict__ before any attributes
18047 have been assigned now returns an empty dictionary instead of None.
18048
18049- A new command line option, -E, was added which disables the use of
18050 all environment variables, or at least those that are specifically
18051 significant to Python. Usually those have a name starting with
18052 "PYTHON". This was used to fix a problem where the tests fail if
18053 the user happens to have PYTHONHOME or PYTHONPATH pointing to an
18054 older distribution.
18055
18056Library
18057-------
18058
18059- New class Differ and new functions ndiff() and restore() in difflib.py.
18060 These package the algorithms used by the popular Tools/scripts/ndiff.py,
18061 for programmatic reuse.
18062
18063- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
18064 value using the minimal quoting required for the value; more
18065 reliable than using xml.sax.saxutils.escape() for attribute values.
18066
18067- Readline completion support for cmd.Cmd was added.
18068
18069- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
18070
18071- Added function threading.BoundedSemaphore()
18072
18073- Added Ka-Ping Yee's cgitb.py module.
18074
18075- The 'new' module now exposes the CO_xxx flags.
18076
18077- The gc module offers the get_referents function.
18078
18079New platforms
18080-------------
18081
18082C API
18083-----
18084
18085- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
18086 which provide a cross-platform implementations for the
18087 relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
18088 the standard sprintf() and vsprintf() C lib APIs, these versions
18089 apply bounds checking on the used buffer which enhances protection
18090 against buffer overruns.
18091
18092- Unicode APIs now use name mangling to assure that mixing interpreters
18093 and extensions using different Unicode widths is rendered next to
18094 impossible. Trying to import an incompatible Unicode-aware extension
18095 will result in an ImportError. Unicode extensions writers must make
18096 sure to check the Unicode width compatibility in their extensions by
18097 using at least one of the mangled Unicode APIs in the extension.
18098
18099- Two new flags METH_NOARGS and METH_O are available in method definition
18100 tables to simplify implementation of methods with no arguments and a
18101 single untyped argument. Calling such methods is more efficient than
18102 calling corresponding METH_VARARGS methods. METH_OLDARGS is now
18103 deprecated.
18104
18105Windows
18106-------
18107
18108- "import module" now compiles module.pyw if it exists and nothing else
18109 relevant is found.
18110
18111
18112What's New in Python 2.2a1?
18113===========================
18114
18115*Release date: 18-Jul-2001*
18116
18117Core
18118----
18119
18120- TENTATIVELY, a large amount of code implementing much of what's
18121 described in PEP 252 (Making Types Look More Like Classes) and PEP
18122 253 (Subtyping Built-in Types) was added. This will be released
18123 with Python 2.2a1. Documentation will be provided separately
18124 through http://www.python.org/2.2/. The purpose of releasing this
18125 with Python 2.2a1 is to test backwards compatibility. It is
18126 possible, though not likely, that a decision is made not to release
18127 this code as part of 2.2 final, if any serious backwards
18128 incompatibilities are found during alpha testing that cannot be
18129 repaired.
18130
18131- Generators were added; this is a new way to create an iterator (see
18132 below) using what looks like a simple function containing one or
18133 more 'yield' statements. See PEP 255. Since this adds a new
18134 keyword to the language, this feature must be enabled by including a
18135 future statement: "from __future__ import generators" (see PEP 236).
18136 Generators will become a standard feature in a future release
18137 (probably 2.3). Without this future statement, 'yield' remains an
18138 ordinary identifier, but a warning is issued each time it is used.
18139 (These warnings currently don't conform to the warnings framework of
18140 PEP 230; we intend to fix this in 2.2a2.)
18141
18142- The UTF-16 codec was modified to be more RFC compliant. It will now
18143 only remove BOM characters at the start of the string and then
18144 only if running in native mode (UTF-16-LE and -BE won't remove a
18145 leading BMO character).
18146
18147- Strings now have a new method .decode() to complement the already
18148 existing .encode() method. These two methods provide direct access
18149 to the corresponding decoders and encoders of the registered codecs.
18150
18151 To enhance the usability of the .encode() method, the special
18152 casing of Unicode object return values was dropped (Unicode objects
18153 were auto-magically converted to string using the default encoding).
18154
18155 Both methods will now return whatever the codec in charge of the
18156 requested encoding returns as object, e.g. Unicode codecs will
18157 return Unicode objects when decoding is requested ("äöü".decode("latin-1")
18158 will return u"äöü"). This enables codec writer to create codecs
18159 for various simple to use conversions.
18160
18161 New codecs were added to demonstrate these new features (the .encode()
18162 and .decode() columns indicate the type of the returned objects):
18163
18164 +---------+-----------+-----------+-----------------------------+
18165 |Name | .encode() | .decode() | Description |
18166 +=========+===========+===========+=============================+
18167 |uu | string | string | UU codec (e.g. for email) |
18168 +---------+-----------+-----------+-----------------------------+
18169 |base64 | string | string | base64 codec |
18170 +---------+-----------+-----------+-----------------------------+
18171 |quopri | string | string | quoted-printable codec |
18172 +---------+-----------+-----------+-----------------------------+
18173 |zlib | string | string | zlib compression |
18174 +---------+-----------+-----------+-----------------------------+
18175 |hex | string | string | 2-byte hex codec |
18176 +---------+-----------+-----------+-----------------------------+
18177 |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
18178 +---------+-----------+-----------+-----------------------------+
18179
18180- Some operating systems now support the concept of a default Unicode
18181 encoding for file system operations. Notably, Windows supports 'mbcs'
18182 as the default. The Macintosh will also adopt this concept in the medium
18183 term, although the default encoding for that platform will be other than
18184 'mbcs'.
18185
18186 On operating system that support non-ASCII filenames, it is common for
18187 functions that return filenames (such as os.listdir()) to return Python
18188 string objects pre-encoded using the default file system encoding for
18189 the platform. As this encoding is likely to be different from Python's
18190 default encoding, converting this name to a Unicode object before passing
18191 it back to the Operating System would result in a Unicode error, as Python
18192 would attempt to use its default encoding (generally ASCII) rather than
18193 the default encoding for the file system.
18194
18195 In general, this change simply removes surprises when working with
18196 Unicode and the file system, making these operations work as you expect,
18197 increasing the transparency of Unicode objects in this context.
18198 See [????] for more details, including examples.
18199
18200- Float (and complex) literals in source code were evaluated to full
18201 precision only when running from a .py file; the same code loaded from a
18202 .pyc (or .pyo) file could suffer numeric differences starting at about the
18203 12th significant decimal digit. For example, on a machine with IEEE-754
18204 floating arithmetic,
18205
18206 x = 9007199254740992.0
18207 print long(x)
18208
18209 printed 9007199254740992 if run directly from .py, but 9007199254740000
18210 if from a compiled (.pyc or .pyo) file. This was due to marshal using
18211 str(float) instead of repr(float) when building code objects. marshal
18212 now uses repr(float) instead, which should reproduce floats to full
18213 machine precision (assuming the platform C float<->string I/O conversion
18214 functions are of good quality).
18215
18216 This may cause floating-point results to change in some cases, and
18217 usually for the better, but may also cause numerically unstable
18218 algorithms to break.
18219
18220- The implementation of dicts suffers fewer collisions, which has speed
18221 benefits. However, the order in which dict entries appear in dict.keys(),
18222 dict.values() and dict.items() may differ from previous releases for a
18223 given dict. Nothing is defined about this order, so no program should
18224 rely on it. Nevertheless, it's easy to write test cases that rely on the
18225 order by accident, typically because of printing the str() or repr() of a
18226 dict to an "expected results" file. See Lib/test/test_support.py's new
18227 sortdict(dict) function for a simple way to display a dict in sorted
18228 order.
18229
18230- Many other small changes to dicts were made, resulting in faster
18231 operation along the most common code paths.
18232
18233- Dictionary objects now support the "in" operator: "x in dict" means
18234 the same as dict.has_key(x).
18235
18236- The update() method of dictionaries now accepts generic mapping
18237 objects. Specifically the argument object must support the .keys()
18238 and __getitem__() methods. This allows you to say, for example,
18239 {}.update(UserDict())
18240
18241- Iterators were added; this is a generalized way of providing values
18242 to a for loop. See PEP 234. There's a new built-in function iter()
18243 to return an iterator. There's a new protocol to get the next value
18244 from an iterator using the next() method (in Python) or the
18245 tp_iternext slot (in C). There's a new protocol to get iterators
18246 using the __iter__() method (in Python) or the tp_iter slot (in C).
18247 Iterating (i.e. a for loop) over a dictionary generates its keys.
18248 Iterating over a file generates its lines.
18249
18250- The following functions were generalized to work nicely with iterator
18251 arguments::
18252
18253 map(), filter(), reduce(), zip()
18254 list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
18255 max(), min()
18256 join() method of strings
18257 extend() method of lists
18258 'x in y' and 'x not in y' (PySequence_Contains() in C API)
18259 operator.countOf() (PySequence_Count() in C API)
18260 right-hand side of assignment statements with multiple targets, such as ::
18261 x, y, z = some_iterable_object_returning_exactly_3_values
18262
18263- Accessing module attributes is significantly faster (for example,
18264 random.random or os.path or yourPythonModule.yourAttribute).
18265
18266- Comparing dictionary objects via == and != is faster, and now works even
18267 if the keys and values don't support comparisons other than ==.
18268
18269- Comparing dictionaries in ways other than == and != is slower: there were
18270 insecurities in the dict comparison implementation that could cause Python
18271 to crash if the element comparison routines for the dict keys and/or
18272 values mutated the dicts. Making the code bulletproof slowed it down.
18273
18274- Collisions in dicts are resolved via a new approach, which can help
18275 dramatically in bad cases. For example, looking up every key in a dict
18276 d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
18277 faster now. Thanks to Christian Tismer for pointing out the cause and
18278 the nature of an effective cure (last December! better late than never).
18279
18280- repr() is much faster for large containers (dict, list, tuple).
18281
18282
18283Library
18284-------
18285
18286- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
18287 were added to the string module. These a locale-independent
18288 constants, unlike letters, lowercase, and uppercase. These are now
18289 use in appropriate locations in the standard library.
18290
18291- The flags used in dlopen calls can now be configured using
18292 sys.setdlopenflags and queried using sys.getdlopenflags.
18293
18294- Fredrik Lundh's xmlrpclib is now a standard library module. This
18295 provides full client-side XML-RPC support. In addition,
18296 Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
18297 one asyncore-based). Thanks to Eric Raymond for the documentation.
18298
18299- The xrange() object is simplified: it no longer supports slicing,
18300 repetition, comparisons, efficient 'in' checking, the tolist()
18301 method, or the start, stop and step attributes. See PEP 260.
18302
18303- A new function fnmatch.filter to filter lists of file names was added.
18304
18305- calendar.py uses month and day names based on the current locale.
18306
18307- strop is now *really* obsolete (this was announced before with 1.6),
18308 and issues DeprecationWarning when used (except for the four items
18309 that are still imported into string.py).
18310
18311- Cookie.py now sorts key+value pairs by key in output strings.
18312
18313- pprint.isrecursive(object) didn't correctly identify recursive objects.
18314 Now it does.
18315
18316- pprint functions now much faster for large containers (tuple, list, dict).
18317
18318- New 'q' and 'Q' format codes in the struct module, corresponding to C
18319 types "long long" and "unsigned long long" (on Windows, __int64). In
18320 native mode, these can be used only when the platform C compiler supports
18321 these types (when HAVE_LONG_LONG is #define'd by the Python config
18322 process), and then they inherit the sizes and alignments of the C types.
18323 In standard mode, 'q' and 'Q' are supported on all platforms, and are
18324 8-byte integral types.
18325
18326- The site module installs a new built-in function 'help' that invokes
18327 pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
18328 it displays a message reminding the user to use 'help()' or
18329 'help(object)'.
18330
18331Tests
18332-----
18333
18334- New test_mutants.py runs dict comparisons where the key and value
18335 comparison operators mutate the dicts randomly during comparison. This
18336 rapidly causes Python to crash under earlier releases (not for the faint
18337 of heart: it can also cause Win9x to freeze or reboot!).
18338
18339- New test_pprint.py verifies that pprint.isrecursive() and
18340 pprint.isreadable() return sensible results. Also verifies that simple
18341 cases produce correct output.
18342
18343C API
18344-----
18345
18346- Removed the unused last_is_sticky argument from the internal
18347 _PyTuple_Resize(). If this affects you, you were cheating.
18348
Skip Montanaro4cb22042002-09-17 20:55:31 +000018349What's New in Python 2.1 (final)?
18350=================================
18351
18352We only changed a few things since the last release candidate, all in
18353Python library code:
18354
18355- A bug in the locale module was fixed that affected locales which
18356 define no grouping for numeric formatting.
18357
18358- A few bugs in the weakref module's implementations of weak
18359 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
18360 and the test suite was updated to check for these bugs.
18361
18362- An old bug in the os.path.walk() function (introduced in Python
18363 2.0!) was fixed: a non-existent file would cause an exception
18364 instead of being ignored.
18365
18366- Fixed a few bugs in the new symtable module found by Neil Norwitz's
18367 PyChecker.
18368
18369
18370What's New in Python 2.1c2?
18371===========================
18372
18373A flurry of small changes, and one showstopper fixed in the nick of
18374time made it necessary to release another release candidate. The list
18375here is the *complete* list of patches (except version updates):
18376
18377Core
18378
18379- Tim discovered a nasty bug in the dictionary code, caused by
18380 PyDict_Next() calling dict_resize(), and the GC code's use of
18381 PyDict_Next() violating an assumption in dict_items(). This was
18382 fixed with considerable amounts of band-aid, but the net effect is a
18383 saner and more robust implementation.
18384
18385- Made a bunch of symbols static that were accidentally global.
18386
18387Build and Ports
18388
18389- The setup.py script didn't check for a new enough version of zlib
18390 (1.1.3 is needed). Now it does.
18391
18392- Changed "make clean" target to also remove shared libraries.
18393
18394- Added a more general warning about the SGI Irix optimizer to README.
18395
18396Library
18397
18398- Fix a bug in urllib.basejoin("http://host", "../file.html") which
18399 omitted the slash between host and file.html.
18400
18401- The mailbox module's _Mailbox class contained a completely broken
18402 and undocumented seek() method. Ripped it out.
18403
18404- Fixed a bunch of typos in various library modules (urllib2, smtpd,
18405 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
18406
18407- Fixed a few last-minute bugs in unittest.
18408
18409Extensions
18410
18411- Reverted the patch to the OpenSSL code in socketmodule.c to support
18412 RAND_status() and the EGD, and the subsequent patch that tried to
18413 fix it for pre-0.9.5 versions; the problem with the patch is that on
18414 some systems it issues a warning whenever socket is imported, and
18415 that's unacceptable.
18416
18417Tests
18418
18419- Fixed the pickle tests to work with "import test.test_pickle".
18420
18421- Tweaked test_locale.py to actually run the test Windows.
18422
18423- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
18424 not "wb" (which is not a valid mode at all).
18425
18426- Fix pstats browser crashes. Import readline if it exists to make
18427 the user interface nicer.
18428
18429- Add "import thread" to the top of test modules that import the
18430 threading module (test_asynchat and test_threadedtempfile). This
18431 prevents test failures caused by a broken threading module resulting
18432 from a previously caught failed import.
18433
18434- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
18435 needed on some platforms (e.g. Solaris 8) when the tests are run
18436 twice in succession.
18437
18438- Skip rather than fail test_sunaudiodev if no audio device is found.
18439
18440
18441What's New in Python 2.1c1?
18442===========================
18443
18444This list was significantly updated when 2.1c2 was released; the 2.1c1
18445release didn't mention most changes that were actually part of 2.1c1:
18446
18447Legal
18448
18449- Copyright was assigned to the Python Software Foundation (PSF) and a
18450 PSF license (very similar to the CNRI license) was added.
18451
18452- The CNRI copyright notice was updated to include 2001.
18453
18454Core
18455
18456- After a public outcry, assignment to __debug__ is no longer illegal;
18457 instead, a warning is issued. It will become illegal in 2.2.
18458
18459- Fixed a core dump with "%#x" % 0, and changed the semantics so that
18460 "%#x" now always prepends "0x", even if the value is zero.
18461
18462- Fixed some nits in the bytecode compiler.
18463
18464- Fixed core dumps when calling certain kinds of non-functions.
18465
18466- Fixed various core dumps caused by reference count bugs.
18467
18468Build and Ports
18469
18470- Use INSTALL_SCRIPT to install script files.
18471
18472- New port: SCO Unixware 7, by Billy G. Allie.
18473
18474- Updated RISCOS port.
18475
18476- Updated BeOS port and notes.
18477
18478- Various other porting problems resolved.
18479
18480Library
18481
18482- The TERMIOS and SOCKET modules are now truly obsolete and
18483 unnecessary. Their symbols are incorporated in the termios and
18484 socket modules.
18485
18486- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
18487 better tests for pickling.
18488
18489- threading: make Condition.wait() robust against KeyboardInterrupt.
18490
18491- zipfile: add support to zipfile to support opening an archive
18492 represented by an open file rather than a file name. Fix bug where
18493 the archive was not properly closed. Fixed a bug in this bugfix
18494 where flush() was called for a read-only file.
18495
18496- imputil: added an uninstall() method to the ImportManager.
18497
18498- Canvas: fixed bugs in lower() and tkraise() methods.
18499
18500- SocketServer: API change (added overridable close_request() method)
18501 so that the TCP server can explicitly close the request.
18502
18503- pstats: Eric Raymond added a simple interactive statistics browser,
18504 invoked when the module is run as a script.
18505
18506- locale: fixed a problem in format().
18507
18508- webbrowser: made it work when the BROWSER environment variable has a
18509 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
18510 KDE 2. Fixed some other nits.
18511
18512- unittest: changes to allow using a different exception than
18513 AssertionError, and added a few more function aliases. Some other
18514 small changes.
18515
18516- urllib, urllib2: fixed redirect problems and a coupleof other nits.
18517
18518- asynchat: fixed a critical bug in asynchat that slipped through the
18519 2.1b2 release. Fixed another rare bug.
18520
18521- Fix some unqualified except: clauses (always a bad code example).
18522
18523XML
18524
18525- pyexpat: new API get_version_string().
18526
18527- Fixed some minidom bugs.
18528
18529Extensions
18530
18531- Fixed a core dump in _weakref. Removed the weakref.mapping()
18532 function (it adds nothing to the API).
18533
18534- Rationalized the use of header files in the readline module, to make
18535 it compile (albeit with some warnings) with the very recent readline
18536 4.2, without breaking for earlier versions.
18537
18538- Hopefully fixed a buffering problem in linuxaudiodev.
18539
18540- Attempted a fix to make the OpenSSL support in the socket module
18541 work again with pre-0.9.5 versions of OpenSSL.
18542
18543Tests
18544
18545- Added a test case for asynchat and asyncore.
18546
18547- Removed coupling between tests where one test failing could break
18548 another.
18549
18550Tools
18551
18552- Ping added an interactive help browser to pydoc, fixed some nits
18553 in the rest of the pydoc code, and added some features to his
18554 inspect module.
18555
18556- An updated python-mode.el version 4.1 which integrates Ken
18557 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
18558 much nicer in XEmacs and Emacs. When stepping through your program
18559 with pdb, in either the shell window or the *Python* window, the
18560 source file and line will be tracked by an arrow. Very cool!
18561
18562- IDLE: syntax warnings in interactive mode are changed into errors.
18563
18564- Some improvements to Tools/webchecker (ignore some more URL types,
18565 follow some more links).
18566
18567- Brought the Tools/compiler package up to date.
18568
18569
18570What's New in Python 2.1 beta 2?
18571================================
18572
18573(Unlisted are many fixed bugs, more documentation, etc.)
18574
18575Core language, builtins, and interpreter
18576
18577- The nested scopes work (enabled by "from __future__ import
18578 nested_scopes") is completed; in particular, the future now extends
18579 into code executed through exec, eval() and execfile(), and into the
18580 interactive interpreter.
18581
18582- When calling a base class method (e.g. BaseClass.__init__(self)),
18583 this is now allowed even if self is not strictly spoken a class
18584 instance (e.g. when using metaclasses or the Don Beaudry hook).
18585
18586- Slice objects are now comparable but not hashable; this prevents
18587 dict[:] from being accepted but meaningless.
18588
18589- Complex division is now calculated using less braindead algorithms.
18590 This doesn't change semantics except it's more likely to give useful
18591 results in extreme cases. Complex repr() now uses full precision
18592 like float repr().
18593
18594- sgmllib.py now calls handle_decl() for simple <!...> declarations.
18595
18596- It is illegal to assign to the name __debug__, which is set when the
18597 interpreter starts. It is effectively a compile-time constant.
18598
18599- A warning will be issued if a global statement for a variable
18600 follows a use or assignment of that variable.
18601
18602Standard library
18603
18604- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
18605 inspired by JUnit), is now part of the standard library. You now
18606 have a choice of two testing frameworks: unittest requires you to
18607 write testcases as separate code, doctest gathers them from
18608 docstrings. Both approaches have their advantages and
18609 disadvantages.
18610
18611- A new module Tix was added, which wraps the Tix extension library
18612 for Tk. With that module, it is not necessary to statically link
18613 Tix with _tkinter, since Tix will be loaded with Tcl's "package
18614 require" command. See Demo/tix/.
18615
18616- tzparse.py is now obsolete.
18617
18618- In gzip.py, the seek() and tell() methods are removed -- they were
18619 non-functional anyway, and it's better if callers can test for their
18620 existence with hasattr().
18621
18622Python/C API
18623
18624- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
18625 that's already in the dictionary during a PyDict_Next() iteration.
18626 This used to fail occasionally when a dictionary resize operation
18627 could be triggered that would rehash all the keys. All other
18628 modifications to the dictionary are still off-limits during a
18629 PyDict_Next() iteration!
18630
18631- New extended APIs related to passing compiler variables around.
18632
18633- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
18634 implement isinstance() and issubclass().
18635
18636- Py_BuildValue() now has a "D" conversion to create a Python complex
18637 number from a Py_complex C value.
18638
18639- Extensions types which support weak references must now set the
18640 field allocated for the weak reference machinery to NULL themselves;
18641 this is done to avoid the cost of checking each object for having a
18642 weakly referencable type in PyObject_INIT(), since most types are
18643 not weakly referencable.
18644
18645- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
18646 free variables and cell variables to and from the frame's f_locals.
18647
18648- Variants of several functions defined in pythonrun.h have been added
18649 to support the nested_scopes future statement. The variants all end
18650 in Flags and take an extra argument, a PyCompilerFlags *; examples:
18651 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
18652 variants may be removed in Python 2.2, when nested scopes are
18653 mandatory.
18654
18655Distutils
18656
18657- the sdist command now writes a PKG-INFO file, as described in PEP 241,
18658 into the release tree.
18659
18660- several enhancements to the bdist_wininst command from Thomas Heller
18661 (an uninstaller, more customization of the installer's display)
18662
18663- from Jack Jansen: added Mac-specific code to generate a dialog for
18664 users to specify the command-line (because providing a command-line with
18665 MacPython is awkward). Jack also made various fixes for the Mac
18666 and the Metrowerks compiler.
18667
18668- added 'platforms' and 'keywords' to the set of metadata that can be
18669 specified for a distribution.
18670
18671- applied patches from Jason Tishler to make the compiler class work with
18672 Cygwin.
18673
18674
18675What's New in Python 2.1 beta 1?
18676================================
18677
18678Core language, builtins, and interpreter
18679
18680- Following an outcry from the community about the amount of code
18681 broken by the nested scopes feature introduced in 2.1a2, we decided
18682 to make this feature optional, and to wait until Python 2.2 (or at
18683 least 6 months) to make it standard. The option can be enabled on a
18684 per-module basis by adding "from __future__ import nested_scopes" at
18685 the beginning of a module (before any other statements, but after
18686 comments and an optional docstring). See PEP 236 (Back to the
18687 __future__) for a description of the __future__ statement. PEP 227
18688 (Statically Nested Scopes) has been updated to reflect this change,
18689 and to clarify the semantics in a number of endcases.
18690
18691- The nested scopes code, when enabled, has been hardened, and most
18692 bugs and memory leaks in it have been fixed.
18693
18694- Compile-time warnings are now generated for a number of conditions
18695 that will break or change in meaning when nested scopes are enabled:
18696
18697 - Using "from...import *" or "exec" without in-clause in a function
18698 scope that also defines a lambda or nested function with one or
18699 more free (non-local) variables. The presence of the import* or
18700 bare exec makes it impossible for the compiler to determine the
18701 exact set of local variables in the outer scope, which makes it
18702 impossible to determine the bindings for free variables in the
18703 inner scope. To avoid the warning about import *, change it into
18704 an import of explicitly name object, or move the import* statement
18705 to the global scope; to avoid the warning about bare exec, use
18706 exec...in... (a good idea anyway -- there's a possibility that
18707 bare exec will be deprecated in the future).
18708
18709 - Use of a global variable in a nested scope with the same name as a
18710 local variable in a surrounding scope. This will change in
18711 meaning with nested scopes: the name in the inner scope will
18712 reference the variable in the outer scope rather than the global
18713 of the same name. To avoid the warning, either rename the outer
18714 variable, or use a global statement in the inner function.
18715
18716- An optional object allocator has been included. This allocator is
18717 optimized for Python objects and should be faster and use less memory
18718 than the standard system allocator. It is not enabled by default
18719 because of possible thread safety problems. The allocator is only
18720 protected by the Python interpreter lock and it is possible that some
18721 extension modules require a thread safe allocator. The object
18722 allocator can be enabled by providing the "--with-pymalloc" option to
18723 configure.
18724
18725Standard library
18726
18727- pyexpat now detects the expat version if expat.h defines it. A
18728 number of additional handlers are provided, which are only available
18729 since expat 1.95. In addition, the methods SetParamEntityParsing and
18730 GetInputContext of Parser objects are available with 1.95.x
18731 only. Parser objects now provide the ordered_attributes and
18732 specified_attributes attributes. A new module expat.model was added,
18733 which offers a number of additional constants if 1.95.x is used.
18734
18735- xml.dom offers the new functions registerDOMImplementation and
18736 getDOMImplementation.
18737
18738- xml.dom.minidom offers a toprettyxml method. A number of DOM
18739 conformance issues have been resolved. In particular, Element now
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030018740 has a hasAttributes method, and the handling of namespaces was
Skip Montanaro4cb22042002-09-17 20:55:31 +000018741 improved.
18742
18743- Ka-Ping Yee contributed two new modules: inspect.py, a module for
18744 getting information about live Python code, and pydoc.py, a module
18745 for interactively converting docstrings to HTML or text.
18746 Tools/scripts/pydoc, which is now automatically installed into
18747 <prefix>/bin, uses pydoc.py to display documentation; try running
18748 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
18749 lets you browse the module docstrings using a web browser.
18750
18751- New library module difflib.py, primarily packaging the SequenceMatcher
18752 class at the heart of the popular ndiff.py file-comparison tool.
18753
18754- doctest.py (a framework for verifying Python code examples in docstrings)
18755 is now part of the std library.
18756
18757Windows changes
18758
18759- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
18760 small GUI that lets you browse the module docstrings using your
18761 default web browser.
18762
18763- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
18764 Platforms) is implemented. See
18765
18766 http://python.sourceforge.net/peps/pep-0235.html
18767
18768 for full details, especially the "Current Lower-Left Semantics" section.
18769 The new Windows import rules are simpler than before:
18770
18771 A. If the PYTHONCASEOK environment variable exists, same as
18772 before: silently accept the first case-insensitive match of any
18773 kind; raise ImportError if none found.
18774
18775 B. Else search sys.path for the first case-sensitive match; raise
18776 ImportError if none found.
18777
18778 The same rules have been implemented on other platforms with case-
18779 insensitive but case-preserving filesystems too (including Cygwin, and
18780 several flavors of Macintosh operating systems).
18781
18782- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
18783 what it's supposed to do (and does do under NT and 2000) via direct
18784 port manipulation. It's unknown whether this will work on all systems,
18785 but it does work on my Win98SE systems now and was known to be useless on
18786 all Win9x systems before.
18787
18788- Build: Subproject _test (effectively) renamed to _testcapi.
18789
18790New platforms
18791
18792- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
18793 Thanks to Steven Majewski!
18794
18795- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
18796 Tishler!
18797
18798- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
18799 Schwertberger! See RISCOS/README for more information -- it seems
18800 that because of the bizarre filename conventions on RISCOS, no port
18801 to that platform is easy.
18802
18803
18804What's New in Python 2.1 alpha 2?
18805=================================
18806
18807Core language, builtins, and interpreter
18808
18809- Scopes nest. If a name is used in a function or class, but is not
18810 local, the definition in the nearest enclosing function scope will
18811 be used. One consequence of this change is that lambda statements
18812 could reference variables in the namespaces where the lambda is
18813 defined. In some unusual cases, this change will break code.
18814
18815 In all previous version of Python, names were resolved in exactly
18816 three namespaces -- the local namespace, the global namespace, and
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018817 the builtins namespace. According to this old definition, if a
Skip Montanaro4cb22042002-09-17 20:55:31 +000018818 function A is defined within a function B, the names bound in B are
18819 not visible in A. The new rules make names bound in B visible in A,
18820 unless A contains a name binding that hides the binding in B.
18821
18822 Section 4.1 of the reference manual describes the new scoping rules
18823 in detail. The test script in Lib/test/test_scope.py demonstrates
18824 some of the effects of the change.
18825
18826 The new rules will cause existing code to break if it defines nested
18827 functions where an outer function has local variables with the same
18828 name as globals or builtins used by the inner function. Example:
18829
18830 def munge(str):
18831 def helper(x):
18832 return str(x)
18833 if type(str) != type(''):
18834 str = helper(str)
18835 return str.strip()
18836
18837 Under the old rules, the name str in helper() is bound to the
Georg Brandl93dc9eb2010-03-14 10:56:14 +000018838 built-in function str(). Under the new rules, it will be bound to
Skip Montanaro4cb22042002-09-17 20:55:31 +000018839 the argument named str and an error will occur when helper() is
18840 called.
18841
18842- The compiler will report a SyntaxError if "from ... import *" occurs
18843 in a function or class scope. The language reference has documented
18844 that this case is illegal, but the compiler never checked for it.
18845 The recent introduction of nested scope makes the meaning of this
18846 form of name binding ambiguous. In a future release, the compiler
18847 may allow this form when there is no possibility of ambiguity.
18848
18849- repr(string) is easier to read, now using hex escapes instead of octal,
18850 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
18851
18852 >>> "\texample \r\n" + chr(0) + chr(255)
18853 '\texample \r\n\x00\xff' # in 2.1
18854 '\011example \015\012\000\377' # in 2.0
18855
18856- Functions are now compared and hashed by identity, not by value, since
18857 the func_code attribute is writable.
18858
18859- Weak references (PEP 205) have been added. This involves a few
18860 changes in the core, an extension module (_weakref), and a Python
18861 module (weakref). The weakref module is the public interface. It
18862 includes support for "explicit" weak references, proxy objects, and
18863 mappings with weakly held values.
18864
18865- A 'continue' statement can now appear in a try block within the body
18866 of a loop. It is still not possible to use continue in a finally
18867 clause.
18868
18869Standard library
18870
18871- mailbox.py now has a new class, PortableUnixMailbox which is
18872 identical to UnixMailbox but uses a more portable scheme for
18873 determining From_ separators. Also, the constructors for all the
18874 classes in this module have a new optional `factory' argument, which
18875 is a callable used when new message classes must be instantiated by
18876 the next() method.
18877
18878- random.py is now self-contained, and offers all the functionality of
18879 the now-deprecated whrandom.py. See the docs for details. random.py
18880 also supports new functions getstate() and setstate(), for saving
18881 and restoring the internal state of the generator; and jumpahead(n),
18882 for quickly forcing the internal state to be the same as if n calls to
18883 random() had been made. The latter is particularly useful for multi-
18884 threaded programs, creating one instance of the random.Random() class for
18885 each thread, then using .jumpahead() to force each instance to use a
18886 non-overlapping segment of the full period.
18887
18888- random.py's seed() function is new. For bit-for-bit compatibility with
18889 prior releases, use the whseed function instead. The new seed function
18890 addresses two problems: (1) The old function couldn't produce more than
18891 about 2**24 distinct internal states; the new one about 2**45 (the best
18892 that can be done in the Wichmann-Hill generator). (2) The old function
18893 sometimes produced identical internal states when passed distinct
18894 integers, and there was no simple way to predict when that would happen;
18895 the new one guarantees to produce distinct internal states for all
18896 arguments in [0, 27814431486576L).
18897
18898- The socket module now supports raw packets on Linux. The socket
18899 family is AF_PACKET.
18900
18901- test_capi.py is a start at running tests of the Python C API. The tests
18902 are implemented by the new Modules/_testmodule.c.
18903
18904- A new extension module, _symtable, provides provisional access to the
18905 internal symbol table used by the Python compiler. A higher-level
18906 interface will be added on top of _symtable in a future release.
18907
18908- Removed the obsolete soundex module.
18909
18910- xml.dom.minidom now uses the standard DOM exceptions. Node supports
18911 the isSameNode method; NamedNodeMap the get method.
18912
18913- xml.sax.expatreader supports the lexical handler property; it
18914 generates comment, startCDATA, and endCDATA events.
18915
18916Windows changes
18917
18918- Build procedure: the zlib project is built in a different way that
18919 ensures the zlib header files used can no longer get out of synch with
18920 the zlib binary used. See PCbuild\readme.txt for details. Your old
18921 zlib-related directories can be deleted; you'll need to download fresh
18922 source for zlib and unpack it into a new directory.
18923
18924- Build: New subproject _test for the benefit of test_capi.py (see above).
18925
18926- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
18927 interface to some Python compiler internals).
18928
18929- Build: Subproject ucnhash is gone, since the code was folded into the
18930 unicodedata subproject.
18931
18932What's New in Python 2.1 alpha 1?
18933=================================
18934
18935Core language, builtins, and interpreter
18936
18937- There is a new Unicode companion to the PyObject_Str() API
18938 called PyObject_Unicode(). It behaves in the same way as the
Martin Panter6245cb32016-04-15 02:14:19 +000018939 former, but assures that the returned value is a Unicode object
Skip Montanaro4cb22042002-09-17 20:55:31 +000018940 (applying the usual coercion if necessary).
18941
18942- The comparison operators support "rich comparison overloading" (PEP
18943 207). C extension types can provide a rich comparison function in
18944 the new tp_richcompare slot in the type object. The cmp() function
18945 and the C function PyObject_Compare() first try the new rich
18946 comparison operators before trying the old 3-way comparison. There
18947 is also a new C API PyObject_RichCompare() (which also falls back on
18948 the old 3-way comparison, but does not constrain the outcome of the
18949 rich comparison to a Boolean result).
18950
18951 The rich comparison function takes two objects (at least one of
18952 which is guaranteed to have the type that provided the function) and
18953 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
18954 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
18955 object, which may be NotImplemented (in which case the tp_compare
18956 slot function is used as a fallback, if defined).
18957
18958 Classes can overload individual comparison operators by defining one
18959 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
18960 __ge__. There are no explicit "reflected argument" versions of
18961 these; instead, __lt__ and __gt__ are each other's reflection,
18962 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
18963 reflection (similar at the C level). No other implications are
18964 made; in particular, Python does not assume that == is the Boolean
18965 inverse of !=, or that < is the Boolean inverse of >=. This makes
18966 it possible to define types with partial orderings.
18967
18968 Classes or types that want to implement (in)equality tests but not
18969 the ordering operators (i.e. unordered types) should implement ==
18970 and !=, and raise an error for the ordering operators.
18971
18972 It is possible to define types whose rich comparison results are not
18973 Boolean; e.g. a matrix type might want to return a matrix of bits
18974 for A < B, giving elementwise comparisons. Such types should ensure
18975 that any interpretation of their value in a Boolean context raises
18976 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
18977 at the C level) to always raise an exception.
18978
18979- Complex numbers use rich comparisons to define == and != but raise
18980 an exception for <, <=, > and >=. Unfortunately, this also means
18981 that cmp() of two complex numbers raises an exception when the two
18982 numbers differ. Since it is not mathematically meaningful to compare
18983 complex numbers except for equality, I hope that this doesn't break
18984 too much code.
18985
18986- The outcome of comparing non-numeric objects of different types is
18987 not defined by the language, other than that it's arbitrary but
18988 consistent (see the Reference Manual). An implementation detail changed
18989 in 2.1a1 such that None now compares less than any other object. Code
18990 relying on this new behavior (like code that relied on the previous
18991 behavior) does so at its own risk.
18992
18993- Functions and methods now support getting and setting arbitrarily
18994 named attributes (PEP 232). Functions have a new __dict__
18995 (a.k.a. func_dict) which hold the function attributes. Methods get
18996 and set attributes on their underlying im_func. It is a TypeError
18997 to set an attribute on a bound method.
18998
18999- The xrange() object implementation has been improved so that
19000 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
19001 limitation that in this case len(xrange(sys.maxint)) can't be
19002 calculated, but the common idiom "for i in xrange(sys.maxint)" will
19003 work fine as long as the index i doesn't actually reach 2**31.
19004 (Python uses regular ints for sequence and string indices; fixing
19005 that is much more work.)
19006
19007- Two changes to from...import:
19008
19009 1) "from M import X" now works even if (after loading module M)
19010 sys.modules['M'] is not a real module; it's basically a getattr()
19011 operation with AttributeError exceptions changed into ImportError.
19012
19013 2) "from M import *" now looks for M.__all__ to decide which names to
19014 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
19015 filters out names starting with '_' as before. Whether or not
19016 __all__ exists, there's no restriction on the type of M.
19017
19018- File objects have a new method, xreadlines(). This is the fastest
19019 way to iterate over all lines in a file:
19020
19021 for line in file.xreadlines():
19022 ...do something to line...
19023
19024 See the xreadlines module (mentioned below) for how to do this for
19025 other file-like objects.
19026
19027- Even if you don't use file.xreadlines(), you may expect a speedup on
19028 line-by-line input. The file.readline() method has been optimized
19029 quite a bit in platform-specific ways: on systems (like Linux) that
19030 support flockfile(), getc_unlocked(), and funlockfile(), those are
19031 used by default. On systems (like Windows) without getc_unlocked(),
19032 a complicated (but still thread-safe) method using fgets() is used by
19033 default.
19034
19035 You can force use of the fgets() method by #define'ing
19036 USE_FGETS_IN_GETLINE at build time (it may be faster than
19037 getc_unlocked()).
19038
19039 You can force fgets() not to be used by #define'ing
19040 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
19041 test_bufio.py fails -- and let us know if it does!).
19042
19043- In addition, the fileinput module, while still slower than the other
19044 methods on most platforms, has been sped up too, by using
19045 file.readlines(sizehint).
19046
19047- Support for run-time warnings has been added, including a new
19048 command line option (-W) to specify the disposition of warnings.
19049 See the description of the warnings module below.
19050
19051- Extensive changes have been made to the coercion code. This mostly
19052 affects extension modules (which can now implement mixed-type
19053 numerical operators without having to use coercion), but
19054 occasionally, in boundary cases the coercion semantics have changed
19055 subtly. Since this was a terrible gray area of the language, this
19056 is considered an improvement. Also note that __rcmp__ is no longer
19057 supported -- instead of calling __rcmp__, __cmp__ is called with
19058 reflected arguments.
19059
19060- In connection with the coercion changes, a new built-in singleton
19061 object, NotImplemented is defined. This can be returned for
19062 operations that wish to indicate they are not implemented for a
19063 particular combination of arguments. From C, this is
19064 Py_NotImplemented.
19065
19066- The interpreter accepts now bytecode files on the command line even
19067 if they do not have a .pyc or .pyo extension. On Linux, after executing
19068
19069import imp,sys,string
19070magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
19071reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
19072open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
19073
19074 any byte code file can be used as an executable (i.e. as an argument
19075 to execve(2)).
19076
19077- %[xXo] formats of negative Python longs now produce a sign
19078 character. In 1.6 and earlier, they never produced a sign,
19079 and raised an error if the value of the long was too large
19080 to fit in a Python int. In 2.0, they produced a sign if and
19081 only if too large to fit in an int. This was inconsistent
19082 across platforms (because the size of an int varies across
19083 platforms), and inconsistent with hex() and oct(). Example:
19084
19085 >>> "%x" % -0x42L
19086 '-42' # in 2.1
19087 'ffffffbe' # in 2.0 and before, on 32-bit machines
19088 >>> hex(-0x42L)
19089 '-0x42L' # in all versions of Python
19090
19091 The behavior of %d formats for negative Python longs remains
19092 the same as in 2.0 (although in 1.6 and before, they raised
19093 an error if the long didn't fit in a Python int).
19094
19095 %u formats don't make sense for Python longs, but are allowed
19096 and treated the same as %d in 2.1. In 2.0, a negative long
19097 formatted via %u produced a sign if and only if too large to
19098 fit in an int. In 1.6 and earlier, a negative long formatted
19099 via %u raised an error if it was too big to fit in an int.
19100
19101- Dictionary objects have an odd new method, popitem(). This removes
19102 an arbitrary item from the dictionary and returns it (in the form of
19103 a (key, value) pair). This can be useful for algorithms that use a
19104 dictionary as a bag of "to do" items and repeatedly need to pick one
19105 item. Such algorithms normally end up running in quadratic time;
19106 using popitem() they can usually be made to run in linear time.
19107
19108Standard library
19109
19110- In the time module, the time argument to the functions strftime,
19111 localtime, gmtime, asctime and ctime is now optional, defaulting to
19112 the current time (in the local timezone).
19113
19114- The ftplib module now defaults to passive mode, which is deemed a
19115 more useful default given that clients are often inside firewalls
19116 these days. Note that this could break if ftplib is used to connect
19117 to a *server* that is inside a firewall, from outside; this is
19118 expected to be a very rare situation. To fix that, you can call
19119 ftp.set_pasv(0).
19120
19121- The module site now treats .pth files not only for path configuration,
19122 but also supports extensions to the initialization code: Lines starting
19123 with import are executed.
19124
19125- There's a new module, warnings, which implements a mechanism for
19126 issuing and filtering warnings. There are some new built-in
19127 exceptions that serve as warning categories, and a new command line
19128 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
19129 turns warnings into errors). warnings.warn(message[, category])
19130 issues a warning message; this can also be called from C as
19131 PyErr_Warn(category, message).
19132
19133- A new module xreadlines was added. This exports a single factory
19134 function, xreadlines(). The intention is that this code is the
19135 absolutely fastest way to iterate over all lines in an open
19136 file(-like) object:
19137
19138 import xreadlines
19139 for line in xreadlines.xreadlines(file):
19140 ...do something to line...
19141
19142 This is equivalent to the previous the speed record holder using
19143 file.readlines(sizehint). Note that if file is a real file object
19144 (as opposed to a file-like object), this is equivalent:
19145
19146 for line in file.xreadlines():
19147 ...do something to line...
19148
19149- The bisect module has new functions bisect_left, insort_left,
19150 bisect_right and insort_right. The old names bisect and insort
19151 are now aliases for bisect_right and insort_right. XXX_right
19152 and XXX_left methods differ in what happens when the new element
19153 compares equal to one or more elements already in the list: the
19154 XXX_left methods insert to the left, the XXX_right methods to the
19155 right. Code that doesn't care where equal elements end up should
19156 continue to use the old, short names ("bisect" and "insort").
19157
19158- The new curses.panel module wraps the panel library that forms part
19159 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
19160
19161- The SocketServer module now sets the allow_reuse_address flag by
19162 default in the TCPServer class.
19163
19164- A new function, sys._getframe(), returns the stack frame pointer of
19165 the caller. This is intended only as a building block for
19166 higher-level mechanisms such as string interpolation.
19167
19168- The pyexpat module supports a number of new handlers, which are
19169 available only in expat 1.2. If invocation of a callback fails, it
19170 will report an additional frame in the traceback. Parser objects
19171 participate now in garbage collection. If expat reports an unknown
19172 encoding, pyexpat will try to use a Python codec; that works only
19173 for single-byte charsets. The parser type objects is exposed as
19174 XMLParserObject.
19175
19176- xml.dom now offers standard definitions for symbolic node type and
19177 exception code constants, and a hierarchy of DOM exceptions. minidom
19178 was adjusted to use them.
19179
19180- The conformance of xml.dom.minidom to the DOM specification was
19181 improved. It detects a number of additional error cases; the
19182 previous/next relationship works even when the tree is modified;
19183 Node supports the normalize() method; NamedNodeMap, DocumentType and
19184 DOMImplementation classes were added; Element supports the
19185 hasAttribute and hasAttributeNS methods; and Text supports the splitText
19186 method.
19187
19188Build issues
19189
19190- For Unix (and Unix-compatible) builds, configuration and building of
19191 extension modules is now greatly automated. Rather than having to
19192 edit the Modules/Setup file to indicate which modules should be
19193 built and where their include files and libraries are, a
19194 distutils-based setup.py script now takes care of building most
19195 extension modules. All extension modules built this way are built
19196 as shared libraries. Only a few modules that must be linked
19197 statically are still listed in the Setup file; you won't need to
19198 edit their configuration.
19199
19200- Python should now build out of the box on Cygwin. If it doesn't,
19201 mail to Jason Tishler (jlt63 at users.sourceforge.net).
19202
19203- Python now always uses its own (renamed) implementation of getopt()
19204 -- there's too much variation among C library getopt()
19205 implementations.
19206
19207- C++ compilers are better supported; the CXX macro is always set to a
19208 C++ compiler if one is found.
19209
19210Windows changes
19211
19212- select module: By default under Windows, a select() call
19213 can specify no more than 64 sockets. Python now boosts
19214 this Microsoft default to 512. If you need even more than
19215 that, see the MS docs (you'll need to #define FD_SETSIZE
19216 and recompile Python from source).
19217
19218- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
19219 subdirectory is no more!
19220
19221
19222What's New in Python 2.0?
19223=========================
19224
19225Below is a list of all relevant changes since release 1.6. Older
19226changes are in the file HISTORY. If you are making the jump directly
19227from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
19228HISTORY file! Many important changes listed there.
19229
19230Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
19231the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000019232http://www.amk.ca/python/2.0/.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019233
19234--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
19235
19236======================================================================
19237
19238What's new in 2.0 (since release candidate 1)?
19239==============================================
19240
19241Standard library
19242
19243- The copy_reg module was modified to clarify its intended use: to
19244 register pickle support for extension types, not for classes.
19245 pickle() will raise a TypeError if it is passed a class.
19246
19247- Fixed a bug in gettext's "normalize and expand" code that prevented
19248 it from finding an existing .mo file.
19249
19250- Restored support for HTTP/0.9 servers in httplib.
19251
19252- The math module was changed to stop raising OverflowError in case of
19253 underflow, and return 0 instead in underflow cases. Whether Python
19254 used to raise OverflowError in case of underflow was platform-
19255 dependent (it did when the platform math library set errno to ERANGE
19256 on underflow).
19257
19258- Fixed a bug in StringIO that occurred when the file position was not
19259 at the end of the file and write() was called with enough data to
19260 extend past the end of the file.
19261
19262- Fixed a bug that caused Tkinter error messages to get lost on
19263 Windows. The bug was fixed by replacing direct use of
19264 interp->result with Tcl_GetStringResult(interp).
19265
19266- Fixed bug in urllib2 that caused it to fail when it received an HTTP
19267 redirect response.
19268
19269- Several changes were made to distutils: Some debugging code was
19270 removed from util. Fixed the installer used when an external zip
19271 program (like WinZip) is not found; the source code for this
19272 installer is in Misc/distutils. check_lib() was modified to behave
19273 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
19274 test for whether installed modules are on sys.path was changed to
19275 use both normcase() and normpath().
19276
19277- Several minor bugs were fixed in the xml package (the minidom,
19278 pulldom, expatreader, and saxutils modules).
19279
19280- The regression test driver (regrtest.py) behavior when invoked with
19281 -l changed: It now reports a count of objects that are recognized as
19282 garbage but not freed by the garbage collector.
19283
19284- The regression test for the math module was changed to test
19285 exceptional behavior when the test is run in verbose mode. Python
19286 cannot yet guarantee consistent exception behavior across platforms,
19287 so the exception part of test_math is run only in verbose mode, and
19288 may fail on your platform.
19289
19290Internals
19291
19292- PyOS_CheckStack() has been disabled on Win64, where it caused
19293 test_sre to fail.
19294
19295Build issues
19296
19297- Changed compiler flags, so that gcc is always invoked with -Wall and
19298 -Wstrict-prototypes. Users compiling Python with GCC should see
19299 exactly one warning, except if they have passed configure the
19300 --with-pydebug flag. The expected warning is for getopt() in
19301 Modules/main.c. This warning will be fixed for Python 2.1.
19302
19303- Fixed configure to add -threads argument during linking on OSF1.
19304
19305Tools and other miscellany
19306
19307- The compiler in Tools/compiler was updated to support the new
19308 language features introduced in 2.0: extended print statement, list
19309 comprehensions, and augmented assignments. The new compiler should
19310 also be backwards compatible with Python 1.5.2; the compiler will
19311 always generate code for the version of the interpreter it runs
19312 under.
19313
19314What's new in 2.0 release candidate 1 (since beta 2)?
19315=====================================================
19316
19317What is release candidate 1?
19318
19319We believe that release candidate 1 will fix all known bugs that we
19320intend to fix for the 2.0 final release. This release should be a bit
19321more stable than the previous betas. We would like to see even more
19322widespread testing before the final release, so we are producing this
19323release candidate. The final release will be exactly the same unless
19324any show-stopping (or brown bag) bugs are found by testers of the
19325release candidate.
19326
19327All the changes since the last beta release are bug fixes or changes
19328to support building Python for specific platforms.
19329
19330Core language, builtins, and interpreter
19331
19332- A bug that caused crashes when __coerce__ was used with augmented
19333 assignment, e.g. +=, was fixed.
19334
19335- Raise ZeroDivisionError when raising zero to a negative number,
Georg Brandl93dc9eb2010-03-14 10:56:14 +000019336 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the built-in
Skip Montanaro4cb22042002-09-17 20:55:31 +000019337 power operator and the result of math.pow(0.0, -2.0) will vary by
19338 platform. On Linux, it raises a ValueError.
19339
19340- A bug in Unicode string interpolation was fixed that occasionally
19341 caused errors with formats including "%%". For example, the
19342 following expression "%% %s" % u"abc" no longer raises a TypeError.
19343
19344- Compilation of deeply nested expressions raises MemoryError instead
19345 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
19346
19347- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
19348 rendering them useless. They are now written in binary mode again.
19349
19350Standard library
19351
19352- Keyword arguments are now accepted for most pattern and match object
19353 methods in SRE, the standard regular expression engine.
19354
19355- In SRE, fixed error with negative lookahead and lookbehind that
19356 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
19357
19358- Several bugs in the Unicode handling and error handling in _tkinter
19359 were fixed.
19360
19361- Fix memory management errors in Merge() and Tkapp_Call() routines.
19362
19363- Several changes were made to cStringIO to make it compatible with
19364 the file-like object interface and with StringIO. If operations are
19365 performed on a closed object, an exception is raised. The truncate
19366 method now accepts a position argument and readline accepts a size
19367 argument.
19368
19369- There were many changes made to the linuxaudiodev module and its
19370 test suite; as a result, a short, unexpected audio sample should now
19371 play when the regression test is run.
19372
19373 Note that this module is named poorly, because it should work
19374 correctly on any platform that supports the Open Sound System
19375 (OSS).
19376
19377 The module now raises exceptions when errors occur instead of
19378 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
19379 audio) and defines a getptr() method that calls the
19380 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
19381
19382- The library_version attribute, introduced in an earlier beta, was
19383 removed because it can not be supported with early versions of the C
19384 readline library, which provides no way to determine the version at
19385 compile-time.
19386
19387- The binascii module is now enabled on Win64.
19388
19389- tokenize.py no longer suffers "recursion depth" errors when parsing
19390 programs with very long string literals.
19391
19392Internals
19393
19394- Fixed several buffer overflow vulnerabilities in calculate_path(),
19395 which is called when the interpreter starts up to determine where
19396 the standard library is installed. These vulnerabilities affect all
19397 previous versions of Python and can be exploited by setting very
19398 long values for PYTHONHOME or argv[0]. The risk is greatest for a
19399 setuid Python script, although use of the wrapper in
19400 Misc/setuid-prog.c will eliminate the vulnerability.
19401
19402- Fixed garbage collection bugs in instance creation that were
19403 triggered when errors occurred during initialization. The solution,
19404 applied in cPickle and in PyInstance_New(), is to call
19405 PyObject_GC_Init() after the initialization of the object's
19406 container attributes is complete.
19407
19408- pyexpat adds definitions of PyModule_AddStringConstant and
19409 PyModule_AddObject if the Python version is less than 2.0, which
19410 provides compatibility with PyXML on Python 1.5.2.
19411
19412- If the platform has a bogus definition for LONG_BIT (the number of
19413 bits in a long), an error will be reported at compile time.
19414
19415- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
19416 collection crashes and possibly other, unreported crashes.
19417
19418- Fixed a memory leak in _PyUnicode_Fini().
19419
19420Build issues
19421
19422- configure now accepts a --with-suffix option that specifies the
19423 executable suffix. This is useful for builds on Cygwin and Mac OS
19424 X, for example.
19425
19426- The mmap.PAGESIZE constant is now initialized using sysconf when
19427 possible, which eliminates a dependency on -lucb for Reliant UNIX.
19428
19429- The md5 file should now compile on all platforms.
19430
19431- The select module now compiles on platforms that do not define
19432 POLLRDNORM and related constants.
19433
19434- Darwin (Mac OS X): Initial support for static builds on this
19435 platform.
19436
19437- BeOS: A number of changes were made to the build and installation
19438 process. ar-fake now operates on a directory of object files.
19439 dl_export.h is gone, and its macros now appear on the mwcc command
19440 line during build on PPC BeOS.
19441
19442- Platform directory in lib/python2.0 is "plat-beos5" (or
19443 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
19444
19445- Cygwin: Support for shared libraries, Tkinter, and sockets.
19446
19447- SunOS 4.1.4_JL: Fix test for directory existence in configure.
19448
19449Tools and other miscellany
19450
19451- Removed debugging prints from main used with freeze.
19452
19453- IDLE auto-indent no longer crashes when it encounters Unicode
19454 characters.
19455
19456What's new in 2.0 beta 2 (since beta 1)?
19457========================================
19458
19459Core language, builtins, and interpreter
19460
19461- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
19462 "%d" % 2L**64 == "18446744073709551616".
19463
19464- Add -h and -V command line options to print the usage message and
19465 Python version number and exit immediately.
19466
19467- eval() and exec accept Unicode objects as code parameters.
19468
19469- getattr() and setattr() now also accept Unicode objects for the
19470 attribute name, which are converted to strings using the default
19471 encoding before lookup.
19472
19473- Multiplication on string and Unicode now does proper bounds
19474 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
19475 string is too long."
19476
19477- Better error message when continue is found in try statement in a
19478 loop.
19479
19480
19481Standard library and extensions
19482
19483- socket module: the OpenSSL code now adds support for RAND_status()
19484 and EGD (Entropy Gathering Device).
19485
19486- array: reverse() method of array now works. buffer_info() now does
19487 argument checking; it still takes no arguments.
19488
19489- asyncore/asynchat: Included most recent version from Sam Rushing.
19490
19491- cgi: Accept '&' or ';' as separator characters when parsing form data.
19492
19493- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
19494
19495- ConfigParser: When reading the file, options spelled in upper case
19496 letters are now correctly converted to lowercase.
19497
19498- copy: Copy Unicode objects atomically.
19499
19500- cPickle: Fail gracefully when copy_reg can't be imported.
19501
19502- cStringIO: Implemented readlines() method.
19503
19504- dbm: Add get() and setdefault() methods to dbm object. Add constant
19505 `library' to module that names the library used. Added doc strings
19506 and method names to error messages. Uses configure to determine
19507 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
19508 now available options.
19509
19510- distutils: Update to version 0.9.3.
19511
19512- dl: Add several dl.RTLD_ constants.
19513
19514- fpectl: Now supported on FreeBSD.
19515
19516- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
19517 found by the collector will be saved in gc.garbage. This is useful
19518 for debugging a program that creates reference cycles.
19519
19520- httplib: Three changes: Restore support for set_debuglevel feature
19521 of HTTP class. Do not close socket on zero-length response. Do not
19522 crash when server sends invalid content-length header.
19523
19524- mailbox: Mailbox class conforms better to qmail specifications.
19525
19526- marshal: When reading a short, sign-extend on platforms where shorts
19527 are bigger than 16 bits. When reading a long, repair the unportable
19528 sign extension that was being done for 64-bit machines. (It assumed
19529 that signed right shift sign-extends.)
19530
19531- operator: Add contains(), invert(), __invert__() as aliases for
19532 __contains__(), inv(), and __inv__() respectively.
19533
19534- os: Add support for popen2() and popen3() on all platforms where
19535 fork() exists. (popen4() is still in the works.)
19536
19537- os: (Windows only:) Add startfile() function that acts like double-
19538 clicking on a file in Explorer (or passing the file name to the
19539 DOS "start" command).
19540
19541- os.path: (Windows, DOS:) Treat trailing colon correctly in
19542 os.path.join. os.path.join("a:", "b") yields "a:b".
19543
19544- pickle: Now raises ValueError when an invalid pickle that contains
19545 a non-string repr where a string repr was expected. This behavior
19546 matches cPickle.
19547
19548- posixfile: Remove broken __del__() method.
19549
19550- py_compile: support CR+LF line terminators in source file.
19551
19552- readline: Does not immediately exit when ^C is hit when readline and
19553 threads are configured. Adds definition of rl_library_version. (The
19554 latter addition requires GNU readline 2.2 or later.)
19555
19556- rfc822: Domain literals returned by AddrlistClass method
19557 getdomainliteral() are now properly wrapped in brackets.
19558
19559- site: sys.setdefaultencoding() should only be called in case the
19560 standard default encoding ("ascii") is changed. This saves quite a
19561 few cycles during startup since the first call to
19562 setdefaultencoding() will initialize the codec registry and the
19563 encodings package.
19564
19565- socket: Support for size hint in readlines() method of object returned
19566 by makefile().
19567
19568- sre: Added experimental expand() method to match objects. Does not
19569 use buffer interface on Unicode strings. Does not hang if group id
19570 is followed by whitespace.
19571
19572- StringIO: Size hint in readlines() is now supported as documented.
19573
19574- struct: Check ranges for bytes and shorts.
19575
19576- urllib: Improved handling of win32 proxy settings. Fixed quote and
19577 quote_plus functions so that the always encode a comma.
19578
19579- Tkinter: Image objects are now guaranteed to have unique ids. Set
19580 event.delta to zero if Tk version doesn't support mousewheel.
19581 Removed some debugging prints.
19582
19583- UserList: now implements __contains__().
19584
19585- webbrowser: On Windows, use os.startfile() instead of os.popen(),
19586 which works around a bug in Norton AntiVirus 2000 that leads directly
19587 to a Blue Screen freeze.
19588
19589- xml: New version detection code allows PyXML to override standard
19590 XML package if PyXML version is greater than 0.6.1.
19591
19592- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
19593 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
19594 tree only for nodes which are sufficiently interesting to a specific
19595 application. Does not provide the HTML-specific extensions. Still
19596 undocumented.
19597
19598- xml.sax: SAX 2 support for Python, including all the handler
19599 interfaces needed to process XML 1.0 compliant XML. Some
19600 documentation is already available.
19601
19602- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
19603 packagized XML support.
19604
19605
19606C API
19607
19608- Add three new convenience functions for module initialization --
19609 PyModule_AddObject(), PyModule_AddIntConstant(), and
19610 PyModule_AddStringConstant().
19611
19612- Cleaned up definition of NULL in C source code; all definitions were
19613 removed and add #error to Python.h if NULL isn't defined after
19614 #include of stdio.h.
19615
19616- Py_PROTO() macros that were removed in 2.0b1 have been restored for
19617 backwards compatibility (at the source level) with old extensions.
19618
19619- A wrapper API was added for signal() and sigaction(). Instead of
19620 either function, always use PyOS_getsig() to get a signal handler
19621 and PyOS_setsig() to set one. A new convenience typedef
19622 PyOS_sighandler_t is defined for the type of signal handlers.
19623
19624- Add PyString_AsStringAndSize() function that provides access to the
19625 internal data buffer and size of a string object -- or the default
19626 encoded version of a Unicode object.
19627
19628- PyString_Size() and PyString_AsString() accept Unicode objects.
19629
19630- The standard header <limits.h> is now included by Python.h (if it
19631 exists). INT_MAX and LONG_MAX will always be defined, even if
19632 <limits.h> is not available.
19633
19634- PyFloat_FromString takes a second argument, pend, that was
19635 effectively useless. It is now officially useless but preserved for
19636 backwards compatibility. If the pend argument is not NULL, *pend is
19637 set to NULL.
19638
19639- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
19640 for the attribute name. See note on getattr() above.
19641
19642- A few bug fixes to argument processing for Unicode.
19643 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
19644 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
19645 pointer to the default encoded string data instead of to the raw
19646 UTF-16.
19647
19648- Py_BuildValue accepts B format (for bgen-generated code).
19649
19650
19651Internals
19652
19653- On Unix, fix code for finding Python installation directory so that
19654 it works when argv[0] is a relative path.
19655
19656- Added a true unicode_internal_encode() function and fixed the
19657 unicode_internal_decode function() to support Unicode objects directly
19658 rather than by generating a copy of the object.
19659
19660- Several of the internal Unicode tables are much smaller now, and
19661 the source code should be much friendlier to weaker compilers.
19662
19663- In the garbage collector: Fixed bug in collection of tuples. Fixed
19664 bug that caused some instances to be removed from the container set
19665 while they were still live. Fixed parsing in gc.set_debug() for
19666 platforms where sizeof(long) > sizeof(int).
19667
19668- Fixed refcount problem in instance deallocation that only occurred
19669 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
19670
19671- On Windows, getpythonregpath is now protected against null data in
19672 registry key.
19673
19674- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
19675 condition.
19676
19677
19678Build and platform-specific issues
19679
19680- Better support of GNU Pth via --with-pth configure option.
19681
19682- Python/C API now properly exposed to dynamically-loaded extension
19683 modules on Reliant UNIX.
19684
19685- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
19686 Don't define MS_SYNC to be zero when it is undefined. Added missing
19687 prototypes in posixmodule.c.
19688
19689- Improved support for HP-UX build. Threads should now be correctly
19690 configured (on HP-UX 10.20 and 11.00).
19691
19692- Fix largefile support on older NetBSD systems and OpenBSD by adding
19693 define for TELL64.
19694
19695
19696Tools and other miscellany
19697
19698- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
19699
19700- freeze: The modulefinder now works with 2.0 opcodes.
19701
19702- IDLE:
19703 Move hackery of sys.argv until after the Tk instance has been
19704 created, which allows the application-specific Tkinter
19705 initialization to be executed if present; also pass an explicit
19706 className parameter to the Tk() constructor.
19707
19708
19709What's new in 2.0 beta 1?
19710=========================
19711
19712Source Incompatibilities
19713------------------------
19714
19715None. Note that 1.6 introduced several incompatibilities with 1.5.2,
19716such as single-argument append(), connect() and bind(), and changes to
19717str(long) and repr(float).
19718
19719
19720Binary Incompatibilities
19721------------------------
19722
19723- Third party extensions built for Python 1.5.x or 1.6 cannot be used
19724with Python 2.0; these extensions will have to be rebuilt for Python
197252.0.
19726
19727- On Windows, attempting to import a third party extension built for
19728Python 1.5.x or 1.6 results in an immediate crash; there's not much we
19729can do about this. Check your PYTHONPATH environment variable!
19730
19731- Python bytecode files (*.pyc and *.pyo) are not compatible between
19732releases.
19733
19734
19735Overview of Changes Since 1.6
19736-----------------------------
19737
19738There are many new modules (including brand new XML support through
19739the xml package, and i18n support through the gettext module); a list
19740of all new modules is included below. Lots of bugs have been fixed.
19741
19742The process for making major new changes to the language has changed
19743since Python 1.6. Enhancements must now be documented by a Python
19744Enhancement Proposal (PEP) before they can be accepted.
19745
19746There are several important syntax enhancements, described in more
19747detail below:
19748
19749 - Augmented assignment, e.g. x += 1
19750
19751 - List comprehensions, e.g. [x**2 for x in range(10)]
19752
19753 - Extended import statement, e.g. import Module as Name
19754
19755 - Extended print statement, e.g. print >> file, "Hello"
19756
19757Other important changes:
19758
19759 - Optional collection of cyclical garbage
19760
19761Python Enhancement Proposal (PEP)
19762---------------------------------
19763
19764PEP stands for Python Enhancement Proposal. A PEP is a design
19765document providing information to the Python community, or describing
19766a new feature for Python. The PEP should provide a concise technical
19767specification of the feature and a rationale for the feature.
19768
19769We intend PEPs to be the primary mechanisms for proposing new
19770features, for collecting community input on an issue, and for
19771documenting the design decisions that have gone into Python. The PEP
19772author is responsible for building consensus within the community and
19773documenting dissenting opinions.
19774
19775The PEPs are available at http://python.sourceforge.net/peps/.
19776
19777Augmented Assignment
19778--------------------
19779
19780This must have been the most-requested feature of the past years!
19781Eleven new assignment operators were added:
19782
19783 += -= *= /= %= **= <<= >>= &= ^= |=
19784
19785For example,
19786
19787 A += B
19788
19789is similar to
19790
19791 A = A + B
19792
19793except that A is evaluated only once (relevant when A is something
19794like dict[index].attr).
19795
19796However, if A is a mutable object, A may be modified in place. Thus,
19797if A is a number or a string, A += B has the same effect as A = A+B
19798(except A is only evaluated once); but if a is a list, A += B has the
19799same effect as A.extend(B)!
19800
19801Classes and built-in object types can override the new operators in
19802order to implement the in-place behavior; the not-in-place behavior is
19803used automatically as a fallback when an object doesn't implement the
19804in-place behavior. For classes, the method name is derived from the
19805method name for the corresponding not-in-place operator by inserting
19806an 'i' in front of the name, e.g. __iadd__ implements in-place
19807__add__.
19808
19809Augmented assignment was implemented by Thomas Wouters.
19810
19811
19812List Comprehensions
19813-------------------
19814
19815This is a flexible new notation for lists whose elements are computed
19816from another list (or lists). The simplest form is:
19817
19818 [<expression> for <variable> in <sequence>]
19819
19820For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
19821This is more efficient than a for loop with a list.append() call.
19822
19823You can also add a condition:
19824
19825 [<expression> for <variable> in <sequence> if <condition>]
19826
19827For example, [w for w in words if w == w.lower()] would yield the list
19828of words that contain no uppercase characters. This is more efficient
19829than a for loop with an if statement and a list.append() call.
19830
19831You can also have nested for loops and more than one 'if' clause. For
19832example, here's a function that flattens a sequence of sequences::
19833
19834 def flatten(seq):
19835 return [x for subseq in seq for x in subseq]
19836
19837 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
19838
19839This prints
19840
19841 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
19842
19843List comprehensions originated as a patch set from Greg Ewing; Skip
19844Montanaro and Thomas Wouters also contributed. Described by PEP 202.
19845
19846
19847Extended Import Statement
19848-------------------------
19849
19850Many people have asked for a way to import a module under a different
19851name. This can be accomplished like this:
19852
19853 import foo
19854 bar = foo
19855 del foo
19856
19857but this common idiom gets old quickly. A simple extension of the
19858import statement now allows this to be written as follows:
19859
19860 import foo as bar
19861
19862There's also a variant for 'from ... import':
19863
19864 from foo import bar as spam
19865
19866This also works with packages; e.g. you can write this:
19867
19868 import test.regrtest as regrtest
19869
19870Note that 'as' is not a new keyword -- it is recognized only in this
19871context (this is only possible because the syntax for the import
19872statement doesn't involve expressions).
19873
19874Implemented by Thomas Wouters. Described by PEP 221.
19875
19876
19877Extended Print Statement
19878------------------------
19879
19880Easily the most controversial new feature, this extension to the print
19881statement adds an option to make the output go to a different file
19882than the default sys.stdout.
19883
19884For example, to write an error message to sys.stderr, you can now
19885write:
19886
19887 print >> sys.stderr, "Error: bad dog!"
19888
19889As a special feature, if the expression used to indicate the file
19890evaluates to None, the current value of sys.stdout is used. Thus:
19891
19892 print >> None, "Hello world"
19893
19894is equivalent to
19895
19896 print "Hello world"
19897
19898Design and implementation by Barry Warsaw. Described by PEP 214.
19899
19900
19901Optional Collection of Cyclical Garbage
19902---------------------------------------
19903
19904Python is now equipped with a garbage collector that can hunt down
19905cyclical references between Python objects. It's no replacement for
19906reference counting; in fact, it depends on the reference counts being
19907correct, and decides that a set of objects belong to a cycle if all
19908their reference counts can be accounted for from their references to
19909each other. This devious scheme was first proposed by Eric Tiedemann,
19910and brought to implementation by Neil Schemenauer.
19911
19912There's a module "gc" that lets you control some parameters of the
19913garbage collection. There's also an option to the configure script
19914that lets you enable or disable the garbage collection. In 2.0b1,
19915it's on by default, so that we (hopefully) can collect decent user
19916experience with this new feature. There are some questions about its
19917performance. If it proves to be too much of a problem, we'll turn it
19918off by default in the final 2.0 release.
19919
19920
19921Smaller Changes
19922---------------
19923
19924A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
19925map(None, seq1, seq2, ...) when the sequences have the same length;
19926i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
19927the lists are not all the same length, the shortest list wins:
19928zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
19929
19930sys.version_info is a tuple (major, minor, micro, level, serial).
19931
19932Dictionaries have an odd new method, setdefault(key, default).
19933dict.setdefault(key, default) returns dict[key] if it exists; if not,
19934it sets dict[key] to default and returns that value. Thus:
19935
19936 dict.setdefault(key, []).append(item)
19937
19938does the same work as this common idiom:
19939
19940 if not dict.has_key(key):
19941 dict[key] = []
19942 dict[key].append(item)
19943
19944There are two new variants of SyntaxError that are raised for
19945indentation-related errors: IndentationError and TabError.
19946
19947Changed \x to consume exactly two hex digits; see PEP 223. Added \U
19948escape that consumes exactly eight hex digits.
19949
19950The limits on the size of expressions and file in Python source code
19951have been raised from 2**16 to 2**32. Previous versions of Python
19952were limited because the maximum argument size the Python VM accepted
19953was 2**16. This limited the size of object constructor expressions,
19954e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
19955limit was raised thanks to a patch by Charles Waldman that effectively
19956fixes the problem. It is now much more likely that you will be
19957limited by available memory than by an arbitrary limit in Python.
19958
19959The interpreter's maximum recursion depth can be modified by Python
19960programs using sys.getrecursionlimit and sys.setrecursionlimit. This
19961limit is the maximum number of recursive calls that can be made by
19962Python code. The limit exists to prevent infinite recursion from
19963overflowing the C stack and causing a core dump. The default value is
199641000. The maximum safe value for a particular platform can be found
Georg Brandl93d15cd2009-10-11 21:24:34 +000019965by running Tools/scripts/find_recursionlimit.py.
Skip Montanaro4cb22042002-09-17 20:55:31 +000019966
19967New Modules and Packages
19968------------------------
19969
19970atexit - for registering functions to be called when Python exits.
19971
19972imputil - Greg Stein's alternative API for writing custom import
19973hooks.
19974
19975pyexpat - an interface to the Expat XML parser, contributed by Paul
19976Prescod.
19977
19978xml - a new package with XML support code organized (so far) in three
19979subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
19980would fill a volume. There's a special feature whereby a
19981user-installed package named _xmlplus overrides the standard
19982xmlpackage; this is intended to give the XML SIG a hook to distribute
19983backwards-compatible updates to the standard xml package.
19984
19985webbrowser - a platform-independent API to launch a web browser.
19986
19987
19988Changed Modules
19989---------------
19990
19991array -- new methods for array objects: count, extend, index, pop, and
19992remove
19993
19994binascii -- new functions b2a_hex and a2b_hex that convert between
19995binary data and its hex representation
19996
19997calendar -- Many new functions that support features including control
19998over which day of the week is the first day, returning strings instead
19999of printing them. Also new symbolic constants for days of week,
20000e.g. MONDAY, ..., SUNDAY.
20001
20002cgi -- FieldStorage objects have a getvalue method that works like a
20003dictionary's get method and returns the value attribute of the object.
20004
20005ConfigParser -- The parser object has new methods has_option,
20006remove_section, remove_option, set, and write. They allow the module
20007to be used for writing config files as well as reading them.
20008
20009ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
20010optionally support the RFC 959 REST command.
20011
20012gzip -- readline and readlines now accept optional size arguments
20013
20014httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
20015the module doc strings for details.
20016
20017locale -- implement getdefaultlocale for Win32 and Macintosh
20018
20019marshal -- no longer dumps core when marshaling deeply nested or
20020recursive data structures
20021
20022os -- new functions isatty, seteuid, setegid, setreuid, setregid
20023
20024os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
20025support under Unix.
20026
20027os/pty -- support for openpty and forkpty
20028
20029os.path -- fix semantics of os.path.commonprefix
20030
20031smtplib -- support for sending very long messages
20032
20033socket -- new function getfqdn()
20034
20035readline -- new functions to read, write and truncate history files.
20036The readline section of the library reference manual contains an
20037example.
20038
20039select -- add interface to poll system call
20040
20041shutil -- new copyfileobj function
20042
20043SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
20044HTTP server.
20045
20046Tkinter -- optimization of function flatten
20047
20048urllib -- scans environment variables for proxy configuration,
20049e.g. http_proxy.
20050
20051whichdb -- recognizes dumbdbm format
20052
20053
20054Obsolete Modules
20055----------------
20056
20057None. However note that 1.6 made a whole slew of modules obsolete:
20058stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
20059poly, zmod, strop, util, whatsound.
20060
20061
20062Changed, New, Obsolete Tools
20063----------------------------
20064
20065None.
20066
20067
20068C-level Changes
20069---------------
20070
20071Several cleanup jobs were carried out throughout the source code.
20072
20073All C code was converted to ANSI C; we got rid of all uses of the
20074Py_PROTO() macro, which makes the header files a lot more readable.
20075
20076Most of the portability hacks were moved to a new header file,
20077pyport.h; several other new header files were added and some old
20078header files were removed, in an attempt to create a more rational set
20079of header files. (Few of these ever need to be included explicitly;
20080they are all included by Python.h.)
20081
20082Trent Mick ensured portability to 64-bit platforms, under both Linux
20083and Win64, especially for the new Intel Itanium processor. Mick also
20084added large file support for Linux64 and Win64.
20085
20086The C APIs to return an object's size have been update to consistently
20087use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
20088previous versions, the abstract interfaces used PyXXX_Length and the
20089concrete interfaces used PyXXX_Size. The old names,
20090e.g. PyObject_Length, are still available for backwards compatibility
20091at the API level, but are deprecated.
20092
20093The PyOS_CheckStack function has been implemented on Windows by
20094Fredrik Lundh. It prevents Python from failing with a stack overflow
20095on Windows.
20096
20097The GC changes resulted in creation of two new slots on object,
20098tp_traverse and tp_clear. The augmented assignment changes result in
20099the creation of a new slot for each in-place operator.
20100
20101The GC API creates new requirements for container types implemented in
20102C extension modules. See Include/objimpl.h for details.
20103
20104PyErr_Format has been updated to automatically calculate the size of
20105the buffer needed to hold the formatted result string. This change
20106prevents crashes caused by programmer error.
20107
20108New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
20109
20110PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
20111that are the same as their non-Ex counterparts except they take an
20112extra flag argument that tells them to close the file when done.
20113
20114XXX There were other API changes that should be fleshed out here.
20115
20116
20117Windows Changes
20118---------------
20119
20120New popen2/popen3/peopen4 in os module (see Changed Modules above).
20121
20122os.popen is much more usable on Windows 95 and 98. See Microsoft
20123Knowledge Base article Q150956. The Win9x workaround described there
20124is implemented by the new w9xpopen.exe helper in the root of your
20125Python installation. Note that Python uses this internally; it is not
20126a standalone program.
20127
20128Administrator privileges are no longer required to install Python
20129on Windows NT or Windows 2000. If you have administrator privileges,
20130Python's registry info will be written under HKEY_LOCAL_MACHINE.
20131Otherwise the installer backs off to writing Python's registry info
20132under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
20133uses of Python, but will prevent some advanced uses from working
20134(for example, running a Python script as an NT service, or possibly
20135from CGI).
20136
20137[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
20138installer; instead, it installs the needed Tcl/Tk files directly in the
20139Python directory. If you already have a Tcl/Tk installation, this
20140wastes some disk space (about 4 Megs) but avoids problems with
20141conflicting Tcl/Tk installations, and makes it much easier for Python
20142to ensure that Tcl/Tk can find all its files.
20143
20144[This was new in 1.6] The Windows installer now installs by default in
20145\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
20146
20147
20148Updates to the changes between 1.5.2 and 1.6
20149--------------------------------------------
20150
20151The 1.6 NEWS file can't be changed after the release is done, so here
20152is some late-breaking news:
20153
20154New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
20155and changes to getlocale() and setlocale().
20156
20157The new module is now enabled per default.
20158
20159It is not true that the encodings codecs cannot be used for normal
20160strings: the string.encode() (which is also present on 8-bit strings
20161!) allows using them for 8-bit strings too, e.g. to convert files from
20162cp1252 (Windows) to latin-1 or vice-versa.
20163
20164Japanese codecs are available from Tamito KAJIYAMA:
20165http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
20166
20167
20168======================================================================
20169
20170
Guido van Rossumf2eac992000-09-04 17:24:24 +000020171=======================================
20172==> Release 1.6 (September 5, 2000) <==
20173=======================================
20174
Guido van Rossuma598c932000-09-04 16:26:03 +000020175What's new in release 1.6?
20176==========================
20177
20178Below is a list of all relevant changes since release 1.5.2.
20179
20180
20181Source Incompatibilities
20182------------------------
20183
20184Several small incompatible library changes may trip you up:
20185
20186 - The append() method for lists can no longer be invoked with more
20187 than one argument. This used to append a single tuple made out of
20188 all arguments, but was undocumented. To append a tuple, use
20189 e.g. l.append((a, b, c)).
20190
20191 - The connect(), connect_ex() and bind() methods for sockets require
20192 exactly one argument. Previously, you could call s.connect(host,
20193 port), but this was undocumented. You must now write
20194 s.connect((host, port)).
20195
20196 - The str() and repr() functions are now different more often. For
20197 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
20198 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
20199 For floats, repr() now gives 17 digits of precision, to ensure no
20200 precision is lost (on all current hardware).
20201
20202 - The -X option is gone. Built-in exceptions are now always
20203 classes. Many more library modules also have been converted to
20204 class-based exceptions.
20205
20206
20207Binary Incompatibilities
20208------------------------
20209
20210- Third party extensions built for Python 1.5.x cannot be used with
20211Python 1.6; these extensions will have to be rebuilt for Python 1.6.
20212
20213- On Windows, attempting to import a third party extension built for
20214Python 1.5.x results in an immediate crash; there's not much we can do
20215about this. Check your PYTHONPATH environment variable!
20216
20217
20218Overview of Changes since 1.5.2
20219-------------------------------
20220
20221For this overview, I have borrowed from the document "What's New in
20222Python 2.0" by Andrew Kuchling and Moshe Zadka:
Andrew M. Kuchlinge240d9b2004-03-21 18:48:22 +000020223http://www.amk.ca/python/2.0/ .
Guido van Rossuma598c932000-09-04 16:26:03 +000020224
20225There are lots of new modules and lots of bugs have been fixed. A
20226list of all new modules is included below.
20227
20228Probably the most pervasive change is the addition of Unicode support.
20229We've added a new fundamental datatype, the Unicode string, a new
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030020230built-in function unicode(), and numerous C APIs to deal with Unicode
Guido van Rossuma598c932000-09-04 16:26:03 +000020231and encodings. See the file Misc/unicode.txt for details, or
20232http://starship.python.net/crew/lemburg/unicode-proposal.txt.
20233
20234Two other big changes, related to the Unicode support, are the
20235addition of string methods and (yet another) new regular expression
20236engine.
20237
20238 - String methods mean that you can now say s.lower() etc. instead of
20239 importing the string module and saying string.lower(s) etc. One
20240 peculiarity is that the equivalent of string.join(sequence,
20241 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
20242 the effect of string.join(sequence); to make this more readable, try
20243 space=" " first. Note that the maxsplit argument defaults in
20244 split() and replace() have changed from 0 to -1.
20245
20246 - The new regular expression engine, SRE by Fredrik Lundh, is fully
20247 backwards compatible with the old engine, and is in fact invoked
20248 using the same interface (the "re" module). You can explicitly
20249 invoke the old engine by import pre, or the SRE engine by importing
20250 sre. SRE is faster than pre, and supports Unicode (which was the
20251 main reason to put effort in yet another new regular expression
20252 engine -- this is at least the fourth!).
20253
20254
20255Other Changes
20256-------------
20257
20258Other changes that won't break code but are nice to know about:
20259
20260Deleting objects is now safe even for deeply nested data structures.
20261
20262Long/int unifications: long integers can be used in seek() calls, as
20263slice indexes.
20264
20265String formatting (s % args) has a new formatting option, '%r', which
20266acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
20267alpha 1.)
20268
20269Greg Ward's "distutils" package is included: this will make
20270installing, building and distributing third party packages much
20271simpler.
20272
20273There's now special syntax that you can use instead of the apply()
20274function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
20275You can also use variations f(a1, a2, *args, **kwds) and you can leave
20276one or the other out: f(*args), f(**kwds).
20277
20278The built-ins int() and long() take an optional second argument to
20279indicate the conversion base -- of course only if the first argument
20280is a string. This makes string.atoi() and string.atol() obsolete.
20281(string.atof() was already obsolete).
20282
20283When a local variable is known to the compiler but undefined when
20284used, a new exception UnboundLocalError is raised. This is a class
20285derived from NameError so code catching NameError should still work.
20286The purpose is to provide better diagnostics in the following example:
20287 x = 1
20288 def f():
20289 print x
20290 x = x+1
20291This used to raise a NameError on the print statement, which confused
20292even experienced Python programmers (especially if there are several
20293hundreds of lines of code between the reference and the assignment to
20294x :-).
20295
20296You can now override the 'in' operator by defining a __contains__
20297method. Note that it has its arguments backwards: x in a causes
20298a.__contains__(x) to be called. That's why the name isn't __in__.
20299
20300The exception AttributeError will have a more friendly error message,
20301e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
20302<b>break code</b> that expects the message to be exactly the attribute
20303name.
20304
20305
20306New Modules in 1.6
20307------------------
20308
20309UserString - base class for deriving from the string type.
20310
20311distutils - tools for distributing Python modules.
20312
20313robotparser - parse a robots.txt file, for writing web spiders.
20314(Moved from Tools/webchecker/.)
20315
20316linuxaudiodev - audio for Linux.
20317
20318mmap - treat a file as a memory buffer. (Windows and Unix.)
20319
20320sre - regular expressions (fast, supports unicode). Currently, this
20321code is very rough. Eventually, the re module will be reimplemented
20322using sre (without changes to the re API).
20323
20324filecmp - supersedes the old cmp.py and dircmp.py modules.
20325
20326tabnanny - check Python sources for tab-width dependance. (Moved from
20327Tools/scripts/.)
20328
20329urllib2 - new and improved but incompatible version of urllib (still
20330experimental).
20331
20332zipfile - read and write zip archives.
20333
20334codecs - support for Unicode encoders/decoders.
20335
20336unicodedata - provides access to the Unicode 3.0 database.
20337
20338_winreg - Windows registry access.
20339
20340encodings - package which provides a large set of standard codecs --
20341currently only for the new Unicode support. It has a drop-in extension
20342mechanism which allows you to add new codecs by simply copying them
20343into the encodings package directory. Asian codec support will
20344probably be made available as separate distribution package built upon
20345this technique and the new distutils package.
20346
20347
20348Changed Modules
20349---------------
20350
20351readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
20352chunk, wave, random, shelve, nntplib - minor enhancements.
20353
20354socket, httplib, urllib - optional OpenSSL support (Unix only).
20355
20356_tkinter - support for 8.0 up to 8.3. Support for versions older than
203578.0 has been dropped.
20358
20359string - most of this module is deprecated now that strings have
20360methods. This no longer uses the built-in strop module, but takes
20361advantage of the new string methods to provide transparent support for
20362both Unicode and ordinary strings.
20363
20364
20365Changes on Windows
20366------------------
20367
20368The installer no longer runs a separate Tcl/Tk installer; instead, it
20369installs the needed Tcl/Tk files directly in the Python directory. If
20370you already have a Tcl/Tk installation, this wastes some disk space
20371(about 4 Megs) but avoids problems with conflincting Tcl/Tk
20372installations, and makes it much easier for Python to ensure that
20373Tcl/Tk can find all its files. Note: the alpha installers don't
20374include the documentation.
20375
20376The Windows installer now installs by default in \Python16\ on the
20377default volume, instead of \Program Files\Python-1.6\.
20378
20379
20380Changed Tools
20381-------------
20382
20383IDLE - complete overhaul. See the <a href="../idle/">IDLE home
20384page</a> for more information. (Python 1.6 alpha 1 will come with
20385IDLE 0.6.)
20386
20387Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
20388text extraction tool used for internationalizing applications written
20389in Python.
20390
20391
20392Obsolete Modules
20393----------------
20394
20395stdwin and everything that uses it. (Get Python 1.5.2 if you need
20396it. :-)
20397
20398soundex. (Skip Montanaro has a version in Python but it won't be
20399included in the Python release.)
20400
20401cmp, cmpcache, dircmp. (Replaced by filecmp.)
20402
20403dump. (Use pickle.)
20404
20405find. (Easily coded using os.walk().)
20406
20407grep. (Not very useful as a library module.)
20408
20409packmail. (No longer has any use.)
20410
20411poly, zmod. (These were poor examples at best.)
20412
20413strop. (No longer needed by the string module.)
20414
20415util. (This functionality was long ago built in elsewhere).
20416
20417whatsound. (Use sndhdr.)
20418
20419
20420Detailed Changes from 1.6b1 to 1.6
20421----------------------------------
20422
20423- Slight changes to the CNRI license. A copyright notice has been
20424added; the requirement to indicate the nature of modifications now
20425applies when making a derivative work available "to others" instead of
20426just "to the public"; the version and date are updated. The new
20427license has a new handle.
20428
20429- Added the Tools/compiler package. This is a project led by Jeremy
20430Hylton to write the Python bytecode generator in Python.
20431
20432- The function math.rint() is removed.
20433
20434- In Python.h, "#define _GNU_SOURCE 1" was added.
20435
20436- Version 0.9.1 of Greg Ward's distutils is included (instead of
20437version 0.9).
20438
20439- A new version of SRE is included. It is more stable, and more
20440compatible with the old RE module. Non-matching ranges are indicated
20441by -1, not None. (The documentation said None, but the PRE
20442implementation used -1; changing to None would break existing code.)
20443
20444- The winreg module has been renamed to _winreg. (There are plans for
20445a higher-level API called winreg, but this has not yet materialized in
20446a form that is acceptable to the experts.)
20447
20448- The _locale module is enabled by default.
20449
20450- Fixed the configuration line for the _curses module.
20451
20452- A few crashes have been fixed, notably <file>.writelines() with a
20453list containing non-string objects would crash, and there were
20454situations where a lost SyntaxError could dump core.
20455
20456- The <list>.extend() method now accepts an arbitrary sequence
20457argument.
20458
20459- If __str__() or __repr__() returns a Unicode object, this is
20460converted to an 8-bit string.
20461
20462- Unicode string comparisons is no longer aware of UTF-16
20463encoding peculiarities; it's a straight 16-bit compare.
20464
20465- The Windows installer now installs the LICENSE file and no longer
20466registers the Python DLL version in the registry (this is no longer
20467needed). It now uses Tcl/Tk 8.3.2.
20468
20469- A few portability problems have been fixed, in particular a
20470compilation error involving socklen_t.
20471
20472- The PC configuration is slightly friendlier to non-Microsoft
20473compilers.
20474
20475
20476======================================================================
20477
20478
Guido van Rossumf2eac992000-09-04 17:24:24 +000020479======================================
20480==> Release 1.5.2 (April 13, 1999) <==
20481======================================
20482
Guido van Rossum2001da42000-09-01 22:26:44 +000020483From 1.5.2c1 to 1.5.2 (final)
20484=============================
20485
20486Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20487
20488 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
20489
20490 * PCbuild/python15.dsp: Added shamodule.c
20491
20492 * PC/config.c: Added sha module!
20493
20494 * README, Include/patchlevel.h: Prepare for final release.
20495
20496 * Misc/ACKS:
20497 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
20498
20499 * Python/thread_solaris.h:
20500 While I can't really test this thoroughly, Pat Knight and the Solaris
20501 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
20502 the flags on thr_create(), and that there really isn't a downside, so
20503 I'll do that.
20504
20505 * Misc/ACKS:
20506 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
20507
20508 * PC/python_nt.rc:
20509 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
20510 (I can't even display this on NT, maybe Win/98 can?)
20511
20512 * Lib/pstats.py:
20513 Fix mysterious references to jprofile that were in the source since
20514 its creation. I'm assuming these were once valid references to "Jim
20515 Roskind's profile"...
20516
20517 * Lib/Attic/threading_api.py:
20518 Removed; since long subsumed in Doc/lib/libthreading.tex
20519
20520 * Modules/socketmodule.c:
20521 Put back __osf__ support for gethostbyname_r(); the real bug was that
20522 it was being used even without threads. This of course might be an
20523 all-platform problem so now we only use the _r variant when we are
20524 using threads.
20525
20526Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20527
20528 * Modules/cPickle.c:
20529 Fix accidentally reversed NULL test in load_mark(). Suggested by
20530 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
20531 returns NULL.)
20532
20533 * README:
20534 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
20535
20536 * README: Add note about -D_REENTRANT for HP-UX 10.20.
20537
20538 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
20539
20540 * PC/Attic/vc40.mak, PC/readme.txt:
20541 Remove all VC++ info (except VC 1.5) from readme.txt;
20542 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
20543
20544 * README: Clarify PC build instructions (point to PCbuild).
20545
20546 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
20547
20548 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
20549 Forgot to add this file. CDROM device parameters.
20550
20551 * Lib/gzip.py: Two different changes.
20552
20553 1. Jack Jansen reports that on the Mac, the time may be negative, and
20554 solves this by adding a write32u() function that writes an unsigned
20555 long.
20556
20557 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
20558 casting both values to be compared to "unsigned long" i.e. modulo
20559 0x100000000L.
20560
20561Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20562
20563 * PC/Attic/_tkinter.def: No longer needed.
20564
20565 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
20566
20567 * README: Add DEC Ultrix notes (from Donn Cave's email).
20568
20569 * configure: The usual
20570
20571 * configure.in:
20572 Quote a bunch of shell variables used in test, related to long-long.
20573
20574 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
20575 casts for picky compilers.
20576
20577 * Modules/socketmodule.c:
20578 3-arg gethostbyname_r doesn't really work on OSF/1.
20579
20580 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
20581 Avoid totally empty files.
20582
20583Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20584
20585 * Tools/scripts/fixps.py: Use re instead of regex.
20586 Don't rewrite the file in place.
20587 (Reported by Andy Dustman.)
20588
20589 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
20590
20591Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20592
20593 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
20594 Add a variable %_TCL_% that makes it easier to switch to a different version.
20595
20596
20597======================================================================
20598
20599
20600From 1.5.2b2 to 1.5.2c1
20601=======================
20602
20603Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20604
20605 * PCbuild/python15.wse:
20606 Release 1.5.2c1. Add IDLE and Uninstall to program group.
20607 Don't distribute zlib.dll. Tweak some comments.
20608
20609 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
20610
20611 * 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:
20612 The usual
20613
20614 * Include/patchlevel.h: Release 1.5.2c1
20615
20616 * README: Release 1.5.2c1.
20617
20618 * Misc/NEWS: News for the 1.5.2c1 release.
20619
20620 * Lib/test/test_strftime.py:
20621 On Windows, we suddenly find, strftime() may return "" for an
20622 unsupported format string. (I guess this is because the logic for
20623 deciding whether to reallocate the buffer or not has been improved.)
20624 This caused the test code to crash on result[0]. Fix this by assuming
20625 an empty result also means the format is not supported.
20626
20627 * Demo/tkinter/matt/window-creation-w-location.py:
20628 This demo imported some private code from Matt. Make it cripple along.
20629
20630 * Lib/lib-tk/Tkinter.py:
20631 Delete an accidentally checked-in feature that actually broke more
20632 than was worth it: when deleting a canvas item, it would try to
20633 automatically delete the bindings for that item. Since there's
20634 nothing that says you can't reuse the tag and still have the bindings,
20635 this is not correct. Also, it broke at least one demo
20636 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
20637
20638 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
20639
20640Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20641
20642 * Modules/zlibmodule.c:
20643 Patch by Andrew Kuchling to unflush() (flush() for deflating).
20644 Without this, if inflate() returned Z_BUF_ERROR asking for more output
20645 space, we would report the error; now, we increase the buffer size and
20646 try again, just as for Z_OK.
20647
20648 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
20649
20650 * Tools/idle/ChangeLog: New change log.
20651
20652 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
20653
20654 * Python/pythonrun.c:
20655 Alas, get rid of the Win specific hack to ask the user to press Return
20656 before exiting when an error happened. This didn't work right when
20657 Python is invoked from a daemon.
20658
20659 * Tools/idle/idlever.py: Version bump awaiting impending new release.
20660 (Not much has changed :-( )
20661
20662 * Lib/lib-tk/Tkinter.py:
20663 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
20664 so the preferred name for them is tag_lower, tag_raise
20665 (similar to tag_bind, and similar to the Text widget);
20666 unfortunately can't delete the old ones yet (maybe in 1.6)
20667
20668 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
20669 Changes by Mark Hammond for Windows CE. Mostly of the form
20670 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
20671
20672 * Python/bltinmodule.c:
20673 Remove unused variable from complex_from_string() code.
20674
20675 * Include/patchlevel.h:
20676 Add the possibility of a gamma release (release candidate).
20677 Add '+' to string version number to indicate we're beyond b2 now.
20678
20679 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
20680
20681 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
20682
20683 Per writes:
20684
20685 """
20686 The application where Signum Support uses smtplib needs to be able to
20687 report good error messages to the user when sending email fails. To
20688 help in diagnosing problems it is useful to be able to report the
20689 entire message sent by the server, not only the SMTP error code of the
20690 offending command.
20691
20692 A lot of the functions in sendmail.py unfortunately discards the
20693 message, leaving only the code. The enclosed patch fixes that
20694 problem.
20695
20696 The enclosed patch also introduces a base class for exceptions that
20697 include an SMTP error code and error message, and make the code and
20698 message available on separate attributes, so that surrounding code can
20699 deal with them in whatever way it sees fit. I've also added some
20700 documentation to the exception classes.
20701
20702 The constructor will now raise an exception if it cannot connect to
20703 the SMTP server.
20704
20705 The data() method will raise an SMTPDataError if it doesn't receive
20706 the expected 354 code in the middle of the exchange.
20707
20708 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
20709 text, including no text at all" after the error code. If the response
20710 of a HELO command contains no text self.helo_resp will be set to the
20711 empty string (""). The patch fixes the test in the sendmail() method
20712 so that helo_resp is tested against None; if it has the empty string
20713 as value the sendmail() method would invoke the helo() method again.
20714
20715 The code no longer accepts a -1 reply from the ehlo() method in
20716 sendmail().
20717
20718 [Text about removing SMTPRecipientsRefused deleted --GvR]
20719 """
20720
20721 and also:
20722
20723 """
20724 smtplib.py appends an extra blank line to the outgoing mail if the
20725 `msg' argument to the sendmail method already contains a trailing
20726 newline. This patch should fix the problem.
20727 """
20728
20729 The Dragon writes:
20730
20731 """
20732 Mostly I just re-added the SMTPRecipientsRefused exception
20733 (the exeption object now has the appropriate info in it ) [Per had
20734 removed this in his patch --GvR] and tweaked the behavior of the
20735 sendmail method whence it throws the newly added SMTPHeloException (it
20736 was closing the connection, which it shouldn't. whatever catches the
20737 exception should do that. )
20738
20739 I pondered the change of the return values to tuples all around,
20740 and after some thinking I decided that regularizing the return values was
20741 too much of the Right Thing (tm) to not do.
20742
20743 My one concern is that code expecting an integer & getting a tuple
20744 may fail silently.
20745
20746 (i.e. if it's doing :
20747
20748 x.somemethod() >= 400:
20749 expecting an integer, the expression will always be true if it gets a
20750 tuple instead. )
20751
20752 However, most smtplib code I've seen only really uses the
20753 sendmail() method, so this wouldn't bother it. Usually code I've seen
20754 that calls the other methods usually only calls helo() and ehlo() for
20755 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
20756 and thus I would think not much code uses it yet.
20757 """
20758
20759Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20760
20761 * Lib/test/test_ntpath.py:
20762 Fix the tests now that splitdrive() no longer treats UNC paths special.
20763 (Some tests converted to splitunc() tests.)
20764
20765 * Lib/ntpath.py:
20766 Withdraw the UNC support from splitdrive(). Instead, a new function
20767 splitunc() parses UNC paths. The contributor of the UNC parsing in
20768 splitdrive() doesn't like it, but I haven't heard a good reason to
20769 keep it, and it causes some problems. (I think there's a
20770 philosophical problem -- to me, the split*() functions are purely
20771 syntactical, and the fact that \\foo is not a valid path doesn't mean
20772 that it shouldn't be considered an absolute path.)
20773
20774 Also (quite separately, but strangely related to the philosophical
20775 issue above) fix abspath() so that if win32api exists, it doesn't fail
20776 when the path doesn't actually exist -- if GetFullPathName() fails,
Mark Dickinson934896d2009-02-21 20:59:32 +000020777 fall back on the old strategy (join with getcwd() if necessary, and
Guido van Rossum2001da42000-09-01 22:26:44 +000020778 then use normpath()).
20779
20780 * configure.in, configure, config.h.in, acconfig.h:
20781 For BeOS PowerPC. Chris Herborth.
20782
20783Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20784
20785 * Modules/timemodule.c:
20786 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
20787 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
20788
20789 * Misc/ACKS:
20790 Bunch of new contributors, including 9 who contributed to the Docs,
20791 reported by Fred.
20792
20793Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20794
20795 * Lib/gzip.py:
20796 Oops, missed mode parameter to open().
20797
20798 * Lib/gzip.py:
20799 Made the default mode 'rb' instead of 'r', for better cross-platform
20800 support. (Based on comment on the documentation by Bernhard Reiter
20801 <bernhard@csd.uwm.edu>).
20802
20803Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20804
20805 * Tools/scripts/dutree.py:
20806 For reasons I dare not explain, this script should always execute
20807 main() when imported (in other words, it is not usable as a module).
20808
20809Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20810
20811 * Lib/test/test_cpickle.py: Jonathan Giddy write:
20812
20813 In test_cpickle.py, the module os got imported, but the line to remove
20814 the temp file has gone missing.
20815
20816Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20817
20818 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
20819
20820 If you send something like "PUT / HTTP/1.0" to something derived from
20821 BaseHTTPServer that doesn't define do_PUT, you will get a response
20822 that begins like this:
20823
20824 HTTP/1.0 501 Unsupported method ('do_PUT')
20825 Server: SimpleHTTP/0.3 Python/1.5
20826 Date: Tue, 30 Mar 1999 18:53:53 GMT
20827
20828 The server should complain about 'PUT' instead of 'do_PUT'. This
20829 patch should fix the problem.
20830
20831Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20832
20833 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
20834
20835 """
20836 - It needlessly used the makefile() method for each response that is
20837 read from the SMTP server.
20838
20839 - If the remote SMTP server closes the connection unexpectedly the
20840 code raised an IndexError. It now raises an SMTPServerDisconnected
20841 exception instead.
20842
20843 - The code now checks that all lines in a multiline response actually
20844 contains an error code.
20845 """
20846
20847 The Dragon approves.
20848
20849Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20850
20851 * Lib/compileall.py:
20852 When run as a script, report failures in the exit code as well.
20853 Patch largely based on changes by Andrew Dalke, as discussed in the
20854 distutils-sig.
20855
20856Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20857
20858 * Lib/urllib.py:
20859 Hack so that if a 302 or 301 redirect contains a relative URL, the
20860 right thing "just happens" (basejoin() with old URL).
20861
20862 * Modules/cPickle.c:
20863 Protection against picling to/from closed (real) file.
20864 The problem was reported by Moshe Zadka.
20865
20866 * Lib/test/test_cpickle.py:
20867 Test protection against picling to/from closed (real) file.
20868
20869 * Modules/timemodule.c: Chris Lawrence writes:
20870
20871 """
20872 The GNU folks, in their infinite wisdom, have decided not to implement
20873 altzone in libc6; this would not be horrible, except that timezone
20874 (which is implemented) includes the current DST setting (i.e. timezone
20875 for Central is 18000 in summer and 21600 in winter). So Python's
20876 timezone and altzone variables aren't set correctly during DST.
20877
20878 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
20879 show the "right" thing on Linux (by using the tm_gmtoff stuff
20880 available in BSD, which is how the GLIBC manual claims things should
20881 be done) and (b) should cope with the southern hemisphere. In pursuit
20882 of (b), I also took the liberty of renaming the "summer" and "winter"
20883 variables to "july" and "jan". This patch should also make certain
20884 time calculations on Linux actually work right (like the tz-aware
20885 functions in the rfc822 module).
20886
20887 (It's hard to find DST that's currently being used in the southern
20888 hemisphere; I tested using Africa/Windhoek.)
20889 """
20890
20891 * Lib/test/output/test_gzip:
20892 Jonathan Giddy discovered this file was missing.
20893
20894 * Modules/shamodule.c:
20895 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
20896 middlename) Marangozov, patch coded by Greg Stein.
20897
20898 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
20899 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
20900
20901Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20902
20903 * Tools/scripts/ndiff.py: Tim Peters writes:
20904
20905 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
20906 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
20907 for recreating the original files from ndiff's output. That's attached, if
20908 you're game! Us Windows guys don't usually have a sed sitting around
20909 <wink>.
20910
20911Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20912
20913 * Tools/scripts/ndiff.py: Tim Peters writes:
20914
20915 Attached is a cleaned-up version of ndiff (added useful module
20916 docstring, now echo'ed in case of cmd line mistake); added -q option
20917 to suppress initial file identification lines; + other minor cleanups,
20918 & a slightly faster match engine.
20919
20920Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
20921
20922 * Tools/scripts/dutree.py:
20923 During display, if EPIPE is raised, it's probably because a pager was
Martin Pantere26da7c2016-06-02 10:07:09 +000020924 killed. Discard the error in that case, but propagate it otherwise.
Guido van Rossum2001da42000-09-01 22:26:44 +000020925
20926Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20927
20928 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
20929 Test suite for UserList.
20930
20931 * Lib/UserList.py: Use isinstance() where appropriate.
20932 Reformatted with 4-space indent.
20933
20934Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
20935
20936 * Tools/pynche/PyncheWidget.py:
20937 Helpwin.__init__(): The text widget should get focus.
20938
20939 * Tools/pynche/pyColorChooser.py:
20940 Removed unnecessary import `from PyncheWidget import PyncheWidget'
20941
20942Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20943
20944 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
20945 Test suite for UserDict
20946
20947 * Lib/UserDict.py: Improved a bunch of things.
20948 The constructor now takes an optional dictionary.
20949 Use isinstance() where appropriate.
20950
20951Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20952
20953 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
20954 Basic regr tests for pickle/cPickle
20955
20956 * Lib/pickle.py:
20957 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
20958 points out) it doesn't work in JPython Applets.
20959
20960Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20961
20962 * Lib/test/test_gzip.py:
20963 Added a simple test suite for gzip. It simply opens a temp file,
20964 writes a chunk of compressed data, closes it, writes another chunk, and
20965 reads the contents back to verify that they are the same.
20966
20967 * Lib/gzip.py:
20968 Based on a suggestion from bruce@hams.com, make a trivial change to
20969 allow using the 'a' flag as a mode for opening a GzipFile. gzip
20970 files, surprisingly enough, can be concatenated and then decompressed;
20971 the effect is to concatenate the two chunks of data.
20972
20973 If we support it on writing, it should also be supported on reading.
20974 This *wasn't* trivial, and required rearranging the code in the
20975 reading path, particularly the _read() method.
20976
20977 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
20978 and 'Unknown compression method'
20979
20980Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20981
20982 * Lib/test/test_b1.py:
20983 Add tests for float() and complex() with string args (Nick/Stephanie
20984 Lockwood).
20985
20986Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
20987
20988 * Modules/zlibmodule.c:
20989 Add an .unused_data attribute to decompressor objects. If .unused_data
20990 is not an empty string, this means that you have arrived at the
20991 end of the stream of compressed data, and the contents of .unused_data are
20992 whatever follows the compressed stream.
20993
20994Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
20995
20996 * Python/bltinmodule.c:
20997 Patch by Nick and Stephanie Lockwood to implement complex() with a string
20998 argument. This closes TODO item 2.19.
20999
21000Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21001
21002 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
21003 Unfortunately his code breaks wcgui.py in a way that's not easy
21004 to fix. I expect that this is a temporary situation --
21005 eventually Sam's changes will be merged back in.
21006 (The changes add a -t option to specify exceptions to the -x
21007 option, and explicit checking for #foo style fragment ids.)
21008
21009 * Objects/dictobject.c:
21010 Vladimir Marangozov contributed updated comments.
21011
21012 * Objects/bufferobject.c: Folded long lines.
21013
21014 * Lib/test/output/test_sha, Lib/test/test_sha.py:
21015 Added Jeremy's test code for the sha module.
21016
21017 * Modules/shamodule.c, Modules/Setup.in:
21018 Added Greg Stein and Andrew Kuchling's sha module.
21019 Fix comments about zlib version and URL.
21020
21021 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
21022
21023 * Include/pythread.h: Conform to standard boilerplate.
21024
21025 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
21026 Chris Herborth: the new compiler in R4.1 needs some new options to work...
21027
21028 * Modules/socketmodule.c:
21029 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
21030 data struct before calling gethostby{name,addr}_r(); (2) ignore the
21031 3/5/6 args determinations made by the configure script and switch on
21032 platform identifiers instead:
21033
21034 AIX, OSF have 3 args
21035 Sun, SGI have 5 args
21036 Linux has 6 args
21037
21038 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
21039
21040 * Modules/socketmodule.c:
21041 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
21042
21043 * Lib/mailbox.py:
21044 Add readlines() to _Subfile class. Not clear who would need it, but
21045 Chris Lawrence sent me a broken version; this one is a tad simpler and
21046 more conforming to the standard.
21047
21048Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21049
21050 * Lib/gzip.py: use struct instead of bit-manipulate in Python
21051
21052Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21053
21054 * Modules/Makefile.pre.in:
21055 Add $(EXE) to various occurrences of python so it will work on Cygwin
21056 with egcs (after setting EXE=.exe). Patch by Norman Vine.
21057
21058 * configure, configure.in:
21059 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
21060
21061Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21062
21063 * Include/thread.h:
21064 Adding thread.h -- unused but for b/w compatibility.
21065 As requested by Bill Janssen.
21066
21067 * configure.in, configure:
21068 Add code to test for all sorts of gethostbyname_r variants,
21069 donated by David Arnold.
21070
21071 * config.h.in, acconfig.h:
21072 Add symbols for gethostbyname_r variants (sigh).
21073
21074 * Modules/socketmodule.c: Clean up pass for the previous patches.
21075
21076 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
21077 glibc2.
21078
21079 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
21080 don't know what code should be used.
21081
21082 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
21083
21084 - Modify the gethostbyaddr() code to also hold on to the lock until
21085 after it is safe to release, overlapping with the Python lock.
21086
21087 (Note: I think that it could in theory be possible that Python code
21088 executed while gethostbyname_lock is held could attempt to reacquire
21089 the lock -- e.g. in a signal handler or destructor. I will simply say
21090 "don't do that then.")
21091
21092 * Modules/socketmodule.c: Jonathan Giddy writes:
21093
21094 Here's a patch to fix the race condition, which wasn't fixed by Rob's
21095 patch. It holds the gethostbyname lock until the results are copied out,
21096 which means that this lock and the Python global lock are held at the same
21097 time. This shouldn't be a problem as long as the gethostbyname lock is
21098 always acquired when the global lock is not held.
21099
21100Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
21101
21102 * Modules/zlibmodule.c:
21103 Fixed the flush() method of compression objects; the test for
21104 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
21105 Logic cleaned up and commented.
21106
21107 * Lib/test/test_zlib.py:
21108 Added simple test for the flush() method of compression objects, trying the
21109 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
21110
21111Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21112
21113 * Lib/shlex.py:
21114 Bug reported by Tobias Thelen: missing "self." in assignment target.
21115
21116Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21117
21118 * Modules/arraymodule.c:
21119 Use an unsigned cast to avoid a warning in VC++.
21120
21121 * Lib/dospath.py, Lib/ntpath.py:
21122 New code for split() by Tim Peters, behaves more like posixpath.split().
21123
21124 * Objects/floatobject.c:
21125 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
21126 a block cannot be freed, add its free items back to the free list.
21127 This is necessary to avoid leaking when Python is reinitialized later.
21128
21129 * Objects/intobject.c:
21130 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
21131 a block cannot be freed, add its free items back to the free list, and
21132 add its valid ints back to the small_ints array if they are in range.
21133 This is necessary to avoid leaking when Python is reinitialized later.
21134
21135 * Lib/types.py:
21136 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
21137
21138 * Python/bltinmodule.c:
21139 New builtin buffer() creates a derived read-only buffer from any
21140 object that supports the buffer interface (e.g. strings, arrays).
21141
21142 * Objects/bufferobject.c:
21143 Added check for negative offset for PyBuffer_FromObject and check for
21144 negative size for PyBuffer_FromMemory. Greg Stein.
21145
21146Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21147
21148 * Lib/urlparse.py: Sjoerd Mullender writes:
21149
21150 If a filename on Windows starts with \\, it is converted to a URL
21151 which starts with ////. If this URL is passed to urlparse.urlparse
21152 you get a path that starts with // (and an empty netloc). If you pass
21153 the result back to urlparse.urlunparse, you get a URL that starts with
21154 //, which is parsed differently by urlparse.urlparse. The fix is to
21155 add the (empty) netloc with accompanying slashes if the path in
21156 urlunparse starts with //. Do this for all schemes that use a netloc.
21157
21158 * Lib/nturl2path.py: Sjoerd Mullender writes:
21159
21160 Pathnames of files on other hosts in the same domain
21161 (\\host\path\to\file) are not translated correctly to URLs and back.
21162 The URL should be something like file:////host/path/to/file.
21163 Note that a combination of drive letter and remote host is not
21164 possible.
21165
21166Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21167
21168 * Lib/urlparse.py:
21169 Delete non-standard-conforming code in urljoin() that would use the
21170 netloc from the base url as the default netloc for the resulting url
21171 even if the schemes differ.
21172
21173 Once upon a time, when the web was wild, this was a valuable hack
21174 because some people had a URL referencing an ftp server colocated with
21175 an http server without having the host in the ftp URL (so they could
21176 replicate it or change the hostname easily).
21177
21178 More recently, after the file: scheme got added back to the list of
21179 schemes that accept a netloc, it turns out that this caused weirdness
21180 when joining an http: URL with a file: URL -- the resulting file: URL
21181 would always inherit the host from the http: URL because the file:
21182 scheme supports a netloc but in practice never has one.
21183
21184 There are two reasons to get rid of the old, once-valuable hack,
21185 instead of removing the file: scheme from the uses_netloc list. One,
21186 the RFC says that file: uses the netloc syntax, and does not endorse
21187 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
21188 hack.
21189
21190 * Include/ceval.h, Include/abstract.h:
21191 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
21192
21193Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21194
21195 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
21196
21197 An attempt to execute grid_slaves with arguments (0,0) results in
21198 *all* of the slaves being returned, not just the slave associated with
21199 row 0, column 0. This is because the test for arguments in the method
21200 does not test to see if row (and column) does not equal None, but
21201 rather just whether is evaluates to non-false. A value of 0 fails
21202 this test.
21203
21204Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21205
21206 * Modules/cmathmodule.c:
21207 Docstring fix: acosh() returns the hyperbolic arccosine, not the
21208 hyperbolic cosine. Problem report via David Ascher by one of his
21209 students.
21210
21211Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21212
21213 * configure.in:
21214 Should test for gethost*by*name_r, not for gethostname_r (which
21215 doesn't exist and doesn't make sense).
21216
21217 * Modules/socketmodule.c:
21218 Patch by Rob Riggs for Linux -- glibc2 has a different argument
21219 converntion for gethostbyname_r() etc. than Solaris!
21220
21221 * Python/thread_pthread.h: Rob Riggs wrote:
21222
21223 """
21224 Spec says that on success pthread_create returns 0. It does not say
21225 that an error code will be < 0. Linux glibc2 pthread_create() returns
21226 ENOMEM (12) when one exceed process limits. (It looks like it should
21227 return EAGAIN, but that's another story.)
21228
21229 For reference, see:
21230 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
21231 """
21232
21233 [I have a feeling that similar bugs were fixed before; perhaps someone
21234 could check that all error checks no check for != 0?]
21235
21236 * Tools/bgen/bgen/bgenObjectDefinition.py:
21237 New mixin class that defines cmp and hash that use
21238 the ob_itself pointer. This allows (when using the mixin)
21239 different Python objects pointing to the same C object and
21240 behaving well as dictionary keys.
21241
21242 Or so sez Jack Jansen...
21243
21244 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
21245
21246 Don't convert URLs to URLs using pathname2url.
21247
21248Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21249
21250 * Lib/cmd.py: Patch by Michael Scharf. He writes:
21251
21252 The module cmd requires for each do_xxx command a help_xxx
21253 function. I think this is a little old fashioned.
21254
21255 Here is a patch: use the docstring as help if no help_xxx
21256 function can be found.
21257
21258 [I'm tempted to rip out all the help_* functions from pdb, but I'll
21259 resist it. Any takers? --Guido]
21260
21261 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
21262
21263 Under Windows, python freeze.py -o hello hello.py
21264 creates all the correct files in the hello subdirectory, but the
21265 Makefile has the directory prefix in it for frozen_extensions.c
21266 nmake fails because it tries to locate hello/frozen_extensions.c
21267
21268 (His fix adds a call to os.path.basename() in the appropriate place.)
21269
21270 * Objects/floatobject.c, Objects/intobject.c:
21271 Vladimir has restructured his code somewhat so that the blocks are now
21272 represented by an explicit structure. (There are still too many casts
21273 in the code, but that may be unavoidable.)
21274
21275 Also added code so that with -vv it is very chatty about what it does.
21276
21277 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
21278 Change #! line to modern usage; also chmod +x
21279
21280 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
21281 Change #! line to modern usage
21282
21283 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
21284
21285 The filename to URL conversion didn't properly quote special
21286 characters.
21287 The URL to filename didn't properly unquote special chatacters.
21288
21289 * Objects/floatobject.c:
21290 OK, try again. Vladimir gave me a fix for the alignment bus error,
21291 so here's his patch again. This time it works (at least on Solaris,
21292 Linux and Irix).
21293
21294Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21295
21296 * Tools/idle/PathBrowser.py:
21297 Don't crash when sys.path contains an empty string.
21298
21299 * Tools/idle/PathBrowser.py:
21300 - Don't crash in the case where a superclass is a string instead of a
21301 pyclbr.Class object; this can happen when the superclass is
21302 unrecognizable (to pyclbr), e.g. when module renaming is used.
21303
21304 - Show a watch cursor when calling pyclbr (since it may take a while
21305 recursively parsing imported modules!).
21306
21307Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21308
21309 * Lib/mimetypes.py:
21310 Added .rdf and .xsl as application/xml types. (.rdf is for the
21311 Resource Description Framework, a metadata encoding, and .xsl is for
21312 the Extensible Stylesheet Language.)
21313
21314Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21315
21316 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
21317 Test for popen2 module, by Chris Tismer.
21318
21319 * Objects/floatobject.c:
21320 Alas, Vladimir's patch caused a bus error (probably double
21321 alignment?), and I didn't test it. Withdrawing it for now.
21322
21323Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21324
21325 * Objects/floatobject.c:
21326 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21327 floats on finalization.
21328
21329 * Objects/intobject.c:
21330 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
21331 integers on finalization.
21332
21333 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
21334 Add PathBrowser to File module
21335
21336 * Tools/idle/PathBrowser.py:
21337 "Path browser" - 4 scrolled lists displaying:
21338 directories on sys.path
21339 modules in selected directory
21340 classes in selected module
21341 methods of selected class
21342
21343 Sinlge clicking in a directory, module or class item updates the next
21344 column with info about the selected item. Double clicking in a
21345 module, class or method item opens the file (and selects the clicked
21346 item if it is a class or method).
21347
21348 I guess eventually I should be using a tree widget for this, but the
21349 ones I've seen don't work well enough, so for now I use the old
21350 Smalltalk or NeXT style multi-column hierarchical browser.
21351
21352 * Tools/idle/MultiScrolledLists.py:
21353 New utility: multiple scrolled lists in parallel
21354
21355 * Tools/idle/ScrolledList.py: - White background.
21356 - Display "(None)" (or text of your choosing) when empty.
21357 - Don't set the focus.
21358
21359Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21360
21361 * Lib/urllib.py:
21362 open_http also had the 'data is None' test backwards. don't call with the
21363 extra argument if data is None.
21364
21365 * Demo/embed/demo.c:
21366 Call Py_SetProgramName() instead of redefining getprogramname(),
21367 reflecting changes in the runtime around 1.5 or earlier.
21368
21369 * Python/ceval.c:
21370 Always test for an error return (usually NULL or -1) without setting
21371 an exception.
21372
21373 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
21374 He writes:
21375
21376 I had an off-by-1000 error in floatsleep(),
21377 and the problem with time.clock() is that it's not implemented properly
21378 on QNX... ANSI says it's supposed to return _CPU_ time used by the
21379 process, but on QNX it returns the amount of real time used... so I was
21380 confused.
21381
21382 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
21383 Test for self.returntype behaving like OSErr rather than being it.
21384
21385Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21386
21387 * Lib/urllib.py:
21388 http_error had the 'data is None' test backwards. don't call with the
21389 extra argument if data is None.
21390
21391 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
21392
21393 * Lib/urllib.py: pleasing the tabnanny
21394
21395Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21396
21397 * Lib/colorsys.py:
21398 Oops, one more "x, y, z" to convert...
21399
21400 * Lib/colorsys.py:
21401 Adjusted comment at the top to be less confusing, following Fredrik
21402 Lundh's example.
21403
21404 Converted comment to docstring.
21405
21406Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21407
21408 * Lib/toaiff.py:
21409 Use sndhdr instead of the obsolete whatsound module.
21410
21411Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
21412
21413 * Lib/urllib.py:
21414 When performing a POST request, i.e. when the second argument to
21415 urlopen is used to specify form data, make sure the second argument is
21416 threaded through all of the http_error_NNN calls. This allows error
21417 handlers like the redirect and authorization handlers to properly
21418 re-start the connection.
21419
21420Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21421
21422 * Lib/mhlib.py: Patch by Lars Wirzenius:
21423
21424 o the initial comment is wrong: creating messages is already
21425 implemented
21426
21427 o Message.getbodytext: if the mail or it's part contains an
21428 empty content-transfer-encoding header, the code used to
21429 break; the change below treats an empty encoding value the same
21430 as the other types that do not need decoding
21431
21432 o SubMessage.getbodytext was missing the decode argument; the
21433 change below adds it; I also made it unconditionally return
21434 the raw text if decoding was not desired, because my own
21435 routines needed that (and it was easier than rewriting my
21436 own routines ;-)
21437
21438Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
21439
21440 * Python/bltinmodule.c (initerrors):
21441 Make sure that the exception tuples ("base-classes" when
21442 string-based exceptions are used) reflect the real class hierarchy,
21443 i.e. that SystemExit derives from Exception not StandardError.
21444
21445 * Lib/exceptions.py:
21446 Document the correct class hierarchy for SystemExit. It is not an
21447 error and so it derives from Exception and not SystemError. The
21448 docstring was incorrect but the implementation was fine.
21449
21450Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21451
21452 * Lib/shutil.py:
21453 Add import sys, needed by reference to sys.exc_info() in rmtree().
21454 Discovered by Mitch Chapman.
21455
21456 * config.h.in:
21457 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
21458 disappears. It wasn't used anywhere anyway...
21459
21460 * Modules/arraymodule.c:
21461 Carefully check for overflow when allocating the memory for fromfile
21462 -- someone tried to pass in sys.maxint and got bitten by the bogus
21463 calculations.
21464
21465 * configure.in:
21466 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
21467 LIBM (from --with-libm=...); this actually broke the customizability
21468 offered by the latter option. Thanks go to Clay Spence for reporting
21469 this.
21470
21471 * Lib/test/test_dl.py:
21472 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
21473 2. When no test case worked, raise ImportError instead of failing.
21474
21475 * Python/bltinmodule.c:
21476 Patch by Tim Peters to improve the range checks for range() and
21477 xrange(), especially for platforms where int and long are different
21478 sizes (so sys.maxint isn't actually the theoretical limit for the
21479 length of a list, but the largest C int is -- sys.maxint is the
21480 largest Python int, which is actually a C long).
21481
21482 * Makefile.in:
21483 1. Augment the DG/UX rule so it doesn't break the BeOS build.
21484 2. Add $(EXE) to various occurrences of python so it will work on
21485 Cygwin with egcs (after setting EXE=.exe). These patches by
21486 Norman Vine.
21487
21488 * Lib/posixfile.py:
21489 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
21490 list (of bsd variants that have a different lock structure).
21491
21492 * Lib/test/test_fcntl.py:
21493 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
21494
21495 * Modules/timemodule.c:
21496 Patch by Tadayoshi Funaba (with some changes) to be smarter about
21497 guessing what happened when strftime() returns 0. Is it buffer
21498 overflow or was the result simply 0 bytes long? (This happens for an
21499 empty format string, or when the format string is a single %Z and the
21500 timezone is unknown.) if the buffer is at least 256 times as long as
21501 the format, assume the latter.
21502
21503Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21504
21505 * Lib/urllib.py:
21506 As Des Barry points out, we need to call pathname2url(file) in two
21507 calls to addinfourl() in open_file().
21508
21509 * Modules/Setup.in: Document *static* -- in two places!
21510
21511 * Modules/timemodule.c:
21512 We don't support leap seconds, so the seconds field of a time 9-tuple
21513 should be in the range [0-59]. Noted by Tadayoshi Funaba.
21514
21515 * Modules/stropmodule.c:
21516 In atoi(), don't use isxdigit() to test whether the last character
21517 converted was a "digit" -- use isalnum(). This test is there only to
21518 guard against "+" or "-" being interpreted as a valid int literal.
21519 Reported by Takahiro Nakayama.
21520
21521 * Lib/os.py:
21522 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
21523 so they don't need to be treated specially here.
21524
21525Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21526
21527 * Misc/NEWS:
21528 Typo: "apparentlt" --> "apparently"
21529
21530Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
21531
21532 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
21533
21534 * Modules/posixmodule.c:
21535 The docstring for ttyname(..) claims a second "mode" argument. The
21536 actual code does not allow such an argument. (Finn Bock.)
21537
21538 * Lib/lib-old/poly.py:
21539 Dang. Even though this is obsolete code, somebody found a bug, and I
21540 fix it. Oh well.
21541
21542Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
21543
21544 * Lib/pyclbr.py:
21545 Bow to font-lock at the end of the docstring, since it throws stuff
21546 off.
21547
21548 Make sure the path paramter to readmodule() is a list before adding it
21549 with sys.path, or the addition could fail.
21550
21551
21552======================================================================
21553
21554
21555From 1.5.2b1 to 1.5.2b2
21556=======================
21557
21558General
21559-------
21560
21561- Many memory leaks fixed.
21562
21563- Many small bugs fixed.
21564
21565- Command line option -OO (or -O -O) suppresses inclusion of doc
21566strings in resulting bytecode.
21567
21568Windows-specific changes
21569------------------------
21570
21571- New built-in module winsound provides an interface to the Win32
21572PlaySound() call.
21573
21574- Re-enable the audioop module in the config.c file.
21575
21576- On Windows, support spawnv() and associated P_* symbols.
21577
21578- Fixed the conversion of times() return values on Windows.
21579
21580- Removed freeze from the installer -- it doesn't work without the
21581source tree. (See FAQ 8.11.)
21582
21583- On Windows 95/98, the Tkinter module now is smart enough to find
21584Tcl/Tk even when the PATH environment variable hasn't been set -- when
21585the import of _tkinter fails, it searches in a standard locations,
21586patches os.environ["PATH"], and tries again. When it still fails, a
21587clearer error message is produced. This should avoid most
21588installation problems with Tkinter use (e.g. in IDLE).
21589
21590- The -i option doesn't make any calls to set[v]buf() for stdin --
21591this apparently screwed up _kbhit() and the _tkinter main loop.
21592
21593- The ntpath module (and hence, os.path on Windows) now parses out UNC
21594paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
21595splitdrive() will \\host\mountpoint as the drive and \dir\file as the
21596path. ** EXPERIMENTAL **
21597
21598- Added a hack to the exit code so that if (1) the exit status is
21599nonzero and (2) we think we have our own DOS box (i.e. we're not
21600started from a command line shell), we print a message and wait for
21601the user to hit a key before the DOS box is closed.
21602
21603- Updated the installer to WISE 5.0g. Added a dialog warning about
21604the imminent Tcl installation. Added a dialog to specify the program
21605group name in the start menu. Upgraded the Tcl installer to Tcl
216068.0.4.
21607
21608Changes to intrinsics
21609---------------------
21610
21611- The repr() or str() of a module object now shows the __file__
21612attribute (i.e., the file which it was loaded), or the string
21613"(built-in)" if there is no __file__ attribute.
21614
21615- The range() function now avoids overflow during its calculations (if
21616at all possible).
21617
21618- New info string sys.hexversion, which is an integer encoding the
21619version in hexadecimal. In other words, hex(sys.hexversion) ==
216200x010502b2 for Python 1.5.2b2.
21621
21622New or improved ports
21623---------------------
21624
21625- Support for Nextstep descendants (future Mac systems).
21626
21627- Improved BeOS support.
21628
Victor Stinner554fd082014-03-17 22:33:49 +010021629- Support dynamic loading of shared libraries on NetBSD platforms that
Guido van Rossum2001da42000-09-01 22:26:44 +000021630use ELF (i.e., MIPS and Alpha systems).
21631
21632Configuration/build changes
21633---------------------------
21634
21635- The Lib/test directory is no longer included in the default module
21636search path (sys.path) -- "test" has been a package ever since 1.5.
21637
21638- Now using autoconf 2.13.
21639
21640New library modules
21641-------------------
21642
21643- New library modules asyncore and asynchat: these form Sam Rushing's
21644famous asynchronous socket library. Sam has gracefully allowed me to
21645incorporate these in the standard Python library.
21646
21647- New module statvfs contains indexing constants for [f]statvfs()
21648return tuple.
21649
21650Changes to the library
21651----------------------
21652
21653- The wave module (platform-independent support for Windows sound
21654files) has been fixed to actually make it work.
21655
21656- The sunau module (platform-independent support for Sun/NeXT sound
21657files) has been fixed to work across platforms. Also, a weird
21658encoding bug in the header of the audio test data file has been
21659corrected.
21660
21661- Fix a bug in the urllib module that occasionally tripped up
21662webchecker and other ftp retrieves.
21663
21664- ConfigParser's get() method now accepts an optional keyword argument
21665(vars) that is substituted on top of the defaults that were setup in
21666__init__. You can now also have recusive references in your
21667configuration file.
21668
21669- Some improvements to the Queue module, including a put_nowait()
21670module and an optional "block" second argument, to get() and put(),
21671defaulting to 1.
21672
21673- The updated xmllib module is once again compatible with the version
21674present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
21675
21676- The bdb module (base class for the debugger) now supports
21677canonicalizing pathnames used in breakpoints. The derived class must
21678override the new canonical() method for this to work. Also changed
21679clear_break() to the backwards compatible old signature, and added
21680clear_bpbynumber() for the new functionality.
21681
21682- In sgmllib (and hence htmllib), recognize attributes even if they
21683don't have space in front of them. I.e. '<a
21684name="foo"href="bar.html">' will now have two attributes recognized.
21685
21686- In the debugger (pdb), change clear syntax to support three
21687alternatives: clear; clear file:line; clear bpno bpno ...
21688
21689- The os.path module now pretends to be a submodule within the os
21690"package", so you can do things like "from os.path import exists".
21691
21692- The standard exceptions now have doc strings.
21693
21694- In the smtplib module, exceptions are now classes. Also avoid
21695inserting a non-standard space after "TO" in rcpt() command.
21696
21697- The rfc822 module's getaddrlist() method now uses all occurrences of
21698the specified header instead of just the first. Some other bugfixes
21699too (to handle more weird addresses found in a very large test set,
21700and to avoid crashes on certain invalid dates), and a small test
21701module has been added.
21702
21703- Fixed bug in urlparse in the common-case code for HTTP URLs; it
21704would lose the query, fragment, and/or parameter information.
21705
21706- The sndhdr module no longer supports whatraw() -- it depended on a
21707rare extenral program.
21708
21709- The UserList module/class now supports the extend() method, like
21710real list objects.
21711
21712- The uu module now deals better with trailing garbage generated by
21713some broke uuencoders.
21714
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030021715- The telnet module now has a my_interact() method which uses threads
Guido van Rossum2001da42000-09-01 22:26:44 +000021716instead of select. The interact() method uses this by default on
21717Windows (where the single-threaded version doesn't work).
21718
21719- Add a class to mailbox.py for dealing with qmail directory
21720mailboxes. The test code was extended to notice these being used as
21721well.
21722
21723Changes to extension modules
21724----------------------------
21725
21726- Support for the [f]statvfs() system call, where it exists.
21727
21728- Fixed some bugs in cPickle where bad input could cause it to dump
21729core.
21730
21731- Fixed cStringIO to make the writelines() function actually work.
21732
21733- Added strop.expandtabs() so string.expandtabs() is now much faster.
21734
21735- Added fsync() and fdatasync(), if they appear to exist.
21736
21737- Support for "long files" (64-bit seek pointers).
21738
21739- Fixed a bug in the zlib module's flush() function.
21740
21741- Added access() system call. It returns 1 if access granted, 0 if
21742not.
21743
21744- The curses module implements an optional nlines argument to
21745w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
21746
21747Changes to tools
21748----------------
21749
21750- Some changes to IDLE; see Tools/idle/NEWS.txt.
21751
21752- Latest version of Misc/python-mode.el included.
21753
21754Changes to Tkinter
21755------------------
21756
21757- Avoid tracebacks when an image is deleted after its root has been
21758destroyed.
21759
21760Changes to the Python/C API
21761---------------------------
21762
21763- When parentheses are used in a PyArg_Parse[Tuple]() call, any
21764sequence is now accepted, instead of requiring a tuple. This is in
21765line with the general trend towards accepting arbitrary sequences.
21766
21767- Added PyModule_GetFilename().
21768
21769- In PyNumber_Power(), remove unneeded and even harmful test for float
21770to the negative power (which is already and better done in
21771floatobject.c).
21772
21773- New version identification symbols; read patchlevel.h for info. The
21774version numbers are now exported by Python.h.
21775
21776- Rolled back the API version change -- it's back to 1007!
21777
21778- The frozenmain.c function calls PyInitFrozenExtensions().
21779
21780- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
21781INCREF.
21782
21783
21784======================================================================
21785
21786
21787From 1.5.2a2 to 1.5.2b1
21788=======================
21789
21790Changes to intrinsics
21791---------------------
21792
21793- New extension NotImplementedError, derived from RuntimeError. Not
21794used, but recommended use is for "abstract" methods to raise this.
21795
21796- The parser will now spit out a warning or error when -t or -tt is
21797used for parser input coming from a string, too.
21798
21799- The code generator now inserts extra SET_LINENO opcodes when
21800compiling multi-line argument lists.
21801
21802- When comparing bound methods, use identity test on the objects, not
21803equality test.
21804
21805New or improved ports
21806---------------------
21807
21808- Chris Herborth has redone his BeOS port; it now works on PowerPC
21809(R3/R4) and x86 (R4 only). Threads work too in this port.
21810
21811Renaming
21812--------
21813
21814- Thanks to Chris Herborth, the thread primitives now have proper Py*
21815names in the source code (they already had those for the linker,
21816through some smart macros; but the source still had the old, un-Py
21817names).
21818
21819Configuration/build changes
21820---------------------------
21821
21822- Improved support for FreeBSD/3.
21823
21824- Check for pthread_detach instead of pthread_create in libc.
21825
21826- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
21827
21828- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
21829Otherwise modules such as thread didn't get incorporated in extensions.
21830
21831New library modules
21832-------------------
21833
21834- shlex.py by Eric Raymond provides a lexical analyzer class for
21835simple shell-like syntaxes.
21836
21837- netrc.py by Eric Raymond provides a parser for .netrc files. (The
21838undocumented Netrc class in ftplib.py is now obsolete.)
21839
21840- codeop.py is a new module that contains the compile_command()
21841function that was previously in code.py. This is so that JPython can
21842provide its own version of this function, while still sharing the
21843higher-level classes in code.py.
21844
21845- turtle.py is a new module for simple turtle graphics. I'm still
Victor Stinner554fd082014-03-17 22:33:49 +010021846working on it; let me know if you use this to teach Python to children
Guido van Rossum2001da42000-09-01 22:26:44 +000021847or other novices without prior programming experience.
21848
21849Obsoleted library modules
21850-------------------------
21851
21852- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
21853their status of obsoleteness. They don't do a particularly good job
21854and don't seem particularly relevant to the Python core.
21855
21856New tools
21857---------
21858
21859- I've added IDLE: my Integrated DeveLopment Environment for Python.
21860Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
21861work on Macintosh, but I haven't been able to test it there; it does
21862depend on new features in 1.5.2 and perhaps even new features in
218631.5.2b1, especially the new code module). This is very much a work in
21864progress. I'd like to hear how people like it compared to PTUI (or
21865any other IDE they are familiar with).
21866
21867- New tools by Barry Warsaw:
21868
21869 = audiopy: controls the Solaris Audio device
21870 = pynche: The PYthonically Natural Color and Hue Editor
21871 = world: Print mappings between country names and DNS country codes
21872
21873New demos
21874---------
21875
21876- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
21877song.
21878
21879- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
21880Tkinter. (By Fredrik Lundh -- not by me!)
21881
21882Changes to the library
21883----------------------
21884
21885- compileall.py now avoids recompiling .py files that haven't changed;
21886it adds a -f option to force recompilation.
21887
21888- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
21889patches).
21890
21891- nntplib.py: statparse() no longer lowercases the message-id.
21892
21893- types.py: use type(__stdin__) for FileType.
21894
21895- urllib.py: fix translations for filenames with "funny" characters.
21896Patch by Sjoerd Mullender. Note that if you subclass one of the
21897URLopener classes, and you have copied code from the old urllib.py,
21898your subclass may stop working. A long-term solution is to provide
21899more methods so that you don't have to copy code.
21900
21901- cgi.py: In read_multi, allow a subclass to override the class we
21902instantiate when we create a recursive instance, by setting the class
21903variable 'FieldStorageClass' to the desired class. By default, this
21904is set to None, in which case we use self.__class__ (as before).
21905Also, a patch by Jim Fulton to pass additional arguments to recursive
21906calls to the FieldStorage constructor from its read_multi method.
21907
21908- UserList.py: In __getslice__, use self.__class__ instead of
21909UserList.
21910
21911- In SimpleHTTPServer.py, the server specified in test() should be
21912BaseHTTPServer.HTTPServer, in case the request handler should want to
21913reference the two attributes added by BaseHTTPServer.server_bind. (By
21914Jeff Rush, for Bobo). Also open the file in binary mode, so serving
21915images from a Windows box might actually work.
21916
21917- In CGIHTTPServer.py, the list of acceptable formats is -split-
21918on spaces but -joined- on commas, resulting in double commas
21919in the joined text. (By Jeff Rush.)
21920
21921- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
21922new threaded versions of Unix Server classes, using the ThreadingMixIn
21923class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
21924
21925- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
21926method do_delete(); do_clear() was meant. By Greg Ward.
21927
21928- getopt.py: accept a non-list sequence for the long options (request
21929by Jack Jansen). Because it might be a common mistake to pass a
21930single string, this situation is treated separately. Also added
21931docstrings (copied from the library manual) and removed the (now
21932redundant) module comments.
21933
21934- tempfile.py: improvements to avoid security leaks.
21935
21936- code.py: moved compile_command() to new module codeop.py.
21937
21938- pickle.py: support pickle format 1.3 (binary float added). By Jim
21939Fulton. Also get rid of the undocumented obsolete Pickler dump_special
21940method.
21941
21942- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
21943
21944- imaplib.py: fix problem with some versions of IMAP4 servers that
21945choose to mix the case in their CAPABILITIES response.
21946
21947- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
21948by Fredrik Lundh.
21949
21950Changes to extension modules
21951----------------------------
21952
21953- More doc strings for several modules were contributed by Chris
21954Petrilli: math, cmath, fcntl.
21955
21956- Fixed a bug in zlibmodule.c that could cause core dumps on
21957decompression of rarely occurring input.
21958
21959- cPickle.c: new version from Jim Fulton, with Open Source copyright
21960notice. Also, initialize self->safe_constructors early on to prevent
21961crash in early dealloc.
21962
21963- cStringIO.c: new version from Jim Fulton, with Open Source copyright
21964notice. Also fixed a core dump in cStringIO.c when doing seeks.
21965
21966- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
21967
21968- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
21969modifies its argument string (bad function!), so we make a temporary
21970copy.
21971
21972- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
21973control pseudo-device, per audio(7I).
21974
21975Changes to tools
21976----------------
21977
Victor Stinner554fd082014-03-17 22:33:49 +010021978- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
Guido van Rossum2001da42000-09-01 22:26:44 +000021979support for Emacs).
21980
21981- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
21982only the names of offending files to be printed.
21983
21984- freeze: when printing missing modules, also print the module they
21985were imported from.
21986
21987- untabify.py: patch by Detlef Lannert to implement -t option
21988(set tab size).
21989
21990Changes to Tkinter
21991------------------
21992
21993- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
21994row2?
21995
21996- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
21997doesn't work when running in a non-threaded environment. He added
21998some #ifdefs that fix this.
21999
22000Changes to the Python/C API
22001---------------------------
22002
22003- Bumped API version number to 1008 -- enough things have changed!
22004
22005- There's a new macro, PyThreadState_GET(), which does the same work
22006as PyThreadState_Get() without the overhead of a function call (it
22007also avoids the error check). The two top calling locations of
22008PyThreadState_Get() have been changed to use this macro.
22009
22010- All symbols intended for export from a DLL or shared library are now
22011marked as such (with the DL_IMPORT() macro) in the header file that
22012declares them. This was needed for the BeOS port, and should also
22013make some other ports easier. The PC port no longer needs the file
22014with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
22015macro which is only used for init methods in extension modules, and
22016for Py_Main().
22017
22018Invisible changes to internals
22019------------------------------
22020
22021- Fixed a bug in new_buffersize() in fileobject.c which could
22022return a buffer size that was way too large.
22023
22024- Use PySys_WriteStderr instead of fprintf in most places.
22025
22026- dictobject.c: remove dead code discovered by Vladimir Marangozov.
22027
22028- tupleobject.c: make tuples less hungry -- an extra item was
22029allocated but never used. Tip by Vladimir Marangozov.
22030
22031- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
22032Jansen)
22033
22034- import.c: Jim Fulton fixes a reference count bug in
22035PyEval_GetGlobals.
22036
22037- glmodule.c: check in the changed version after running the stubber
22038again -- this solves the conflict with curses over the 'clear' entry
22039point much nicer. (Jack Jansen had checked in the changes to cstubs
22040eons ago, but I never regenrated glmodule.c :-( )
22041
22042- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
22043Marangozov.
22044
22045- stropmodule.c: add a missing DECREF in an error exit. Submitted by
22046Jonathan Giddy.
22047
22048
22049======================================================================
22050
22051
22052From 1.5.2a1 to 1.5.2a2
22053=======================
22054
22055General
22056-------
22057
22058- It is now a syntax error to have a function argument without a
22059default following one with a default.
22060
22061- __file__ is now set to the .py file if it was parsed (it used to
22062always be the .pyc/.pyo file).
22063
22064- Don't exit with a fatal error during initialization when there's a
22065problem with the exceptions.py module.
22066
22067- New environment variable PYTHONOPTIMIZE can be used to set -O.
22068
22069- New version of python-mode.el for Emacs.
22070
22071Miscellaneous fixed bugs
22072------------------------
22073
22074- No longer print the (confusing) error message about stack underflow
22075while compiling.
22076
22077- Some threading and locking bugs fixed.
22078
22079- When errno is zero, report "Error", not "Success".
22080
22081Documentation
22082-------------
22083
22084- Documentation will be released separately.
22085
22086- Doc strings added to array and md5 modules by Chris Petrilli.
22087
22088Ports and build procedure
22089-------------------------
22090
22091- Stop installing when a move or copy fails.
22092
22093- New version of the OS/2 port code by Jeff Rush.
22094
22095- The makesetup script handles absolute filenames better.
22096
22097- The 'new' module is now enabled by default in the Setup file.
22098
22099- I *think* I've solved the problem with the Linux build blowing up
22100sometimes due to a conflict between sigcheck/intrcheck and
22101signalmodule.
22102
22103Built-in functions
22104------------------
22105
22106- The second argument to apply() can now be any sequence, not just a
22107tuple.
22108
22109Built-in types
22110--------------
22111
22112- Lists have a new method: L1.extend(L2) is equivalent to the common
22113idiom L1[len(L1):] = L2.
22114
22115- Better error messages when a sequence is indexed with a non-integer.
22116
22117- Bettter error message when calling a non-callable object (include
22118the type in the message).
22119
22120Python services
22121---------------
22122
22123- New version of cPickle.c fixes some bugs.
22124
22125- pickle.py: improved instantiation error handling.
22126
22127- code.py: reworked quite a bit. New base class
22128InteractiveInterpreter and derived class InteractiveConsole. Fixed
22129several problems in compile_command().
22130
22131- py_compile.py: print error message and continue on syntax errors.
22132Also fixed an old bug with the fstat code (it was never used).
22133
22134- pyclbr.py: support submodules of packages.
22135
22136String Services
22137---------------
22138
22139- StringIO.py: raise the right exception (ValueError) for attempted
22140I/O on closed StringIO objects.
22141
22142- re.py: fixed a bug in subn(), which caused .groups() to fail inside
22143the replacement function called by sub().
22144
22145- The struct module has a new format 'P': void * in native mode.
22146
22147Generic OS Services
22148-------------------
22149
22150- Module time: Y2K robustness. 2-digit year acceptance depends on
22151value of time.accept2dyear, initialized from env var PYTHONY2K,
22152default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
22153(POSIX or X/Open recommendation).
22154
22155- os.path: normpath(".//x") should return "x", not "/x".
22156
22157- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
22158doesn't work.
22159
22160- tempfile.py: regenerate the template after a fork() call.
22161
22162Optional OS Services
22163--------------------
22164
22165- In the signal module, disable restarting interrupted system calls
22166when we have siginterrupt().
22167
22168Debugger
22169--------
22170
22171- No longer set __args__; this feature is no longer supported and can
22172affect the debugged code.
22173
22174- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
22175added aliases and some other useful new features, e.g. much better
22176breakpoint support: temporary breakpoint, disabled breakpoints,
22177breakpoints with ignore counts, and conditions; breakpoints can be set
22178on a file before it is loaded.
22179
22180Profiler
22181--------
22182
22183- Changes so that JPython can use it. Also fix the calibration code
22184so it actually works again
22185.
22186Internet Protocols and Support
22187------------------------------
22188
22189- imaplib.py: new version from Piers Lauder.
22190
22191- smtplib.py: change sendmail() method to accept a single string or a
22192list or strings as the destination (commom newbie mistake).
22193
22194- poplib.py: LIST with a msg argument fixed.
22195
22196- urlparse.py: some optimizations for common case (http).
22197
22198- urllib.py: support content-length in info() for ftp protocol;
22199support for a progress meter through a third argument to
22200urlretrieve(); commented out gopher test (the test site is dead).
22201
22202Internet Data handling
22203----------------------
22204
22205- sgmllib.py: support tags with - or . in their name.
22206
22207- mimetypes.py: guess_type() understands 'data' URLs.
22208
22209Restricted Execution
22210--------------------
22211
22212- The classes rexec.RModuleLoader and rexec.RModuleImporter no
22213longer exist.
22214
22215Tkinter
22216-------
22217
22218- When reporting an exception, store its info in sys.last_*. Also,
22219write all of it to stderr.
22220
22221- Added NS, EW, and NSEW constants, for grid's sticky option.
22222
22223- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
22224
22225- Make bind variants without a sequence return a tuple of sequences
22226(formerly it returned a string, which wasn't very convenient).
22227
22228- Add image commands to the Text widget (these are new in Tk 8.0).
22229
22230- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
22231
22232- Improved the thread code (but you still can't call update() from
22233another thread on Windows).
22234
22235- Fixed unnecessary references to _default_root in the new dialog
22236modules.
22237
22238- Miscellaneous problems fixed.
22239
22240
22241Windows General
22242---------------
22243
22244- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
22245search for dependent dlls in the directory containing the .pyd.
22246
22247- In debugging mode, call DebugBreak() in Py_FatalError().
22248
22249Windows Installer
22250-----------------
22251
22252- Install zlib.dll in the DLLs directory instead of in the win32
Victor Stinner554fd082014-03-17 22:33:49 +010022253system directory, to avoid conflicts with other applications that have
Guido van Rossum2001da42000-09-01 22:26:44 +000022254their own zlib.dll.
22255
22256Test Suite
22257----------
22258
22259- test_long.py: new test for long integers, by Tim Peters.
22260
22261- regrtest.py: improved so it can be used for other test suites as
22262well.
22263
22264- test_strftime.py: use re to compare test results, to support legal
22265variants (e.g. on Linux).
22266
22267Tools and Demos
22268---------------
22269
22270- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
22271remove/add Windows style '\r\n' line endings), untabify.py (to remove
22272tabs), and rgrep.yp (reverse grep).
22273
22274- Improvements to Tools/freeze/. Each Python module is now written to
22275its own C file. This prevents some compilers or assemblers from
22276blowing up on large frozen programs, and saves recompilation time if
22277only a few modules are changed. Other changes too, e.g. new command
22278line options -x and -i.
22279
22280- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
22281
22282Python/C API
22283------------
22284
22285- New mechanism to support extensions of the type object while
22286remaining backward compatible with extensions compiled for previous
22287versions of Python 1.5. A flags field indicates presence of certain
22288fields.
22289
22290- Addition to the buffer API to differentiate access to bytes and
222918-bit characters (in anticipation of Unicode characters).
22292
22293- New argument parsing format t# ("text") to indicate 8-bit
22294characters; s# simply means 8-bit bytes, for backwards compatibility.
22295
22296- New object type, bufferobject.c is an example and can be used to
22297create buffers from memory.
22298
22299- Some support for 64-bit longs, including some MS platforms.
22300
22301- Many calls to fprintf(stderr, ...) have been replaced with calls to
22302PySys_WriteStderr(...).
22303
22304- The calling context for PyOS_Readline() has changed: it must now be
22305called with the interpreter lock held! It releases the lock around
22306the call to the function pointed to by PyOS_ReadlineFunctionPointer
22307(default PyOS_StdioReadline()).
22308
22309- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
22310
22311- Renamed header file "thread.h" to "pythread.h".
22312
22313- The code string of code objects may now be anything that supports the
22314buffer API.
22315
22316
22317======================================================================
22318
22319
22320From 1.5.1 to 1.5.2a1
22321=====================
22322
22323General
22324-------
22325
22326- When searching for the library, a landmark that is a compiled module
22327(string.pyc or string.pyo) is also accepted.
22328
22329- When following symbolic links to the python executable, use a loop
22330so that a symlink to a symlink can work.
22331
22332- Added a hack so that when you type 'quit' or 'exit' at the
Victor Stinner554fd082014-03-17 22:33:49 +010022333interpreter, you get a friendly explanation of how to press Ctrl-D (or
Guido van Rossum2001da42000-09-01 22:26:44 +000022334Ctrl-Z) to exit.
22335
22336- New and improved Misc/python-mode.el (Python mode for Emacs).
22337
22338- Revert a new feature in Unix dynamic loading: for one or two
22339revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
22340out to be a bad idea.
22341
22342Miscellaneous fixed bugs
22343------------------------
22344
22345- All patches on the patch page have been integrated. (But much more
22346has been done!)
22347
22348- Several memory leaks plugged (e.g. the one for classes with a
22349__getattr__ method).
22350
22351- Removed the only use of calloc(). This triggered an obscure bug on
22352multiprocessor Sparc Solaris 2.6.
22353
22354- Fix a peculiar bug that would allow "import sys.time" to succeed
22355(believing the built-in time module to be a part of the sys package).
22356
22357- Fix a bug in the overflow checking when converting a Python long to
22358a C long (failed to convert -2147483648L, and some other cases).
22359
22360Documentation
22361-------------
22362
22363- Doc strings have been added to many extension modules: __builtin__,
22364errno, select, signal, socket, sys, thread, time. Also to methods of
22365list objects (try [].append.__doc__). A doc string on a type will now
22366automatically be propagated to an instance if the instance has methods
22367that are accessed in the usual way.
22368
22369- The documentation has been expanded and the formatting improved.
22370(Remember that the documentation is now unbundled and has its own
22371release cycle though; see http://www.python.org/doc/.)
22372
22373- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
22374
22375Ports and build procedure
22376-------------------------
22377
22378- The BeOS port is now integrated. Courtesy Chris Herborth.
22379
22380- Symbol files for FreeBSD 2.x and 3.x have been contributed
22381(Lib/plat-freebsd[23]/*).
22382
22383- Support HPUX 10.20 DCE threads.
22384
22385- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
22386works, it won't also use -Olimit 1500 (which gives a warning for every
22387file). Also support the SGI_ABI environment variable better.
22388
22389- The makesetup script now understands absolute pathnames ending in .o
22390in the module -- it assumes it's a file for which we have no source.
22391
22392- Other miscellaneous improvements to the configure script and
22393Makefiles.
22394
22395- The test suite now uses a different sound sample.
22396
22397Built-in functions
22398------------------
22399
22400- Better checks for invalid input to int(), long(), string.atoi(),
22401string.atol(). (Formerly, a sign without digits would be accepted as
22402a legal ways to spell zero.)
22403
22404- Changes to map() and filter() to use the length of a sequence only
22405as a hint -- if an IndexError happens earlier, take that. (Formerly,
22406this was considered an error.)
22407
22408- Experimental feature in getattr(): a third argument can specify a
22409default (instead of raising AttributeError).
22410
22411- Implement round() slightly different, so that for negative ndigits
22412no additional errors happen in the last step.
22413
22414- The open() function now adds the filename to the exception when it
22415fails.
22416
22417Built-in exceptions
22418-------------------
22419
22420- New standard exceptions EnvironmentError and PosixError.
22421EnvironmentError is the base class for IOError and PosixError;
22422PosixError is the same as os.error. All this so that either exception
22423class can be instantiated with a third argument indicating a filename.
22424The built-in function open() and most os/posix functions that take a
22425filename argument now use this.
22426
22427Built-in types
22428--------------
22429
22430- List objects now have an experimental pop() method; l.pop() returns
22431and removes the last item; l.pop(i) returns and removes the item at
22432i. Also, the sort() method is faster again. Sorting is now also
22433safer: it is impossible for the sorting function to modify the list
22434while the sort is going on (which could cause core dumps).
22435
22436- Changes to comparisons: numbers are now smaller than any other type.
22437This is done to prevent the circularity where [] < 0L < 1 < [] is
22438true. As a side effect, cmp(None, 0) is now positive instead of
22439negative. This *shouldn't* affect any working code, but I've found
22440that the change caused several "sleeping" bugs to become active, so
22441beware!
22442
22443- Instance methods may now have other callable objects than just
22444Python functions as their im_func. Use new.instancemethod() or write
22445your own C code to create them; new.instancemethod() may be called
22446with None for the instance to create an unbound method.
22447
22448- Assignment to __name__, __dict__ or __bases__ of a class object is
22449now allowed (with stringent type checks); also allow assignment to
22450__getattr__ etc. The cached values for __getattr__ etc. are
22451recomputed after such assignments (but not for derived classes :-( ).
22452
22453- Allow assignment to some attributes of function objects: func_code,
22454func_defaults and func_doc / __doc__. (With type checks except for
22455__doc__ / func_doc .)
22456
22457Python services
22458---------------
22459
22460- New tests (in Lib/test): reperf.py (regular expression benchmark),
22461sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
22462for the MimeWriter module).
22463
22464- Generalized test/regrtest.py so that it is useful for testing other
22465packages.
22466
22467- The ihooks.py module now understands package imports.
22468
22469- In code.py, add a class that subsumes Fredrik Lundh's
22470PythonInterpreter class. The interact() function now uses this.
22471
22472- In rlcompleter.py, in completer(), return None instead of raising an
22473IndexError when there are no more completions left.
22474
22475- Fixed the marshal module to test for certain common kinds of invalid
22476input. (It's still not foolproof!)
22477
22478- In the operator module, add an alias (now the preferred name)
22479"contains" for "sequenceincludes".
22480
22481String Services
22482---------------
22483
22484- In the string and strop modules, in the replace() function, treat an
22485empty pattern as an error (since it's not clear what was meant!).
22486
22487- Some speedups to re.py, especially the string substitution and split
22488functions. Also added new function/method findall(), to find all
22489occurrences of a given substring.
22490
22491- In cStringIO, add better argument type checking and support the
22492readonly 'closed' attribute (like regular files).
22493
22494- In the struct module, unsigned 1-2 byte sized formats no longer
22495result in long integer values.
22496
22497Miscellaneous services
22498----------------------
22499
22500- In whrandom.py, added new method and function randrange(), same as
22501choice(range(start, stop, step)) but faster. This addresses the
22502problem that randint() was accidentally defined as taking an inclusive
22503range. Also, randint(a, b) is now redefined as randrange(a, b+1),
22504adding extra range and type checking to its arguments!
22505
Victor Stinner554fd082014-03-17 22:33:49 +010022506- Add some semi-thread-safety to random.gauss() (it used to be able to
Guido van Rossum2001da42000-09-01 22:26:44 +000022507crash when invoked from separate threads; now the worst it can do is
22508give a duplicate result occasionally).
22509
22510- Some restructuring and generalization done to cmd.py.
22511
Victor Stinner554fd082014-03-17 22:33:49 +010022512- Major upgrade to ConfigParser.py; converted to using 're', added new
Guido van Rossum2001da42000-09-01 22:26:44 +000022513exceptions, support underscore in section header and option name. No
22514longer add 'name' option to every section; instead, add '__name__'.
22515
22516- In getpass.py, don't use raw_input() to ask for the password -- we
22517don't want it to show up in the readline history! Also don't catch
22518interrupts (the try-finally already does all necessary cleanup).
22519
22520Generic OS Services
22521-------------------
22522
22523- New functions in os.py: makedirs(), removedirs(), renames(). New
22524variable: linesep (the line separator as found in binary files,
22525i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
22526this with files opened in (default) text mode; the line separator used
22527will always be '\n'!
22528
22529- Changes to the 'os.path' submodule of os.py: added getsize(),
22530getmtime(), getatime() -- these fetch the most popular items from the
22531stat return tuple.
22532
22533- In the time module, add strptime(), if it exists. (This parses a
22534time according to a format -- the inverse of strftime().) Also,
22535remove the call to mktime() from strftime() -- it messed up the
22536formatting of some non-local times.
22537
22538- In the socket module, added a new function gethostbyname_ex().
22539Also, don't use #ifdef to test for some symbols that are enums on some
22540platforms (and should exist everywhere).
22541
22542Optional OS Services
22543--------------------
22544
22545- Some fixes to gzip.py. In particular, the readlines() method now
22546returns the lines *with* trailing newline characters, like readlines()
22547of regular file objects. Also, it didn't work together with cPickle;
22548fixed that.
22549
22550- In whichdb.py, support byte-swapped dbhash (bsddb) files.
22551
22552- In anydbm.py, look at the type of an existing database to determine
22553which module to use to open it. (The anydbm.error exception is now a
22554tuple.)
22555
22556Unix Services
22557-------------
22558
22559- In the termios module, in tcsetattr(), initialize the structure vy
22560calling tcgetattr().
22561
22562- Added some of the "wait status inspection" macros as functions to
22563the posix module (and thus to the os module): WEXITSTATUS(),
22564WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
22565
22566- In the syslog module, make the default facility more intuitive
22567(matching the docs).
22568
22569Debugger
22570--------
22571
22572- In pdb.py, support for setting breaks on files/modules that haven't
22573been loaded yet.
22574
22575Internet Protocols and Support
22576------------------------------
22577
22578- Changes in urllib.py; sped up unquote() and quote(). Fixed an
22579obscure bug in quote_plus(). Added urlencode(dict) -- convenience
22580function for sending a POST request with urlopen(). Use the getpass
22581module to ask for a password. Rewrote the (test) main program so that
22582when used as a script, it can retrieve one or more URLs to stdout.
22583Use -t to run the self-test. Made the proxy code work again.
22584
22585- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
22586fail when someone asks for their HEAD. Also, for POST, set the
22587default content-type to application/x-www-form-urlencoded. Also, in
22588FieldStorage.__init__(), when method='GET', always get the query
22589string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
22590explicitly passed in fp.
22591
22592- The smtplib.py module now supports ESMTP and has improved standard
22593compliance, for picky servers.
22594
22595- Improved imaplib.py.
22596
22597- Fixed UDP support in SocketServer.py (it never worked).
22598
22599- Fixed a small bug in CGIHTTPServer.py.
22600
22601Internet Data handling
22602----------------------
22603
22604- In rfc822.py, add a new class AddressList. Also support a new
22605overridable method, isheader(). Also add a get() method similar to
22606dictionaries (and make getheader() an alias for it). Also, be smarter
22607about seekable (test whether fp.tell() works) and test for presence of
22608unread() method before trying seeks.
22609
22610- In sgmllib.py, restore the call to report_unbalanced() that was lost
22611long ago. Also some other improvements: handle <? processing
22612instructions >, allow . and - in entity names, and allow \r\n as line
22613separator.
22614
22615- Some restructuring and generalization done to multifile.py; support
22616a 'seekable' flag.
22617
22618Restricted Execution
22619--------------------
22620
22621- Improvements to rexec.py: package support; support a (minimal)
22622sys.exc_info(). Also made the (test) main program a bit fancier (you
22623can now use it to run arbitrary Python scripts in restricted mode).
22624
22625Tkinter
22626-------
22627
22628- On Unix, Tkinter can now safely be used from a multi-threaded
22629application. (Formerly, no threads would make progress while
22630Tkinter's mainloop() was active, because it didn't release the Python
22631interpreter lock.) Unfortunately, on Windows, threads other than the
22632main thread should not call update() or update_idletasks() because
22633this will deadlock the application.
22634
22635- An interactive interpreter that uses readline and Tkinter no longer
22636uses up all available CPU time.
22637
22638- Even if readline is not used, Tk windows created in an interactive
22639interpreter now get continuously updated. (This even works in Windows
22640as long as you don't hit a key.)
22641
22642- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
22643
22644- No longer register Tcl_finalize() as a low-level exit handler. It
22645may call back into Python, and that's a bad idea.
22646
22647- Allow binding of Tcl commands (given as a string).
22648
22649- Some minor speedups; replace explicitly coded getint() with int() in
22650most places.
22651
22652- In FileDialog.py, remember the directory of the selected file, if
22653given.
22654
22655- Change the names of all methods in the Wm class: they are now
22656wm_title(), etc. The old names (title() etc.) are still defined as
22657aliases.
22658
22659- Add a new method of interpreter objects, interpaddr(). This returns
22660the address of the Tcl interpreter object, as an integer. Not very
22661useful for the Python programmer, but this can be called by another C
22662extension that needs to make calls into the Tcl/Tk C API and needs to
22663get the address of the Tcl interpreter object. A simple cast of the
22664return value to (Tcl_Interp *) will do the trick.
22665
22666Windows General
22667---------------
22668
22669- Don't insist on proper case for module source files if the filename
22670is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
22671doesn't). This should address problems with this feature on
22672oldfashioned filesystems (Novell servers?).
22673
22674Windows Library
22675---------------
22676
22677- os.environ is now all uppercase, but accesses are case insensitive,
22678and the putenv() calls made as a side effect of changing os.environ
22679are case preserving.
22680
22681- Removed samefile(), sameopenfile(), samestat() from os.path (aka
22682ntpath.py) -- these cannot be made to work reliably (at least I
22683wouldn't know how).
22684
22685- Fixed os.pipe() so that it returns file descriptors acceptable to
22686os.read() and os.write() (like it does on Unix), rather than Windows
22687file handles.
22688
22689- Added a table of WSA error codes to socket.py.
22690
22691- In the select module, put the (huge) file descriptor arrays on the
22692heap.
22693
22694- The getpass module now raises KeyboardInterrupt when it sees ^C.
22695
22696- In mailbox.py, fix tell/seek when using files opened in text mode.
22697
22698- In rfc822.py, fix tell/seek when using files opened in text mode.
22699
22700- In the msvcrt extension module, release the interpreter lock for
22701calls that may block: _locking(), _getch(), _getche(). Also fix a
22702bogus error return when open_osfhandle() doesn't have the right
22703argument list.
22704
22705Windows Installer
22706-----------------
22707
22708- The registry key used is now "1.5" instead of "1.5.x" -- so future
Victor Stinner554fd082014-03-17 22:33:49 +010022709versions of 1.5 and Mark Hammond's win32all installer don't need to be
Guido van Rossum2001da42000-09-01 22:26:44 +000022710resynchronized.
22711
22712Windows Tools
22713-------------
22714
22715- Several improvements to freeze specifically for Windows.
22716
22717Windows Build Procedure
22718-----------------------
22719
22720- The VC++ project files and the WISE installer have been moved to the
22721PCbuild subdirectory, so they are distributed in the same subdirectory
22722where they must be used. This avoids confusion.
22723
22724- New project files for Windows 3.1 port by Jim Ahlstrom.
22725
22726- Got rid of the obsolete subdirectory PC/setup_nt/.
22727
22728- The projects now use distinct filenames for the .exe, .dll, .lib and
22729.pyd files built in debug mode (by appending "_d" to the base name,
22730before the extension). This makes it easier to switch between the two
22731and get the right versions. There's a pragma in config.h that directs
22732the linker to include the appropriate .lib file (so python15.lib no
22733longer needs to be explicit in your project).
22734
22735- The installer now installs more files (e.g. config.h). The idea is
22736that you shouldn't need the source distribution if you want build your
22737own extensions in C or C++.
22738
22739Tools and Demos
22740---------------
22741
22742- New script nm2def.py by Marc-Andre Lemburg, to construct
22743PC/python_nt.def automatically (some hand editing still required).
22744
22745- New tool ndiff.py: Tim Peters' text diffing tool.
22746
22747- Various and sundry improvements to the freeze script.
22748
22749- The script texi2html.py (which was part of the Doc tree but is no
22750longer used there) has been moved to the Tools/scripts subdirectory.
22751
22752- Some generalizations in the webchecker code. There's now a
22753primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
22754
22755- The ftpmirror.py script now handles symbolic links properly, and
22756also files with multiple spaces in their names.
22757
22758- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
22759last line is both indented and lacks a newline. This is now fixed.
22760
22761Python/C API
22762------------
22763
22764- Added missing prototypes for PyEval_CallFunction() and
22765PyEval_CallMethod().
22766
22767- New macro PyList_SET_ITEM().
22768
22769- New macros to access object members for PyFunction, PyCFunction
22770objects.
22771
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030022772- New APIs PyImport_AppendInittab() and PyImport_ExtendInittab() to
Guido van Rossum2001da42000-09-01 22:26:44 +000022773dynamically add one or many entries to the table of built-in modules.
22774
22775- New macro Py_InitModule3(name, methods, doc) which calls
Victor Stinner554fd082014-03-17 22:33:49 +010022776Py_InitModule4() with appropriate arguments. (The -4 variant requires
Guido van Rossum2001da42000-09-01 22:26:44 +000022777you to pass an obscure version number constant which is always the same.)
22778
22779- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
22780sys.stdout or sys.stderr using a printf-like interface. (Used in
22781_tkinter.c, for example.)
22782
22783- New APIs for conversion between Python longs and C 'long long' if
22784your compiler supports it.
22785
22786- PySequence_In() is now called PySequence_Contains().
22787(PySequence_In() is still supported for b/w compatibility; it is
22788declared obsolete because its argument order is confusing.)
22789
22790- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
22791*never* raise an exception -- (even if the hash() fails, simply clear
22792the error). This was necessary because there is lots of code out
22793there that already assumes this.
22794
22795- Changes to PySequence_Tuple() and PySequence_List() to use the
22796length of a sequence only as a hint -- if an IndexError happens
22797earlier, take that. (Formerly, this was considered an error.)
22798
22799- Reformatted abstract.c to give it a more familiar "look" and fixed
22800many error checking bugs.
22801
22802- Add NULL pointer checks to all calls of a C function through a type
22803object and extensions (e.g. nb_add).
22804
22805- The code that initializes sys.path now calls Py_GetPythonHome()
22806instead of getenv("PYTHONHOME"). This, together with the new API
22807Py_SetPythonHome(), makes it easier for embedding applications to
22808change the notion of Python's "home" directory (where the libraries
22809etc. are sought).
22810
22811- Fixed a very old bug in the parsing of "O?" format specifiers.
22812
22813
22814======================================================================
22815
22816
Guido van Rossumf2eac992000-09-04 17:24:24 +000022817========================================
22818==> Release 1.5.1 (October 31, 1998) <==
22819========================================
22820
Guido van Rossum439d1fa1998-12-21 21:41:14 +000022821From 1.5 to 1.5.1
22822=================
22823
22824General
22825-------
22826
22827- The documentation is now unbundled. It has also been extensively
22828modified (mostly to implement a new and more uniform formatting
22829style). We figure that most people will prefer to download one of the
22830preformatted documentation sets (HTML, PostScript or PDF) and that
22831only a minority have a need for the LaTeX or FrameMaker sources. Of
22832course, the unbundled documentation sources still released -- just not
22833in the same archive file, and perhaps not on the same date.
22834
22835- All bugs noted on the errors page (and many unnoted) are fixed. All
22836new bugs take their places.
22837
22838- No longer a core dump when attempting to print (or repr(), or str())
22839a list or dictionary that contains an instance of itself; instead, the
22840recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
22841Py_ReprLeave() below. Comparisons of such objects still go beserk,
22842since this requires a different kind of fix; fortunately, this is a
22843less common scenario in practice.
22844
22845Syntax change
22846-------------
22847
Victor Stinner554fd082014-03-17 22:33:49 +010022848- The raise statement can now be used without arguments, to re-raise
Guido van Rossum439d1fa1998-12-21 21:41:14 +000022849a previously set exception. This should be used after catching an
22850exception with an except clause only, either in the except clause or
22851later in the same function.
22852
22853Import and module handling
22854--------------------------
22855
22856- The implementation of import has changed to use a mutex (when
22857threading is supported). This means that when two threads
22858simultaneously import the same module, the import statements are
22859serialized. Recursive imports are not affected.
22860
22861- Rewrote the finalization code almost completely, to be much more
22862careful with the order in which modules are destroyed. Destructors
22863will now generally be able to reference built-in names such as None
22864without trouble.
22865
22866- Case-insensitive platforms such as Mac and Windows require the case
22867of a module's filename to match the case of the module name as
22868specified in the import statement (see below).
22869
22870- The code for figuring out the default path now distinguishes between
22871files, modules, executable files, and directories. When expecting a
22872module, we also look for the .pyc or .pyo file.
22873
22874Parser/tokenizer changes
22875------------------------
22876
22877- The tokenizer can now warn you when your source code mixes tabs and
22878spaces for indentation in a manner that depends on how much a tab is
22879worth in spaces. Use "python -t" or "python -v" to enable this
22880option. Use "python -tt" to turn the warnings into errors. (See also
22881tabnanny.py and tabpolice.py below.)
22882
22883- Return unsigned characters from tok_nextc(), so '\377' isn't
22884mistaken for an EOF character.
22885
22886- Fixed two pernicious bugs in the tokenizer that only affected AIX.
22887One was actually a general bug that was triggered by AIX's smaller I/O
22888buffer size. The other was a bug in the AIX optimizer's loop
22889unrolling code; swapping two statements made the problem go away.
22890
22891Tools, demos and miscellaneous files
22892------------------------------------
22893
22894- There's a new version of Misc/python-mode.el (the Emacs mode for
22895Python) which is much smarter about guessing the indentation style
22896used in a particular file. Lots of other cool features too!
22897
22898- There are two new tools in Tools/scripts: tabnanny.py and
22899tabpolice.py, implementing two different ways of checking whether a
22900file uses indentation in a way that is sensitive to the interpretation
22901of a tab. The preferred module is tabnanny.py (by Tim Peters).
22902
22903- Some new demo programs:
22904
22905 Demo/tkinter/guido/paint.py -- Dave Mitchell
22906 Demo/sockets/unixserver.py -- Piet van Oostrum
Victor Stinner554fd082014-03-17 22:33:49 +010022907
Guido van Rossum439d1fa1998-12-21 21:41:14 +000022908
22909- Much better freeze support. The freeze script can now freeze
22910hierarchical module names (with a corresponding change to import.c),
22911and has a few extra options (e.g. to suppress freezing specific
22912modules). It also does much more on Windows NT.
22913
22914- Version 1.0 of the faq wizard is included (only very small changes
22915since version 0.9.0).
22916
22917- New feature for the ftpmirror script: when removing local files
22918(i.e., only when -r is used), do a recursive delete.
22919
22920Configuring and building Python
22921-------------------------------
22922
22923- Get rid of the check for -linet -- recent Sequent Dynix systems don't
22924need this any more and apparently it screws up their configuration.
22925
22926- Some changes because gcc on SGI doesn't support '-all'.
22927
22928- Changed the build rules to use $(LIBRARY) instead of
22929 -L.. -lpython$(VERSION)
22930since the latter trips up the SunOS 4.1.x linker (sigh).
22931
22932- Fix the bug where the '# dgux is broken' comment in the Makefile
22933tripped over Make on some platforms.
22934
22935- Changes for AIX: install the python.exp file; properly use
22936$(srcdir); the makexp_aix script now removes C++ entries of the form
22937Class::method.
22938
22939- Deleted some Makefile targets only used by the (long obsolete)
22940gMakefile hacks.
22941
22942Extension modules
22943-----------------
22944
22945- Performance and threading improvements to the socket and bsddb
22946modules, by Christopher Lindblad of Infoseek.
22947
22948- Added operator.__not__ and operator.not_.
22949
22950- In the thread module, when a thread exits due to an unhandled
22951exception, don't store the exception information in sys.last_*; it
22952prevents proper calling of destructors of local variables.
22953
22954- Fixed a number of small bugs in the cPickle module.
22955
22956- Changed find() and rfind() in the strop module so that
22957find("x","",2) returns -1, matching the implementation in string.py.
22958
22959- In the time module, be more careful with the result of ctime(), and
22960test for HAVE_MKTIME before usinmg mktime().
22961
22962- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
22963modules.
22964
22965- Added the LOG_SYSLOG constant to the syslog module, if defined.
22966
22967Standard library modules
22968------------------------
22969
22970- All standard library modules have been converted to an indentation
22971style using either only tabs or only spaces -- never a mixture -- if
22972they weren't already consistent according to tabnanny. This means
22973that the new -t option (see above) won't complain about standard
22974library modules.
22975
22976- New standard library modules:
22977
22978 threading -- GvR and the thread-sig
22979 Java style thread objects -- USE THIS!!!
22980
22981 getpass -- Piers Lauder
22982 simple utilities to prompt for a password and to
22983 retrieve the current username
22984
22985 imaplib -- Piers Lauder
22986 interface for the IMAP4 protocol
22987
22988 poplib -- David Ascher, Piers Lauder
22989 interface for the POP3 protocol
22990
22991 smtplib -- Dragon De Monsyne
22992 interface for the SMTP protocol
22993
22994- Some obsolete modules moved to a separate directory (Lib/lib-old)
22995which is *not* in the default module search path:
22996
22997 Para
22998 addpack
22999 codehack
23000 fmt
23001 lockfile
23002 newdir
23003 ni
23004 rand
23005 tb
23006
23007- New version of the PCRE code (Perl Compatible Regular Expressions --
23008the re module and the supporting pcre extension) by Andrew Kuchling.
23009Incompatible new feature in re.sub(): the handling of escapes in the
23010replacement string has changed.
23011
23012- Interface change in the copy module: a __deepcopy__ method is now
23013called with the memo dictionary as an argument.
23014
23015- Feature change in the tokenize module: differentiate between NEWLINE
23016token (an official newline) and NL token (a newline that the grammar
23017ignores).
23018
23019- Several bugfixes to the urllib module. It is now truly thread-safe,
23020and several bugs and a portability problem have been fixed. New
23021features, all due to Sjoerd Mullender: When creating a temporary file,
23022it gives it an appropriate suffix. Support the "data:" URL scheme.
23023The open() method uses the tempcache.
23024
23025- New version of the xmllib module (this time with a test suite!) by
23026Sjoerd Mullender.
23027
23028- Added debugging code to the telnetlib module, to be able to trace
23029the actual traffic.
23030
23031- In the rfc822 module, added support for deleting a header (still no
23032support for adding headers, though). Also fixed a bug where an
23033illegal address would cause a crash in getrouteaddr(), fixed a
23034sign reversal in mktime_tz(), and use the local timezone by default
23035(the latter two due to Bill van Melle).
23036
23037- The normpath() function in the dospath and ntpath modules no longer
23038does case normalization -- for that, use the separate function
23039normcase() (which always existed); normcase() has been sped up and
23040fixed (it was the cause of a crash in Mark Hammond's installer in
23041certain locales).
23042
23043- New command supported by the ftplib module: rmd(); also fixed some
23044minor bugs.
23045
Victor Stinner554fd082014-03-17 22:33:49 +010023046- The profile module now uses a different timer function by default --
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023047time.clock() is generally better than os.times(). This makes it work
23048better on Windows NT, too.
23049
23050- The tempfile module now recovers when os.getcwd() raises an
23051exception.
23052
23053- Fixed some bugs in the random module; gauss() was subtly wrong, and
23054vonmisesvariate() should return a full circle. Courtesy Mike Miller,
23055Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
23056
23057- Better default seed in the whrandom module, courtesy Andrew Kuchling.
23058
23059- Fix slow close() in shelve module.
23060
23061- The Unix mailbox class in the mailbox module is now more robust when
23062a line begins with the string "From " but is definitely not the start
23063of a new message. The pattern used can be changed by overriding a
23064method or class variable.
23065
23066- Added a rmtree() function to the copy module.
23067
23068- Fixed several typos in the pickle module. Also fixed problems when
23069unpickling in restricted execution environments.
23070
23071- Added docstrings and fixed a typo in the py_compile and compileall
23072modules. At Mark Hammond's repeated request, py_compile now append a
23073newline to the source if it needs one. Both modules support an extra
23074parameter to specify the purported source filename (to be used in
23075error messages).
23076
23077- Some performance tweaks by Jeremy Hylton to the gzip module.
23078
23079- Fixed a bug in the merge order of dictionaries in the ConfigParser
23080module. Courtesy Barry Warsaw.
23081
23082- In the multifile module, support the optional second parameter to
23083seek() when possible.
23084
Victor Stinner554fd082014-03-17 22:33:49 +010023085- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023086urlparse now correctly handles Gopher URLs with query strings.
23087
23088- Fixed a tiny bug in format_exception() in the traceback module.
23089Also rewrite tb_lineno() to be compatible with JPython (and not
23090disturb the current exception!); by Jim Hugunin.
23091
Victor Stinner554fd082014-03-17 22:33:49 +010023092- The httplib module is more robust when servers send a short response
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023093-- courtesy Tim O'Malley.
23094
23095Tkinter and friends
23096-------------------
23097
23098- Various typos and bugs fixed.
23099
23100- New module Tkdnd implements a drag-and-drop protocol (within one
23101application only).
23102
23103- The event_*() widget methods have been restructured slightly -- they
23104no longer use the default root.
23105
23106- The interfaces for the bind*() and unbind() widget methods have been
Victor Stinner554fd082014-03-17 22:33:49 +010023107redesigned; the bind*() methods now return the name of the Tcl command
Martin Panter7462b6492015-11-02 03:37:02 +000023108created for the callback, and this can be passed as an optional
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023109argument to unbind() in order to delete the command (normally, such
23110commands are automatically unbound when the widget is destroyed, but
23111for some applications this isn't enough).
23112
23113- Variable objects now have trace methods to interface to Tcl's
23114variable tracing facilities.
23115
23116- Image objects now have an optional keyword argument, 'master', to
23117specify a widget (tree) to which they belong. The image_names() and
23118image_types() calls are now also widget methods.
23119
23120- There's a new global call, Tkinter.NoDefaultRoot(), which disables
23121all use of the default root by the Tkinter library. This is useful to
23122debug applications that are in the process of being converted from
23123relying on the default root to explicit specification of the root
23124widget.
23125
23126- The 'exit' command is deleted from the Tcl interpreter, since it
23127provided a loophole by which one could (accidentally) exit the Python
23128interpreter without invoking any cleanup code.
23129
23130- Tcl_Finalize() is now registered as a Python low-level exit handle,
23131so Tcl will be finalized when Python exits.
23132
23133The Python/C API
23134----------------
23135
23136- New function PyThreadState_GetDict() returns a per-thread dictionary
23137intended for storing thread-local global variables.
23138
23139- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
23140dictionary to allow recursive container types to detect recursion in
23141their repr(), str() and print implementations.
23142
Victor Stinner554fd082014-03-17 22:33:49 +010023143- New function PyObject_Not(x) calculates (not x) according to Python's
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023144standard rules (basically, it negates the outcome PyObject_IsTrue(x).
23145
23146- New function _PyModule_Clear(), which clears a module's dictionary
23147carefully without removing the __builtins__ entry. This is implied
23148when a module object is deallocated (this used to clear the dictionary
23149completely).
23150
23151- New function PyImport_ExecCodeModuleEx(), which extends
23152PyImport_ExecCodeModule() by adding an extra parameter to pass it the
23153true file.
23154
23155- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
23156allow embedded applications to force a different value for PYTHONHOME.
23157
23158- New global flag Py_FrozenFlag is set when this is a "frozen" Python
23159binary; it suppresses warnings about not being able to find the
23160standard library directories.
23161
23162- New global flag Py_TabcheckFlag is incremented by the -t option and
23163causes the tokenizer to issue warnings or errors about inconsistent
23164mixing of tabs and spaces for indentation.
23165
23166Miscellaneous minor changes and bug fixes
23167-----------------------------------------
23168
23169- Improved the error message when an attribute of an attribute-less
23170object is requested -- include the name of the attribute and the type
23171of the object in the message.
23172
23173- Sped up int(), long(), float() a bit.
23174
23175- Fixed a bug in list.sort() that would occasionally dump core.
23176
23177- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
23178when taken tothe real power.
23179
23180- Fixed a number of bugs in the file reading code, at least one of
23181which could cause a core dump on NT, and one of which would
23182occasionally cause file.read() to return less than the full contents
23183of the file.
23184
23185- Performance hack by Vladimir Marangozov for stack frame creation.
23186
23187- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
23188
23189Windows 95/NT
23190-------------
23191
23192- The .lib files are now part of the distribution; they are collected
23193in the subdirectory "libs" of the installation directory.
23194
23195- The extension modules (.pyd files) are now collected in a separate
23196subdirectory of the installation directory named "DLLs".
23197
23198- The case of a module's filename must now match the case of the
23199module name as specified in the import statement. This is an
23200experimental feature -- if it turns out to break in too many
23201situations, it will be removed (or disabled by default) in the future.
23202It can be disabled on a per-case basis by setting the environment
23203variable PYTHONCASEOK (to any value).
23204
23205
23206======================================================================
23207
23208
Guido van Rossumf2eac992000-09-04 17:24:24 +000023209=====================================
23210==> Release 1.5 (January 3, 1998) <==
23211=====================================
23212
23213
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023214From 1.5b2 to 1.5
23215=================
23216
23217- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
23218
23219- Added doc strings to string.py, stropmodule.c, structmodule.c,
23220thanks to Charles Waldman.
23221
23222- Many nits fixed in the manuals, thanks to Fred Drake and many others
23223(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
23224HTML markup instead of inline GIF images for tables; only two images
23225are left (for obsure bits of math). The index of the HTML version has
23226also been much improved. Finally, it is once again possible to
23227generate an Emacs info file from the library manual (but I don't
23228commit to supporting this in future versions).
23229
23230- New module: telnetlib.py (a simple telnet client library).
23231
23232- New tool: Tools/versioncheck/, by Jack Jansen.
23233
23234- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
23235DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
23236extension modules.
23237
23238- Many small changes again to Tkinter.py -- mostly bugfixes and adding
23239missing routines. Thanks to Greg McFarlane for reporting a bunch of
23240problems and proofreading my fixes.
23241
23242- The re module and its documentation are up to date with the latest
23243version released to the string-sig (Dec. 22).
23244
23245- Stop test_grp.py from failing when the /etc/group file is empty
23246(yes, this happens!).
23247
23248- Fix bug in integer conversion (mystrtoul.c) that caused
232494294967296==0 to be true!
23250
23251- The VC++ 4.2 project file should be complete again.
23252
23253- In tempfile.py, use a better template on NT, and add a new optional
23254argument "suffix" with default "" to specify a specific extension for
23255the temporary filename (needed sometimes on NT but perhaps also handy
23256elsewhere).
23257
23258- Fixed some bugs in the FAQ wizard, and converted it to use re
23259instead of regex.
23260
23261- Fixed a mysteriously undetected error in dlmodule.c (it was using a
23262totally bogus routine name to raise an exception).
23263
23264- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
23265
23266- Hopefully harmless changes to the build process to support shared
23267libraries on DG/UX. This adds a target to create
23268libpython$(VERSION).so; however this target is *only* for DG/UX.
23269
23270- Fixed a bug in the new format string error checking in getargs.c.
23271
23272- A simple fix for infinite recursion when printing __builtins__:
23273reset '_' to None before printing and set it to the printed variable
23274*after* printing (and only when printing is successful).
23275
23276- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
23277parent window is not (Skip Montanaro).
23278
23279- Fixed the two most annoying problems with ftp URLs in
23280urllib.urlopen(); an empty file now correctly raises an error, and it
23281is no longer required to explicitly close the returned "file" object
23282before opening another ftp URL to the same host and directory.
23283
23284
23285======================================================================
23286
23287
23288From 1.5b1 to 1.5b2
23289===================
23290
23291- Fixed a bug in cPickle.c that caused it to crash right away because
23292the version string had a different format.
23293
23294- Changes in pickle.py and cPickle.c: when unpickling an instance of a
23295class that doesn't define the __getinitargs__() method, the __init__()
23296constructor is no longer called. This makes a much larger group of
23297classes picklable by default, but may occasionally change semantics.
23298To force calling __init__() on unpickling, define a __getinitargs__()
23299method. Other changes too, in particular cPickle now handles classes
23300defined in packages correctly. The same change applies to copying
23301instances with copy.py. The cPickle.c changes and some pickle.py
23302changes are courtesy Jim Fulton.
23303
Victor Stinner554fd082014-03-17 22:33:49 +010023304- Locale support in he "re" (Perl regular expressions) module. Use
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023305the flag re.L (or re.LOCALE) to enable locale-specific matching
23306rules for \w and \b. The in-line syntax for this flag is (?L).
23307
23308- The built-in function isinstance(x, y) now also succeeds when y is
23309a type object and type(x) is y.
23310
23311- repr() and str() of class and instance objects now reflect the
23312package/module in which the class is defined.
23313
23314- Module "ni" has been removed. (If you really need it, it's been
23315renamed to "ni1". Let me know if this causes any problems for you.
23316Package authors are encouraged to write __init__.py files that
23317support both ni and 1.5 package support, so the same version can be
23318used with Python 1.4 as well as 1.5.)
23319
23320- The thread module is now automatically included when threads are
23321configured. (You must remove it from your existing Setup file,
23322since it is now in its own Setup.thread file.)
23323
23324- New command line option "-x" to skip the first line of the script;
23325handy to make executable scripts on non-Unix platforms.
23326
23327- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
23328haven't checked how this affects things, but it should make symbols
23329in one shared library available to the next one.
23330
23331- The Windows installer now installs in the "Program Files" folder on
23332the proper volume by default.
23333
23334- The Windows configuration adds a new main program, "pythonw", and
23335registers a new extension, ".pyw" that invokes this. This is a
23336pstandard Python interpreter that does not pop up a console window;
23337handy for pure Tkinter applications. All output to the original
23338stdout and stderr is lost; reading from the original stdin yields
23339EOF. Also, both python.exe and pythonw.exe now have a pretty icon
23340(a green snake in a box, courtesy Mark Hammond).
23341
23342- Lots of improvements to emacs-mode.el again. See Barry's web page:
23343http://www.python.org/ftp/emacs/pmdetails.html.
23344
23345- Lots of improvements and additions to the library reference manual;
23346many by Fred Drake.
23347
23348- Doc strings for the following modules: rfc822.py, posixpath.py,
23349ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
23350
23351- Some more regression testing.
23352
23353- An optional 4th (maxsplit) argument to strop.replace().
23354
23355- Fixed handling of maxsplit in string.splitfields().
23356
23357- Tweaked os.environ so it can be pickled and copied.
23358
23359- The portability problems caused by indented preprocessor commands
23360and C++ style comments should be gone now.
23361
23362- In random.py, added Pareto and Weibull distributions.
23363
23364- The crypt module is now disabled in Modules/Setup.in by default; it
23365is rarely needed and causes errors on some systems where users often
23366don't know how to deal with those.
23367
23368- Some improvements to the _tkinter build line suggested by Case Roole.
23369
Victor Stinner554fd082014-03-17 22:33:49 +010023370- A full suite of platform specific files for NetBSD 1.x, submitted by
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023371Anders Andersen.
23372
23373- New Solaris specific header STROPTS.py.
23374
23375- Moved a confusing occurrence of *shared* from the comments in
23376Modules/Setup.in (people would enable this one instead of the real
23377one, and get disappointing results).
23378
23379- Changed the default mode for directories to be group-writable when
23380the installation process creates them.
23381
23382- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
23383shared libraries for both.
23384
23385- Support FreeBSD and NetBSD in posixfile.py.
23386
23387- Support for the "event" command, new in Tk 4.2. By Case Roole.
23388
23389- Add Tix_SafeInit() support to tkappinit.c.
23390
23391- Various bugs fixed in "re.py" and "pcre.c".
23392
23393- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
23394
23395- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
23396is set.
23397
23398- Provide default blocksize for retrbinary in ftplib.py (Skip
23399Montanaro).
23400
23401- In NT, pick the username up from different places in user.py (Jeff
23402Bauer).
23403
23404- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
23405
23406- Many small improvements to Jeff Rush' OS/2 support.
23407
23408- ospath.py is gone; it's been obsolete for so many years now...
23409
23410- The reference manual is now set up to prepare better HTML (still
23411using webmaker, alas).
23412
23413- Add special handling to /Tools/freeze for Python modules that are
23414imported implicitly by the Python runtime: 'site' and 'exceptions'.
23415
23416- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
23417inside <PRE>, by "Scott".
23418
23419- Added ConfigParser.py, a generic parser for sectioned configuration
23420files.
23421
23422- In _localemodule.c, LC_MESSAGES is not always defined; put it
23423between #ifdefs.
23424
23425- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
23426
23427- Demo/scripts/newslist.py: Fix the way the version number is gotten
23428out of the RCS revision.
23429
23430- PyArg_Parse[Tuple] now explicitly check for bad characters at the
23431end of the format string.
23432
23433- Revamped PC/example_nt to support VC++ 5.x.
23434
23435- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
23436after studying the GNU libg++ quicksort. This should be much faster
23437if there are lots of duplicates, and otherwise at least as good.
23438
23439- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
Victor Stinner554fd082014-03-17 22:33:49 +010023440uudecode bug where it complaints about trailing garbage is still there
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023441:-( ).
23442
23443- pickle.py requires integers in text mode to be in decimal notation
23444(it used to accept octal and hex, even though it would only generate
23445decimal numbers).
23446
23447- In string.atof(), don't fail when the "re" module is unavailable.
23448Plug the ensueing security leak by supplying an empty __builtins__
23449directory to eval().
23450
23451- A bunch of small fixes and improvements to Tkinter.py.
23452
23453- Fixed a buffer overrun in PC/getpathp.c.
23454
23455
23456======================================================================
23457
23458
23459From 1.5a4 to 1.5b1
23460===================
23461
23462- The Windows NT/95 installer now includes full HTML of all manuals.
23463It also has a checkbox that lets you decide whether to install the
23464interpreter and library. The WISE installer script for the installer
23465is included in the source tree as PC/python15.wse, and so are the
23466icons used for Python files. The config.c file for the Windows build
23467is now complete with the pcre module.
23468
23469- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
23470evaluated for the prompt.
23471
23472- The reference manual is brought up to date (more or less -- it still
23473needs work, e.g. in the area of package import).
23474
23475- The icons used by latex2html are now included in the Doc
23476subdirectory (mostly so that tarring up the HTML files can be fully
23477automated). A simple index.html is also added to Doc (it only works
23478after you have successfully run latex2html).
23479
23480- For all you would-be proselytizers out there: a new version of
23481Misc/BLURB describes Python more concisely, and Misc/comparisons
23482compares Python to several other languages. Misc/BLURB.WINDOWS
23483contains a blurb specifically aimed at Windows programmers (by Mark
23484Hammond).
23485
23486- A new version of the Python mode for Emacs is included as
23487Misc/python-mode.el. There are too many new features to list here.
23488See http://www.python.org/ftp/emacs/pmdetails.html for more info.
23489
23490- New module fileinput makes iterating over the lines of a list of
23491files easier. (This still needs some more thinking to make it more
23492extensible.)
23493
23494- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
23495version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
23496Age C++ compiler. I expect that Jeff will also provide a binary
23497release for this platform.
23498
23499- On Linux, the configure script now uses '-Xlinker -export-dynamic'
23500instead of '-rdynamic' to link the main program so that it exports its
23501symbols to shared libraries it loads dynamically. I hope this doesn't
23502break on older Linux versions; it is needed for mklinux and appears to
23503work on Linux 2.0.30.
23504
23505- Some Tkinter resstructuring: the geometry methods that apply to a
23506master are now properly usable on toplevel master widgets. There's a
23507new (internal) widget class, BaseWidget. New, longer "official" names
23508for the geometry manager methods have been added,
23509e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
23510shorter names still work, and where there's ambiguity, pack wins over
23511place wins over grid. Also, the bind_class method now returns its
23512value.
23513
23514- New, RFC-822 conformant parsing of email addresses and address lists
23515in the rfc822 module, courtesy Ben Escoto.
23516
23517- New, revamped tkappinit.c with support for popular packages (PIL,
23518TIX, BLT, TOGL). For the last three, you need to execute the Tcl
23519command "load {} Tix" (or Blt, or Togl) to gain access to them.
23520The Modules/Setup line for the _tkinter module has been rewritten
23521using the cool line-breaking feature of most Bourne shells.
23522
23523- New socket method connect_ex() returns the error code from connect()
23524instead of raising an exception on errors; this makes the logic
23525required for asynchronous connects simpler and more efficient.
23526
23527- New "locale" module with (still experimental) interface to the
Antoine Pitroufbd4f802012-08-11 16:51:50 +020023528standard C library locale interface, courtesy Martin von Löwis. This
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023529does not repeat my mistake in 1.5a4 of always calling
23530setlocale(LC_ALL, ""). In fact, we've pretty much decided that
23531Python's standard numerical formatting operations should always use
23532the conventions for the C locale; the locale module contains utility
23533functions to format numbers according to the user specified locale.
23534(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
23535"C") after locale-changing calls.) See the library manual. (Alas, the
23536promised changes to the "re" module for locale support have not been
23537materialized yet. If you care, volunteer!)
23538
23539- Memory leak plugged in Py_BuildValue when building a dictionary.
23540
23541- Shared modules can now live inside packages (hierarchical module
23542namespaces). No changes to the shared module itself are needed.
23543
23544- Improved policy for __builtins__: this is a module in __main__ and a
23545dictionary everywhere else.
23546
23547- Python no longer catches SIGHUP and SIGTERM by default. This was
23548impossible to get right in the light of thread contexts. If you want
23549your program to clean up when a signal happens, use the signal module
23550to set up your own signal handler.
23551
23552- New Python/C API PyNumber_CoerceEx() does not return an exception
23553when no coercion is possible. This is used to fix a problem where
23554comparing incompatible numbers for equality would raise an exception
23555rather than return false as in Python 1.4 -- it once again will return
23556false.
23557
23558- The errno module is changed again -- the table of error messages
23559(errorstr) is removed. Instead, you can use os.strerror(). This
23560removes redundance and a potential locale dependency.
23561
23562- New module xmllib, to parse XML files. By Sjoerd Mullender.
23563
23564- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
23565It resets the signal module's notion of what the current process ID
23566and thread are, so that signal handlers will work after (and across)
23567calls to os.fork().
23568
23569- Fixed most occurrences of fatal errors due to missing thread state.
23570
23571- For vgrind (a flexible source pretty printer) fans, there's a simple
23572Python definition in Misc/vgrindefs, courtesy Neale Pickett.
23573
23574- Fixed memory leak in exec statement.
23575
23576- The test.pystone module has a new function, pystones(loops=LOOPS),
23577which returns a (benchtime, stones) tuple. The main() function now
23578calls this and prints the report.
23579
23580- Package directories now *require* the presence of an __init__.py (or
23581__init__.pyc) file before they are considered as packages. This is
23582done to prevent accidental subdirectories with common names from
23583overriding modules with the same name.
23584
23585- Fixed some strange exceptions in __del__ methods in library modules
Georg Brandl93dc9eb2010-03-14 10:56:14 +000023586(e.g. urllib). This happens because the built-in names are already
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023587deleted by the time __del__ is called. The solution (a hack, but it
23588works) is to set some instance variables to 0 instead of None.
23589
23590- The table of built-in module initializers is replaced by a pointer
23591variable. This makes it possible to switch to a different table at
23592run time, e.g. when a collection of modules is loaded from a shared
23593library. (No example code of how to do this is given, but it is
23594possible.) The table is still there of course, its name prefixed with
23595an underscore and used to initialize the pointer.
23596
23597- The warning about a thread still having a frame now only happens in
23598verbose mode.
23599
23600- Change the signal finialization so that it also resets the signal
23601handlers. After this has been called, our signal handlers are no
23602longer active!
23603
23604- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
23605literals. There's now also a test fort this module.
23606
23607- The copy module now also uses __dict__.update(state) instead of
23608going through individual attribute assignments, for class instances
23609without a __setstate__ method.
23610
23611- New module reconvert translates old-style (regex module) regular
23612expressions to new-style (re module, Perl-style) regular expressions.
23613
23614- Most modules that used to use the regex module now use the re
23615module. The grep module has a new pgrep() function which uses
23616Perl-style regular expressions.
23617
23618- The (very old, backwards compatibility) regexp.py module has been
23619deleted.
23620
23621- Restricted execution (rexec): added the pcre module (support for the
23622re module) to the list of trusted extension modules.
23623
23624- New version of Jim Fulton's CObject object type, adds
23625PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
23626
23627- Some patches to Lee Busby's fpectl mods that accidentally didn't
23628make it into 1.5a4.
23629
23630- In the string module, add an optional 4th argument to count(),
23631matching find() etc.
23632
23633- Patch for the nntplib module by Charles Waldman to add optional user
23634and password arguments to NNTP.__init__(), for nntp servers that need
23635them.
23636
23637- The str() function for class objects now returns
23638"modulename.classname" instead of returning the same as repr().
23639
23640- The parsing of \xXX escapes no longer relies on sscanf().
23641
23642- The "sharedmodules" subdirectory of the installation is renamed to
23643"lib-dynload". (You may have to edit your Modules/Setup file to fix
23644this in an existing installation!)
23645
23646- Fixed Don Beaudry's mess-up with the OPT test in the configure
23647script. Certain SGI platforms will still issue a warning for each
23648compile; there's not much I can do about this since the compiler's
23649exit status doesn't indicate that I was using an obsolete option.
23650
23651- Fixed Barry's mess-up with {}.get(), and added test cases for it.
23652
23653- Shared libraries didn't quite work under AIX because of the change
23654in status of the GNU readline interface. Fix due to by Vladimir
23655Marangozov.
23656
23657
23658======================================================================
23659
23660
23661From 1.5a3 to 1.5a4
23662===================
23663
23664- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
23665feature; better install instructions; removed faqmain.py (which was an
23666older version).
23667
23668- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
23669about the treatment of lines starting with '.'. Added a minimal test
23670function.
23671
23672- struct module: ignore most whitespace in format strings.
23673
23674- urllib.py: close the socket and temp file in URLopener.retrieve() so
23675that multiple retrievals using the same connection work.
23676
23677- All standard exceptions are now classes by default; use -X to make
23678them strings (for backward compatibility only).
23679
23680- There's a new standard exception hierarchy, defined in the standard
23681library module exceptions.py (which you never need to import
23682explicitly). See
23683http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
23684more info.
23685
23686- Three new C API functions:
23687
23688 - int PyErr_GivenExceptionMatches(obj1, obj2)
23689
23690 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
23691 instance of type obj2, or of a class derived from obj2
23692
23693 - int PyErr_ExceptionMatches(obj)
23694
23695 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
23696 PyErr_Occurred() as obj1. This will be the more commonly called
23697 function.
23698
23699 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
23700
23701 Normalizes exceptions, and places the normalized values in the
23702 arguments. If type is not a class, this does nothing. If type is a
23703 class, then it makes sure that value is an instance of the class by:
23704
23705 1. if instance is of the type, or a class derived from type, it does
23706 nothing.
23707
23708 2. otherwise it instantiates the class, using the value as an
23709 argument. If value is None, it uses an empty arg tuple, and if
23710 the value is a tuple, it uses just that.
23711
23712- Another new C API function: PyErr_NewException() creates a new
23713exception class derived from Exception; when -X is given, it creates a
23714new string exception.
23715
23716- core interpreter: remove the distinction between tuple and list
23717unpacking; allow an arbitrary sequence on the right hand side of any
23718unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
23719thing, which should really be called UNPACK_SEQUENCE.)
23720
23721- classes: Allow assignments to an instance's __dict__ or __class__,
23722so you can change ivars (including shared ivars -- shock horror) and
23723change classes dynamically. Also make the check on read-only
23724attributes of classes less draconic -- only the specials names
23725__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
23726assigned.
23727
23728- Two new built-in functions: issubclass() and isinstance(). Both
23729take classes as their second arguments. The former takes a class as
23730the first argument and returns true iff first is second, or is a
23731subclass of second. The latter takes any object as the first argument
23732and returns true iff first is an instance of the second, or any
23733subclass of second.
23734
23735- configure: Added configuration tests for presence of alarm(),
23736pause(), and getpwent().
23737
23738- Doc/Makefile: changed latex2html targets.
23739
23740- classes: Reverse the search order for the Don Beaudry hook so that
23741the first class with an applicable hook wins. Makes more sense.
23742
23743- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
23744now legal to call these more than once. The first call to
23745Py_Initialize() initializes, the first call to Py_Finalize()
Martin Panter8f265652016-04-19 04:03:41 +000023746finalizes. There's also a new API, Py_IsInitialized() which checks
Guido van Rossum439d1fa1998-12-21 21:41:14 +000023747whether we are already initialized (in case you want to leave things
23748as they were).
23749
23750- Completely disable the declarations for malloc(), realloc() and
23751free(). Any 90's C compiler has these in header files, and the tests
23752to decide whether to suppress the declarations kept failing on some
23753platforms.
23754
23755- *Before* (instead of after) signalmodule.o is added, remove both
23756intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
23757ld on various systems.
23758
23759- Added reop to PC/config.c
23760
23761- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
23762Removed outdated HP-UX comments from README. Added Cray T3E comments.
23763
23764- Various renames of statically defined functions that had name
23765conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
23766roundup (sys/types.h).
23767
23768- urllib.py: Interpret three slashes in file: URL as local file (for
23769Netscape on Windows/Mac).
23770
23771- copy.py: Make sure the objects returned by __getinitargs__() are
23772kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
23773easily reproducable because it requires a later call to
23774__getinitargs__() to return a tuple that happens to be allocated at
23775the same address.)
23776
23777- Added definition of AR to toplevel Makefile. Renamed @buildno temp
23778file to buildno1.
23779
23780- Moved Include/assert.h to Parser/assert.h, which seems to be the
23781only place where it's needed.
23782
23783- Tweaked the dictionary lookup code again for some more speed
23784(Vladimir Marangozov).
23785
23786- NT build: Changed the way python15.lib is included in the other
23787projects. Per Mark Hammond's suggestion, add it to the extra libs in
23788Settings instead of to the project's source files.
23789
23790- regrtest.py: Change default verbosity so that there are only three
23791levels left: -q, default and -v. In default mode, the name of each
23792test is now printed. -v is the same as the old -vv. -q is more quiet
23793than the old default mode.
23794
23795- Removed the old FAQ from the distribution. You now have to get it
23796from the web!
23797
23798- Removed the PC/make_nt.in file from the distribution; it is no
23799longer needed.
23800
23801- Changed the build sequence so that shared modules are built last.
23802This fixes things for AIX and doesn't hurt elsewhere.
23803
23804- Improved test for GNU MP v1 in mpzmodule.c
23805
23806- fileobject.c: ftell() on Linux discards all buffered data; changed
23807read() code to use lseek() instead to get the same effect
23808
23809- configure.in, configure, importdl.c: NeXT sharedlib fixes
23810
23811- tupleobject.c: PyTuple_SetItem asserts refcnt==1
23812
23813- resource.c: Different strategy regarding whether to declare
23814getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
23815conflicting decls in its headers. Choice: only declare the return
23816type, not the argument prototype, and not on Linux.
23817
23818- importdl.c, configure*: set sharedlib extensions properly for NeXT
23819
23820- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
23821fixed; moved addition of PURIFY to LINKCC to configure
23822
23823- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
23824added to shup up various compilers.
23825
23826- _tkinter.c: removed buggy mac #ifndef
23827
23828- Doc: various Mac documentation changes, added docs for 'ic' module
23829
23830- PC/make_nt.in: deleted
23831
23832- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
23833"")
23834
23835- test_rotor.py: print b -> print `b`
23836
23837- Tkinter.py: (tagOrId) -> (tagOrId,)
23838
23839- Tkinter.py: the Tk class now also has a configure() method and
23840friends (they have been moved to the Misc class to accomplish this).
23841
23842- dict.get(key[, default]) returns dict[key] if it exists, or default
23843if it doesn't. The default defaults to None. This is quicker for
23844some applications than using either has_key() or try:...except
23845KeyError:....
23846
23847- Tools/webchecker/: some small changes to webchecker.py; added
23848websucker.py (a simple web site mirroring script).
23849
23850- Dictionary objects now have a get() method (also in UserDict.py).
23851dict.get(key, default) returns dict[key] if it exists and default
23852otherwise; default defaults to None.
23853
23854- Tools/scripts/logmerge.py: print the author, too.
23855
23856- Changes to import: support for "import a.b.c" is now built in. See
23857http://grail.cnri.reston.va.us/python/essays/packages.html
23858for more info. Most important deviations from "ni.py": __init__.py is
23859executed in the package's namespace instead of as a submodule; and
23860there's no support for "__" or "__domain__". Note that "ni.py" is not
23861changed to match this -- it is simply declared obsolete (while at the
23862same time, it is documented...:-( ).
23863Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
23864for an example implementation of hierarchical module import written in
23865Python).
23866
23867- More changes to import: the site.py module is now imported by
23868default when Python is initialized; use -S to disable it. The site.py
23869module extends the path with several more directories: site-packages
23870inside the lib/python1.5/ directory, site-python in the lib/
23871directory, and pathnames mentioned in *.pth files found in either of
23872those directories. See
23873http://grail.cnri.reston.va.us/python/essays/packages.html
23874for more info.
23875
23876- Changes to standard library subdirectory names: those subdirectories
23877that are not packages have been renamed with a hypen in their name,
23878e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
23879The test suite is now a package -- to run a test, you must now use
23880"import test.test_foo".
23881
23882- A completely new re.py module is provided (thanks to Andrew
23883Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
23884"pcre" re compiler and engine. For a while, the "old" re.py (which
23885was new in 1.5a3!) will be kept around as re1.py. The "old" regex
23886module and underlying parser and engine are still present -- while
23887regex is now officially obsolete, it will probably take several major
23888release cycles before it can be removed.
23889
23890- The posix module now has a strerror() function which translates an
23891error code to a string.
23892
23893- The emacs.py module (which was long obsolete) has been removed.
23894
23895- The universal makefile Misc/Makefile.pre.in now features an
23896"install" target. By default, installed shared libraries go into
23897$exec_prefix/lib/python$VERSION/site-packages/.
23898
23899- The install-sh script is installed with the other configuration
23900specific files (in the config/ subdirectory).
23901
23902- It turns out whatsound.py and sndhdr.py were identical modules.
23903Since there's also an imghdr.py file, I propose to make sndhdr.py the
23904official one. For compatibility, whatsound.py imports * from
23905sndhdr.py.
23906
23907- Class objects have a new attribute, __module__, giving the name of
23908the module in which they were declared. This is useful for pickle and
23909for printing the full name of a class exception.
23910
23911- Many extension modules no longer issue a fatal error when their
23912initialization fails; the importing code now checks whether an error
23913occurred during module initialization, and correctly propagates the
23914exception to the import statement.
23915
23916- Most extension modules now raise class-based exceptions (except when
23917-X is used).
23918
23919- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
23920thread state -- just don't manipulate the lock if it isn't there.
23921
23922- Fixed a bug in Python/getopt.c that made it do the wrong thing when
23923an option was a single '-'. Thanks to Andrew Kuchling.
23924
23925- New module mimetypes.py will guess a MIME type from a filename's
23926extension.
23927
23928- Windows: the DLL version is now settable via a resource rather than
23929being hardcoded. This can be used for "branding" a binary Python
23930distribution.
23931
23932- urllib.py is now threadsafe -- it now uses re instead of regex, and
23933sys.exc_info() instead of sys.exc_{type,value}.
23934
23935- Many other library modules that used to use
23936sys.exc_{type,value,traceback} are now more thread-safe by virtue of
23937using sys.exc_info().
23938
23939- The functions in popen2 have an optional buffer size parameter.
23940Also, the command argument can now be either a string (passed to the
23941shell) or a list of arguments (passed directly to execv).
23942
23943- Alas, the thread support for _tkinter released with 1.5a3 didn't
23944work. It's been rewritten. The bad news is that it now requires a
23945modified version of a file in the standard Tcl distribution, which you
23946must compile with a -I option pointing to the standard Tcl source
23947tree. For this reason, the thread support is disabled by default.
23948
23949- The errno extension module adds two tables: errorcode maps errno
23950numbers to errno names (e.g. EINTR), and errorstr maps them to
23951message strings. (The latter is redundant because the new call
23952posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
23953
23954- The readline extension module now provides some interfaces to
23955internal readline routines that make it possible to write a completer
23956in Python. An example completer, rlcompleter.py, is provided.
23957
23958 When completing a simple identifier, it completes keywords,
23959 built-ins and globals in __main__; when completing
23960 NAME.NAME..., it evaluates (!) the expression up to the last
23961 dot and completes its attributes.
23962
23963 It's very cool to do "import string" type "string.", hit the
23964 completion key (twice), and see the list of names defined by
23965 the string module!
23966
23967 Tip: to use the tab key as the completion key, call
23968
23969 readline.parse_and_bind("tab: complete")
23970
23971- The traceback.py module has a new function tb_lineno() by Marc-Andre
23972Lemburg which extracts the line number from the linenumber table in
23973the code object. Apparently the traceback object doesn't contains the
23974right linenumber when -O is used. Rather than guessing whether -O is
23975on or off, the module itself uses tb_lineno() unconditionally.
23976
23977- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
23978to tag_bind() so it works again.
23979
23980- The pystone script is now a standard library module. Example use:
23981"import test.pystone; test.pystone.main()".
23982
23983- The import of the readline module in interactive mode is now also
23984attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
23985Lemburg, who asked for this. :-)
23986
23987- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
23988Mullender, to be closer to the standard. This fixes the getaddr()
23989method. Unfortunately, getaddrlist() is as broken as ever, since it
23990splits on commas without regard for RFC 822 quoting conventions.
23991
23992- pprint.py: correctly emit trailing "," in singleton tuples.
23993
23994- _tkinter.c: export names for its type objects, TkappType and
23995TkttType.
23996
23997- pickle.py: use __module__ when defined; fix a particularly hard to
23998reproduce bug that confuses the memo when temporary objects are
23999returned by custom pickling interfaces; and a semantic change: when
24000unpickling the instance variables of an instance, use
24001inst.__dict__.update(value) instead of a for loop with setattr() over
24002the value.keys(). This is more consistent (the pickling doesn't use
24003getattr() either but pickles inst.__dict__) and avoids problems with
24004instances that have a __setattr__ hook. But it *is* a semantic change
24005(because the setattr hook is no longer used). So beware!
24006
24007- config.h is now installed (at last) in
24008$exec_prefix/include/python1.5/. For most sites, this means that it
24009is actually in $prefix/include/python1.5/, with all the other Python
24010include files, since $prefix and $exec_prefix are the same by
24011default.
24012
24013- The imp module now supports parts of the functionality to implement
24014import of hierarchical module names. It now supports find_module()
24015and load_module() for all types of modules. Docstrings have been
24016added for those functions in the built-in imp module that are still
24017relevant (some old interfaces are obsolete). For a sample
24018implementation of hierarchical module import in Python, see the new
24019library module knee.py.
24020
24021- The % operator on string objects now allows arbitrary nested parens
24022in a %(...)X style format. (Brad Howes)
24023
24024- Reverse the order in which Setup and Setup.local are passed to the
24025makesetup script. This allows variable definitions in Setup.local to
24026override definitions in Setup. (But you'll still have to edit Setup
24027if you want to disable modules that are enabled by default, or if such
24028modules need non-standard options.)
24029
24030- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
24031is like PyImport_ImporModule(name) but receives the globals and locals
24032dict and the fromlist arguments as well. (The name is a char*; the
24033others are PyObject*s).
24034
24035- The 'p' format in the struct extension module alloded to above is
24036new in 1.5a4.
24037
24038- The types.py module now uses try-except in a few places to make it
24039more likely that it can be imported in restricted mode. Some type
24040names are undefined in that case, e.g. CodeType (inaccessible),
24041FileType (not always accessible), and TracebackType and FrameType
24042(inaccessible).
24043
24044- In urllib.py: added separate administration of temporary files
24045created y URLopener.retrieve() so cleanup() can properly remove them.
24046The old code removed everything in tempcache which was a bad idea if
24047the user had passed a non-temp file into it. Also, in basejoin(),
24048interpret relative paths starting in "../". This is necessary if the
24049server uses symbolic links.
24050
24051- The Windows build procedure and project files are now based on
24052Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
24053directory. It is much more robust, and properly builds separate Debug
24054and Release versions. (The installer will be added shortly.)
24055
24056- Added casts and changed some return types in regexpr.c to avoid
24057compiler warnings or errors on some platforms.
24058
24059- The AIX build tools for shared libraries now supports VPATH. (Donn
24060Cave)
24061
24062- By default, disable the "portable" multimedia modules audioop,
24063imageop, and rgbimg, since they don't work on 64-bit platforms.
24064
24065- Fixed a nasty bug in cStringIO.c when code was actually using the
24066close() method (the destructors would try to free certain fields a
24067second time).
24068
24069- For those who think they need it, there's a "user.py" module. This
24070is *not* imported by default, but can be imported to run user-specific
24071setup commands, ~/.pythonrc.py.
24072
24073- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
24074Vladimir Marangozov, and others.
24075
24076- Added os.altsep; this is '/' on DOS/Windows, and None on systems
24077with a sane filename syntax.
24078
24079- os.py: Write out the dynamic OS choice, to avoid exec statements.
24080Adding support for a new OS is now a bit more work, but I bet that
24081'dos' or 'nt' will cover most situations...
24082
24083- The obsolete exception AccessError is now really gone.
24084
24085- Tools/faqwiz/: New installation instructions show how to maintain
24086multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
24087Added instructions to bootstrap script, too. Version bumped to 0.8.1.
24088Added <html>...</html> feature suggested by Skip Montanaro. Added
24089leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
24090default SRCDIR.
24091
24092- Documentation for the relatively new modules "keyword" and "symbol"
24093has been added (to the end of the section on the parser extension
24094module).
24095
24096- In module bisect.py, but functions have two optional argument 'lo'
24097and 'hi' which allow you to specify a subsequence of the array to
24098operate on.
24099
24100- In ftplib.py, changed most methods to return their status (even when
24101it is always "200 OK") rather than swallowing it.
24102
24103- main() now calls setlocale(LC_ALL, ""), if setlocale() and
24104<locale.h> are defined.
24105
24106- Changes to configure.in, the configure script, and both
24107Makefile.pre.in files, to support SGI's SGI_ABI platform selection
24108environment variable.
24109
24110
24111======================================================================
24112
24113
24114From 1.4 to 1.5a3
24115=================
24116
24117Security
24118--------
24119
24120- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
24121please use the new version. The old version has a huge security leak.
24122
24123Miscellaneous
24124-------------
24125
24126- Because of various (small) incompatible changes in the Python
24127bytecode interpreter, the magic number for .pyc files has changed
24128again.
24129
24130- The default module search path is now much saner. Both on Unix and
24131Windows, it is essentially derived from the path to the executable
24132(which can be overridden by setting the environment variable
24133$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
24134front of the default path, like in Unix (instead of overriding the
24135default path). On Windows, the directory containing the executable is
24136added to the end of the path.
24137
24138- A new version of python-mode.el for Emacs has been included. Also,
24139a new file ccpy-style.el has been added to configure Emacs cc-mode for
24140the preferred style in Python C sources.
24141
24142- On Unix, when using sys.argv[0] to insert the script directory in
24143front of sys.path, expand a symbolic link. You can now install a
24144program in a private directory and have a symbolic link to it in a
24145public bin directory, and it will put the private directory in the
24146module search path. Note that the symlink is expanded in sys.path[0]
24147but not in sys.argv[0], so you can still tell the name by which you
24148were invoked.
24149
24150- It is now recommended to use ``#!/usr/bin/env python'' instead of
24151``#!/usr/local/bin/python'' at the start of executable scripts, except
24152for CGI scripts. It has been determined that the use of /usr/bin/env
24153is more portable than that of /usr/local/bin/python -- scripts almost
24154never have to be edited when the Python interpreter lives in a
24155non-standard place. Note that this doesn't work for CGI scripts since
24156the python executable often doesn't live in the HTTP server's default
24157search path.
24158
24159- The silly -s command line option and the corresponding
24160PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
24161flag in the Python/C API) are gone.
24162
24163- Most problems on 64-bit platforms should now be fixed. Andrew
24164Kuchling helped. Some uncommon extension modules are still not
24165clean (image and audio ops?).
24166
24167- Fixed a bug where multiple anonymous tuple arguments would be mixed up
24168when using the debugger or profiler (reported by Just van Rossum).
24169The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
24170would print the wrong value when run under the debugger or profiler.
24171
24172- The hacks that the dictionary implementation used to speed up
24173repeated lookups of the same C string were removed; these were a
24174source of subtle problems and don't seem to serve much of a purpose
24175any longer.
24176
24177- All traces of support for the long dead access statement have been
24178removed from the sources.
24179
24180- Plugged the two-byte memory leak in the tokenizer when reading an
24181interactive EOF.
24182
24183- There's a -O option to the interpreter that removes SET_LINENO
24184instructions and assert statements (see below); it uses and produces
24185.pyo files instead of .pyc files. The speedup is only a few percent
24186in most cases. The line numbers are still available in the .pyo file,
24187as a separate table (which is also available in .pyc files). However,
24188the removal of the SET_LINENO instructions means that the debugger
24189(pdb) can't set breakpoints on lines in -O mode. The traceback module
24190contains a function to extract a line number from the code object
24191referenced in a traceback object. In the future it should be possible
24192to write external bytecode optimizers that create better optimized
24193.pyo files, and there should be more control over optimization;
24194consider the -O option a "teaser". Without -O, the assert statement
24195actually generates code that first checks __debug__; if this variable
24196is false, the assertion is not checked. __debug__ is a built-in
24197variable whose value is initialized to track the -O flag (it's true
24198iff -O is not specified). With -O, no code is generated for assert
24199statements, nor for code of the form ``if __debug__: <something>''.
24200Sorry, no further constant folding happens.
24201
24202
24203Performance
24204-----------
24205
24206- It's much faster (almost twice for pystone.py -- see
24207Tools/scripts). See the entry on string interning below.
24208
24209- Some speedup by using separate free lists for method objects (both
24210the C and the Python variety) and for floating point numbers.
24211
24212- Big speedup by allocating frame objects with a single malloc() call.
24213The Python/C API for frames is changed (you shouldn't be using this
24214anyway).
24215
Victor Stinner554fd082014-03-17 22:33:49 +010024216- Significant speedup by inlining some common opcodes for common operand
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024217types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
24218
24219- Small speedup by reordering the method tables of some common
24220objects (e.g. list.append is now first).
24221
24222- Big optimization to the read() method of file objects. A read()
24223without arguments now attempts to use fstat to allocate a buffer of
24224the right size; for pipes and sockets, it will fall back to doubling
24225the buffer size. While that the improvement is real on all systems,
24226it is most dramatic on Windows.
24227
24228
24229Documentation
24230-------------
24231
24232- Many new pieces of library documentation were contributed, mostly by
24233Andrew Kuchling. Even cmath is now documented! There's also a
24234chapter of the library manual, "libundoc.tex", which provides a
24235listing of all undocumented modules, plus their status (e.g. internal,
24236obsolete, or in need of documentation). Also contributions by Sue
24237Williams, Skip Montanaro, and some module authors who succumbed to
24238pressure to document their own contributed modules :-). Note that
24239printing the documentation now kills fewer trees -- the margins have
24240been reduced.
24241
Victor Stinner554fd082014-03-17 22:33:49 +010024242- I have started documenting the Python/C API. Unfortunately this project
24243hasn't been completed yet. It will be complete before the final release of
24244Python 1.5, though. At the moment, it's better to read the LaTeX source
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024245than to attempt to run it through LaTeX and print the resulting dvi file.
24246
Victor Stinner554fd082014-03-17 22:33:49 +010024247- The posix module (and hence os.py) now has doc strings! Thanks to Neil
24248Schemenauer. I received a few other contributions of doc strings. In most
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024249other places, doc strings are still wishful thinking...
24250
24251
24252Language changes
24253----------------
24254
Victor Stinner554fd082014-03-17 22:33:49 +010024255- Private variables with leading double underscore are now a permanent
24256feature of the language. (These were experimental in release 1.4. I have
24257favorable experience using them; I can't label them "experimental"
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024258forever.)
24259
Victor Stinner554fd082014-03-17 22:33:49 +010024260- There's new string literal syntax for "raw strings". Prefixing a string
24261literal with the letter r (or R) disables all escape processing in the
24262string; for example, r'\n' is a two-character string consisting of a
24263backslash followed by the letter n. This combines with all forms of string
24264quotes; it is actually useful for triple quoted doc strings which might
24265contain references to \n or \t. An embedded quote prefixed with a
24266backslash does not terminate the string, but the backslash is still
24267included in the string; for example, r'\'' is a two-character string
24268consisting of a backslash and a quote. (Raw strings are also
24269affectionately known as Robin strings, after their inventor, Robin
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024270Friedrich.)
24271
24272- There's a simple assert statement, and a new exception
24273AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
24274not foo > 0: raise AssertionError''. Sorry, the text of the asserted
24275condition is not available; it would be too complicated to generate
24276code for this (since the code is generated from a parse tree).
24277However, the text is displayed as part of the traceback!
24278
24279- The raise statement has a new feature: when using "raise SomeClass,
24280somevalue" where somevalue is not an instance of SomeClass, it
24281instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
24282instance of a *derived* class of SomeClass, the exception class raised
24283is set to somevalue.__class__, and SomeClass is ignored after that.
24284
24285- Duplicate keyword arguments are now detected at compile time;
24286f(a=1,a=2) is now a syntax error.
24287
24288
Georg Brandl93dc9eb2010-03-14 10:56:14 +000024289Changes to built-in features
24290----------------------------
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024291
24292- There's a new exception FloatingPointError (used only by Lee Busby's
24293patches to catch floating point exceptions, at the moment).
24294
24295- The obsolete exception ConflictError (presumably used by the long
24296obsolete access statement) has been deleted.
24297
Victor Stinner554fd082014-03-17 22:33:49 +010024298- There's a new function sys.exc_info() which returns the tuple
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024299(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
24300
Victor Stinner554fd082014-03-17 22:33:49 +010024301- There's a new variable sys.executable, pointing to the executable file
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024302for the Python interpreter.
24303
24304- The sort() methods for lists no longer uses the C library qsort(); I
24305wrote my own quicksort implementation, with lots of help (in the form
24306of a kind of competition) from Tim Peters. This solves a bug in
24307dictionary comparisons on some Solaris versions when Python is built
24308with threads, and makes sorting lists even faster.
24309
24310- The semantics of comparing two dictionaries have changed, to make
24311comparison of unequal dictionaries faster. A shorter dictionary is
24312always considered smaller than a larger dictionary. For dictionaries
24313of the same size, the smallest differing element determines the
24314outcome (which yields the same results as before in this case, without
24315explicit sorting). Thanks to Aaron Watters for suggesting something
24316like this.
24317
24318- The semantics of try-except have changed subtly so that calling a
24319function in an exception handler that itself raises and catches an
24320exception no longer overwrites the sys.exc_* variables. This also
24321alleviates the problem that objects referenced in a stack frame that
24322caught an exception are kept alive until another exception is caught
24323-- the sys.exc_* variables are restored to their previous value when
24324returning from a function that caught an exception.
24325
24326- There's a new "buffer" interface. Certain objects (e.g. strings and
Victor Stinner554fd082014-03-17 22:33:49 +010024327arrays) now support the "buffer" protocol. Buffer objects are acceptable
24328whenever formerly a string was required for a write operation; mutable
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024329buffer objects can be the target of a read operation using the call
Victor Stinner554fd082014-03-17 22:33:49 +010024330f.readinto(buffer). A cool feature is that regular expression matching now
24331also work on array objects. Contribution by Jack Jansen. (Needs
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024332documentation.)
24333
24334- String interning: dictionary lookups are faster when the lookup
24335string object is the same object as the key in the dictionary, not
24336just a string with the same value. This is done by having a pool of
24337"interned" strings. Most names generated by the interpreter are now
24338automatically interned, and there's a new built-in function intern(s)
24339that returns the interned version of a string. Interned strings are
24340not a different object type, and interning is totally optional, but by
24341interning most keys a speedup of about 15% was obtained for the
24342pystone benchmark.
24343
24344- Dictionary objects have several new methods; clear() and copy() have
24345the obvious semantics, while update(d) merges the contents of another
24346dictionary d into this one, overriding existing keys. The dictionary
24347implementation file is now called dictobject.c rather than the
24348confusing mappingobject.c.
24349
24350- The intrinsic function dir() is much smarter; it looks in __dict__,
24351__members__ and __methods__.
24352
24353- The intrinsic functions int(), long() and float() can now take a
24354string argument and then do the same thing as string.atoi(),
24355string.atol(), and string.atof(). No second 'base' argument is
24356allowed, and complex() does not take a string (nobody cared enough).
24357
24358- When a module is deleted, its globals are now deleted in two phases.
24359In the first phase, all variables whose name begins with exactly one
24360underscore are replaced by None; in the second phase, all variables
24361are deleted. This makes it possible to have global objects whose
24362destructors depend on other globals. The deletion order within each
24363phase is still random.
24364
24365- It is no longer an error for a function to be called without a
24366global variable __builtins__ -- an empty directory will be provided
24367by default.
24368
24369- Guido's corollary to the "Don Beaudry hook": it is now possible to
24370do metaprogramming by using an instance as a base class. Not for the
24371faint of heart; and undocumented as yet, but basically if a base class
24372is an instance, its class will be instantiated to create the new
24373class. Jim Fulton will love it -- it also works with instances of his
24374"extension classes", since it is triggered by the presence of a
24375__class__ attribute on the purported base class. See
24376Demo/metaclasses/index.html for an explanation and see that directory
24377for examples.
24378
24379- Another change is that the Don Beaudry hook is now invoked when
24380*any* base class is special. (Up to 1.5a3, the *last* special base
24381class is used; in 1.5a4, the more rational choice of the *first*
24382special base class is used.)
24383
24384- New optional parameter to the readlines() method of file objects.
24385This indicates the number of bytes to read (the actual number of bytes
24386read will be somewhat larger due to buffering reading until the end of
24387the line). Some optimizations have also been made to speed it up (but
24388not as much as read()).
24389
24390- Complex numbers no longer have the ".conj" pseudo attribute; use
24391z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
24392now *do* support the __members__ and __methods__ special attributes.
24393
24394- The complex() function now looks for a __complex__() method on class
24395instances before giving up.
24396
24397- Long integers now support arbitrary shift counts, so you can now
24398write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
24399shift count for this.)
24400
24401- The hex() and oct() functions have been changed so that for regular
24402integers, they never emit a minus sign. For example, on a 32-bit
24403machine, oct(-1) now returns '037777777777' and hex(-1) returns
24404'0xffffffff'. While this may seem inconsistent, it is much more
24405useful. (For long integers, a minus sign is used as before, to fit
24406the result in memory :-)
24407
24408- The hash() function computes better hashes for several data types,
24409including strings, floating point numbers, and complex numbers.
24410
24411
24412New extension modules
24413---------------------
24414
24415- New extension modules cStringIO.c and cPickle.c, written by Jim
24416Fulton and other folks at Digital Creations. These are much more
24417efficient than their Python counterparts StringIO.py and pickle.py,
24418but don't support subclassing. cPickle.c clocks up to 1000 times
24419faster than pickle.py; cStringIO.c's improvement is less dramatic but
24420still significant.
24421
24422- New extension module zlibmodule.c, interfacing to the free zlib
24423library (gzip compatible compression). There's also a module gzip.py
24424which provides a higher level interface. Written by Andrew Kuchling
24425and Jeremy Hylton.
24426
24427- New module readline; see the "miscellaneous" section above.
24428
24429- New Unix extension module resource.c, by Jeremy Hylton, provides
24430access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
24431related symbolic constants.
24432
24433- New extension puremodule.c, by Barry Warsaw, which interfaces to the
24434Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
24435possible to enable Purify by simply setting the PURIFY Makefile
24436variable in the Modules/Setup file.
24437
24438
24439Changes in extension modules
24440----------------------------
24441
24442- The struct extension module has several new features to control byte
24443order and word size. It supports reading and writing IEEE floats even
24444on platforms where this is not the native format. It uses uppercase
24445format codes for unsigned integers of various sizes (always using
24446Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
24447and 'p' for "Pascal strings" (with a leading length byte, included in
24448the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
24449big-endian data and '<' forces little-endian data; these also select
24450standard data sizes and disable automatic alignment (use pad bytes as
24451needed).
24452
24453- The array module supports uppercase format codes for unsigned data
24454formats (like the struct module).
24455
24456- The fcntl extension module now exports the needed symbolic
24457constants. (Formerly these were in FCNTL.py which was not available
24458or correct for all platforms.)
24459
24460- The extension modules dbm, gdbm and bsddb now check that the
24461database is still open before making any new calls.
24462
24463- The dbhash module is no more. Use bsddb instead. (There's a third
24464party interface for the BSD 2.x code somewhere on the web; support for
24465bsddb will be deprecated.)
24466
24467- The gdbm module now supports a sync() method.
24468
24469- The socket module now has some new functions: getprotobyname(), and
24470the set {ntoh,hton}{s,l}().
24471
24472- Various modules now export their type object: socket.SocketType,
24473array.ArrayType.
24474
24475- The socket module's accept() method now returns unknown addresses as
24476a tuple rather than raising an exception. (This can happen in
24477promiscuous mode.) Theres' also a new function getprotobyname().
24478
24479- The pthread support for the thread module now works on most platforms.
24480
24481- STDWIN is now officially obsolete. Support for it will eventually
24482be removed from the distribution.
24483
24484- The binascii extension module is now hopefully fully debugged.
24485(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
24486received.)
24487
24488- audioop.c: added a ratecv() function; better handling of overflow in
24489add().
24490
24491- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
24492Windows, also O_TEXT and O_BINARY. The 'error' variable (the
24493exception is raises) is renamed -- its string value is now "os.error",
24494so newbies don't believe they have to import posix (or nt) to catch
24495it when they see os.error reported as posix.error. The execve()
24496function now accepts any mapping object for the environment.
24497
24498- A new version of the al (audio library) module for SGI was
24499contributed by Sjoerd Mullender.
24500
24501- The regex module has a new function get_syntax() which retrieves the
24502syntax setting set by set_syntax(). The code was also sanitized,
24503removing worries about unclean error handling. See also below for its
24504successor, re.py.
24505
24506- The "new" module (which creates new objects of various types) once
24507again has a fully functioning new.function() method. Dangerous as
24508ever! Also, new.code() has several new arguments.
24509
24510- A problem has been fixed in the rotor module: on systems with signed
24511characters, rotor-encoded data was not portable when the key contained
245128-bit characters. Also, setkey() now requires its argument rather
24513than having broken code to default it.
24514
24515- The sys.builtin_module_names variable is now a tuple. Another new
24516variables in sys is sys.executable (the full path to the Python
24517binary, if known).
24518
24519- The specs for time.strftime() have undergone some revisions. It
24520appears that not all format characters are supported in the same way
24521on all platforms. Rather than reimplement it, we note these
24522differences in the documentation, and emphasize the shared set of
24523features. There's also a thorough test set (that occasionally finds
24524problems in the C library implementation, e.g. on some Linuxes),
24525thanks to Skip Montanaro.
24526
24527- The nis module seems broken when used with NIS+; unfortunately
24528nobody knows how to fix it. It should still work with old NIS.
24529
24530
24531New library modules
24532-------------------
24533
24534- New (still experimental) Perl-style regular expression module,
24535re.py, which uses a new interface for matching as well as a new
24536syntax; the new interface avoids the thread-unsafety of the regex
24537interface. This comes with a helper extension reopmodule.c and vastly
24538rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
24539Peters, and Andrew Kuchling. See the documentation libre.tex. In
245401.5, the old regex module is still fully supported; in the future, it
24541will become obsolete.
24542
24543- New module gzip.py; see zlib above.
24544
24545- New module keyword.py exports knowledge about Python's built-in
24546keywords. (New version by Ka-Ping Yee.)
24547
24548- New module pprint.py (with documentation) which supports
24549pretty-printing of lists, tuples, & dictionaries recursively. By Fred
24550Drake.
24551
24552- New module code.py. The function code.compile_command() can
24553determine whether an interactively entered command is complete or not,
24554distinguishing incomplete from invalid input. (XXX Unfortunately,
24555this seems broken at this moment, and I don't have the time to fix
24556it. It's probably better to add an explicit interface to the parser
24557for this.)
24558
24559- There is now a library module xdrlib.py which can read and write the
24560XDR data format as used by Sun RPC, for example. It uses the struct
24561module.
24562
24563
24564Changes in library modules
24565--------------------------
24566
24567- Module codehack.py is now completely obsolete.
24568
24569- The pickle.py module has been updated to make it compatible with the
24570new binary format that cPickle.c produces. By default it produces the
24571old all-ASCII format compatible with the old pickle.py, still much
24572faster than pickle.py; it will read both formats automatically. A few
24573other updates have been made.
24574
24575- A new helper module, copy_reg.py, is provided to register extensions
24576to the pickling code.
24577
24578- Revamped module tokenize.py is much more accurate and has an
24579interface that makes it a breeze to write code to colorize Python
24580source code. Contributed by Ka-Ping Yee.
24581
24582- In ihooks.py, ModuleLoader.load_module() now closes the file under
24583all circumstances.
24584
24585- The tempfile.py module has a new class, TemporaryFile, which creates
24586an open temporary file that will be deleted automatically when
24587closed. This works on Windows and MacOS as well as on Unix. (Jim
24588Fulton.)
24589
24590- Changes to the cgi.py module: Most imports are now done at the
24591top of the module, which provides a speedup when using ni (Jim
24592Fulton). The problem with file upload to a Windows platform is solved
24593by using the new tempfile.TemporaryFile class; temporary files are now
24594always opened in binary mode (Jim Fulton). The cgi.escape() function
24595now takes an optional flag argument that quotes '"' to '&quot;'. It
24596is now possible to invoke cgi.py from a command line script, to test
24597cgi scripts more easily outside an http server. There's an optional
24598limit to the size of uploads to POST (Skip Montanaro). Added a
24599'strict_parsing' option to all parsing functions (Jim Fulton). The
24600function parse_qs() now uses urllib.unquote() on the name as well as
24601the value of fields (Clarence Gardner). The FieldStorage class now
24602has a __len__() method.
24603
24604- httplib.py: the socket object is no longer closed; all HTTP/1.*
24605responses are now accepted; and it is now thread-safe (by not using
24606the regex module).
24607
24608- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
24609
24610- The popen2.py module is now rewritten using a class, which makes
24611access to the standard error stream and the process id of the
24612subprocess possible.
24613
24614- Added timezone support to the rfc822.py module, in the form of a
24615getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
24616Also added recognition of some non-standard date formats, by Lars
24617Wirzenius, and RFC 850 dates (Chris Lawrence).
24618
24619- mhlib.py: various enhancements, including almost compatible parsing
24620of message sequence specifiers without invoking a subprocess. Also
24621added a createmessage() method by Lars Wirzenius.
24622
Victor Stinner554fd082014-03-17 22:33:49 +010024623- The StringIO.StringIO class now supports readline(nbytes). (Lars
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024624Wirzenius.) (Of course, you should be using cStringIO for performance.)
24625
24626- UserDict.py supports the new dictionary methods as well.
24627
24628- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
24629speed it up, and replace 0 seed values by 1 to avoid degeneration.
24630A bug was fixed in the test for invalid arguments.
24631
24632- Module ftplib.py: added support for parsing a .netrc file (Fred
24633Drake). Also added an ntransfercmd() method to the FTP class, which
24634allows access to the expected size of a transfer when available, and a
24635parse150() function to the module which parses the corresponding 150
24636response.
24637
24638- urllib.py: the ftp cache is now limited to 10 entries. Added
24639quote_plus() and unquote_plus() functions which are like quote() and
24640unquote() but also replace spaces with '+' or vice versa, for
24641encoding/decoding CGI form arguments. Catch all errors from the ftp
24642module. HTTP requests now add the Host: header line. The proxy
24643variable names are now mapped to lower case, for Windows. The
24644spliturl() function no longer erroneously throws away all data past
24645the first newline. The basejoin() function now intereprets "../"
24646correctly. I *believe* that the problems with "exception raised in
24647__del__" under certain circumstances have been fixed (mostly by
24648changes elsewher in the interpreter).
24649
24650- In urlparse.py, there is a cache for results in urlparse.urlparse();
24651its size limit is set to 20. Also, new URL schemes shttp, https, and
24652snews are "supported".
24653
24654- shelve.py: use cPickle and cStringIO when available. Also added
24655a sync() method, which calls the database's sync() method if there is
24656one.
24657
24658- The mimetools.py module now uses the available Python modules for
24659decoding quoted-printable, uuencode and base64 formats, rather than
24660creating a subprocess.
24661
24662- The python debugger (pdb.py, and its base class bdb.py) now support
24663conditional breakpoints. See the docs.
24664
24665- The modules base64.py, uu.py and quopri.py can now be used as simple
24666command line utilities.
24667
24668- Various small fixes to the nntplib.py module that I can't bother to
24669document in detail.
24670
Victor Stinner554fd082014-03-17 22:33:49 +010024671- Sjoerd Mullender's mimify.py module now supports base64 encoding and
24672includes functions to handle the funny encoding you sometimes see in mail
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024673headers. It is now documented.
24674
24675- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
24676gotten from the environment.
24677
24678- Many more modules now correctly open files in binary mode when this
24679is necessary on non-Unix platforms.
24680
24681- The copying functions in the undocumented module shutil.py are
24682smarter.
24683
24684- The Writer classes in the formatter.py module now have a flush()
24685method.
24686
24687- The sgmllib.py module accepts hyphens and periods in the middle of
24688attribute names. While this is against the SGML standard, there is
24689some HTML out there that uses this...
24690
24691- The interface for the Python bytecode disassembler module, dis.py,
24692has been enhanced quite a bit. There's now one main function,
24693dis.dis(), which takes almost any kind of object (function, module,
24694class, instance, method, code object) and disassembles it; without
24695arguments it disassembles the last frame of the last traceback. The
24696other functions have changed slightly, too.
24697
24698- The imghdr.py module recognizes new image types: BMP, PNG.
24699
24700- The string.py module has a new function replace(str, old, new,
24701[maxsplit]) which does substring replacements. It is actually
24702implemented in C in the strop module. The functions [r]find() an
24703[r]index() have an optional 4th argument indicating the end of the
24704substring to search, alsoo implemented by their strop counterparts.
24705(Remember, never import strop -- import string uses strop when
24706available with zero overhead.)
24707
24708- The string.join() function now accepts any sequence argument, not
24709just lists and tuples.
24710
24711- The string.maketrans() requires its first two arguments to be
24712present. The old version didn't require them, but there's not much
24713point without them, and the documentation suggests that they are
24714required, so we fixed the code to match the documentation.
24715
24716- The regsub.py module has a function clear_cache(), which clears its
24717internal cache of compiled regular expressions. Also, the cache now
24718takes the current syntax setting into account. (However, this module
24719is now obsolete -- use the sub() or subn() functions or methods in the
24720re module.)
24721
24722- The undocumented module Complex.py has been removed, now that Python
24723has built-in complex numbers. A similar module remains as
24724Demo/classes/Complex.py, as an example.
24725
24726
24727Changes to the build process
24728----------------------------
24729
24730- The way GNU readline is configured is totally different. The
24731--with-readline configure option is gone. It is now an extension
24732module, which may be loaded dynamically. You must enable it (and
Thomas Wouters89f507f2006-12-13 04:49:30 +000024733specify the correct libraries to link with) in the Modules/Setup file.
Guido van Rossum439d1fa1998-12-21 21:41:14 +000024734Importing the module installs some hooks which enable command line
24735editing. When the interpreter shell is invoked interactively, it
24736attempts to import the readline module; when this fails, the default
24737input mechanism is used. The hook variables are PyOS_InputHook and
24738PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
24739ideas from William Magro.)
24740
24741- New build procedure: a single library, libpython1.5.a, is now built,
24742which contains absolutely everything except for a one-line main()
24743program (which calls Py_Main(argc, argv) to start the interpreter
24744shell). This makes life much simpler for applications that need to
24745embed Python. The serial number of the build is now included in the
24746version string (sys.version).
24747
24748- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
24749emits a single warning any more when compiling Python.
24750
24751- A number of new Makefile variables have been added for special
24752situations, e.g. LDLAST is appended to the link command. These are
24753used by editing the Makefile or passing them on the make command
24754line.
24755
24756- A set of patches from Lee Busby has been integrated that make it
24757possible to catch floating point exceptions. Use the configure option
24758--with-fpectl to enable the patches; the extension modules fpectl and
24759fpetest provide control to enable/disable and test the feature,
24760respectively.
24761
24762- The support for shared libraries under AIX is now simpler and more
24763robust. Thanks to Vladimir Marangozov for revamping his own patches!
24764
24765- The Modules/makesetup script now reads a file Setup.local as well as
24766a file Setup. Most changes to the Setup script can be done by editing
24767Setup.local instead, which makes it easier to carry a particular setup
24768over from one release to the next.
24769
24770- The Modules/makesetup script now copies any "include" lines it
24771encounters verbatim into the output Makefile. It also recognizes .cxx
24772and .cpp as C++ source files.
24773
24774- The configure script is smarter about C compiler options; e.g. with
24775gcc it uses -O2 and -g when possible, and on some other platforms it
24776uses -Olimit 1500 to avoid a warning from the optimizer about the main
24777loop in ceval.c (which has more than 1000 basic blocks).
24778
24779- The configure script now detects whether malloc(0) returns a NULL
24780pointer or a valid block (of length zero). This avoids the nonsense
24781of always adding one byte to all malloc() arguments on most platforms.
24782
24783- The configure script has a new option, --with-dec-threads, to enable
24784DEC threads on DEC Alpha platforms. Also, --with-threads is now an
24785alias for --with-thread (this was the Most Common Typo in configure
24786arguments).
24787
24788- Many changes in Doc/Makefile; amongst others, latex2html is now used
24789to generate HTML from all latex documents.
24790
24791
24792Change to the Python/C API
24793--------------------------
24794
24795- Because some interfaces have changed, the PYTHON_API macro has been
24796bumped. Most extensions built for the old API version will still run,
24797but I can't guarantee this. Python prints a warning message on
24798version mismatches; it dumps core when the version mismatch causes a
24799serious problem :-)
24800
24801- I've completed the Grand Renaming, with the help of Roger Masse and
24802Barry Warsaw. This makes reading or debugging the code much easier.
24803Many other unrelated code reorganizations have also been carried out.
24804The allobjects.h header file is gone; instead, you would have to
24805include Python.h followed by rename2.h. But you're better off running
24806Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
24807the rename2.h; it will disappear in the next release.
24808
24809- Various and sundry small bugs in the "abstract" interfaces have been
24810fixed. Thanks to all the (involuntary) testers of the Python 1.4
24811version! Some new functions have been added, e.g. PySequence_List(o),
24812equivalent to list(o) in Python.
24813
24814- New API functions PyLong_FromUnsignedLong() and
24815PyLong_AsUnsignedLong().
24816
24817- The API functions in the file cgensupport.c are no longer
24818supported. This file has been moved to Modules and is only ever
24819compiled when the SGI specific 'gl' module is built.
24820
24821- PyObject_Compare() can now raise an exception. Check with
24822PyErr_Occurred(). The comparison function in an object type may also
24823raise an exception.
24824
24825- The slice interface uses an upper bound of INT_MAX when no explicit
24826upper bound is given (e.x. for a[1:]). It used to ask the object for
24827its length and do the calculations.
24828
24829- Support for multiple independent interpreters. See Doc/api.tex,
24830functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
24831documentation is incomplete, also see the new Demo/pysvr example
24832(which shows how to use these in a threaded application) and the
24833source code.
24834
24835- There is now a Py_Finalize() function which "de-initializes"
24836Python. It is possible to completely restart the interpreter
24837repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
24838change of functionality in Py_Initialize() means that it is now a
24839fatal error to call it while the interpreter is already initialized.
24840The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
24841is deprecated (it is nothing more than Py_Finalize() followed by
24842exit()).
24843
24844- There are no known memory leaks left. While Py_Finalize() doesn't
24845free *all* allocated memory (some of it is hard to track down),
24846repeated calls to Py_Finalize() and Py_Initialize() do not create
24847unaccessible heap blocks.
24848
24849- There is now explicit per-thread state. (Inspired by, but not the
24850same as, Greg Stein's free threading patches.)
24851
24852- There is now better support for threading C applications. There are
24853now explicit APIs to manipulate the interpreter lock. Read the source
24854or the Demo/pysvr example; the new functions are
24855PyEval_{Acquire,Release}{Lock,Thread}().
24856
24857- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
24858with other libraries' DEBUG macros. Likewise for any other test
24859macros that didn't yet start with Py_.
24860
24861- New wrappers around malloc() and friends: Py_Malloc() etc. call
24862malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
24863just malloc(). Use of these wrappers could be essential if multiple
24864memory allocators exist (e.g. when using certain DLL setups under
24865Windows). (Idea by Jim Fulton.)
24866
24867- New C API PyImport_Import() which uses whatever __import__() hook
24868that is installed for the current execution environment. By Jim
24869Fulton.
24870
24871- It is now possible for an extension module's init function to fail
24872non-fatally, by calling one of the PyErr_* functions and returning.
24873
24874- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
24875argument to the proper type, like the similar PyString macros already
24876did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
24877and PyList_GET_ITEM.
24878
24879- Some of the Py_Get* function, like Py_GetVersion() (but not yet
24880Py_GetPath()) are now declared as returning a const char *. (More
24881should follow.)
24882
24883- Changed the run-time library to check for exceptions after object
24884comparisons. PyObject_Compare() can now return an exception; use
24885PyErr_Occurred() to check (there is *no* special return value).
24886
24887- PyFile_WriteString() and Py_Flushline() now return error indicators
24888instead of clearing exceptions. This fixes an obscure bug where using
24889these would clear a pending exception, discovered by Just van Rossum.
24890
24891- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
24892an argument list including keyword arguments. Contributed by Geoff
24893Philbrick.
24894
24895- PyArg_GetInt() is gone.
24896
24897- It's no longer necessary to include graminit.h when calling one of
24898the extended parser API functions. The three public grammar start
24899symbols are now in Python.h as Py_single_input, Py_file_input, and
24900Py_eval_input.
24901
24902- The CObject interface has a new function,
24903PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
24904on the object referenced by "module.name".
24905
24906
24907Tkinter
24908-------
24909
24910- On popular demand, _tkinter once again installs a hook for readline
24911that processes certain Tk events while waiting for the user to type
24912(using PyOS_InputHook).
24913
24914- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
24915caused by command definitions referencing widget objects beyond their
24916lifetime.
24917
24918- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
24919tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
24920with the new Tk dialog scripts, and provide more "native platform"
24921style file selection dialog boxes on some platforms. Contributed by
24922Fredrik Lundh.
24923
24924- Tkinter.py: when the first Tk object is destroyed, it sets the
24925hiddel global _default_root to None, so that when another Tk object is
24926created it becomes the new default root. Other miscellaneous
24927changes and fixes.
24928
24929- The Image class now has a configure method.
24930
24931- Added a bunch of new winfo options to Tkinter.py; we should now be
24932up to date with Tk 4.2. The new winfo options supported are:
24933mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
24934visualsavailable.
24935
24936- The broken bind() method on Canvas objects defined in the Canvas.py
24937module has been fixed. The CanvasItem and Group classes now also have
24938an unbind() method.
24939
24940- The problem with Tkinter.py falling back to trying to import
24941"tkinter" when "_tkinter" is not found has been fixed -- it no longer
24942tries "tkinter", ever. This makes diagnosing the problem "_tkinter
24943not configured" much easier and will hopefully reduce the newsgroup
24944traffic on this topic.
24945
24946- The ScrolledText module once again supports the 'cnf' parameter, to
24947be compatible with the examples in Mark Lutz' book (I know, I know,
24948too late...)
24949
24950- The _tkinter.c extension module has been revamped. It now support
24951Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
24952works well under Windows and Mac (with the latest Tk ports to those
24953platforms). It also supports threading -- it is safe for one
24954(Python-created) thread to be blocked in _tkinter.mainloop() while
24955other threads modify widgets. To make the changes visible, those
24956threads must use update_idletasks()method. (The patch for threading
24957in 1.5a3 was broken; in 1.5a4, it is back in a different version,
24958which requires access to the Tcl sources to get it to work -- hence it
24959is disabled by default.)
24960
24961- A bug in _tkinter.c has been fixed, where Split() with a string
24962containing an unmatched '"' could cause an exception or core dump.
24963
24964- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
24965CreateFileHandler, so _tkinter.createfilehandler is not available on
24966those platforms when using Tk 8.0 or later. I will have to rethink
24967how to interface with Tcl's lower-level event mechanism, or with its
24968channels (which are like Python's file-like objects). Jack Jansen has
24969provided a fix for the Mac, so createfilehandler *is* actually
24970supported there; maybe I can adapt his fix for Windows.
24971
24972
24973Tools and Demos
24974---------------
24975
24976- A new regression test suite is provided, which tests most of the
24977standard and built-in modules. The regression test is run by invoking
24978the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
24979he and Roger Masse contributed most of the new tests.
24980
24981- New tool: faqwiz -- the CGI script that is used to maintain the
24982Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
24983Tools/faqwiz.
24984
24985- New tool: webchecker -- a simple extensible web robot that, when
24986aimed at a web server, checks that server for dead links. Available
24987are a command line utility as well as a Tkinter based GUI version. In
24988Tools/webchecker. A simplified version of this program is dissected
24989in my article in O'Reilly's WWW Journal, the issue on Scripting
24990Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
24991Includes a parser for robots.txt files by Skip Montanaro.
24992
24993- New small tools: cvsfiles.py (prints a list of all files under CVS
24994n a particular directory tree), treesync.py (a rather Guido-specific
24995script to synchronize two source trees, one on Windows NT, the other
24996one on Unix under CVS but accessible from the NT box), and logmerge.py
24997(sort a collection of RCS or CVS logs by date). In Tools/scripts.
24998
24999- The freeze script now also works under Windows (NT). Another
25000feature allows the -p option to be pointed at the Python source tree
25001instead of the installation prefix. This was loosely based on part of
25002xfreeze by Sam Rushing and Bill Tutt.
25003
25004- New examples (Demo/extend) that show how to use the generic
25005extension makefile (Misc/Makefile.pre.in).
25006
25007- Tools/scripts/h2py.py now supports C++ comments.
25008
25009- Tools/scripts/pystone.py script is upgraded to version 1.1; there
25010was a bug in version 1.0 (distributed with Python 1.4) that leaked
25011memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
25012
25013- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
25014
25015
25016Windows (NT and 95)
25017-------------------
25018
25019- New project files for Developer Studio (Visual C++) 5.0 for Windows
25020NT (the old VC++ 4.2 Makefile is also still supported, but will
25021eventually be withdrawn due to its bulkiness).
25022
Victor Stinner554fd082014-03-17 22:33:49 +010025023- See the note on the new module search path in the "Miscellaneous" section
Guido van Rossum439d1fa1998-12-21 21:41:14 +000025024above.
25025
25026- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
25027basically withdrawn. If it still works for you, you're lucky.
25028
Victor Stinner554fd082014-03-17 22:33:49 +010025029- There's a new extension module, msvcrt.c, which provides various
25030low-level operations defined in the Microsoft Visual C++ Runtime Library.
25031These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
Guido van Rossum439d1fa1998-12-21 21:41:14 +000025032console I/O functions like kbhit(), getch() and putch().
25033
25034- The -u option not only sets the standard I/O streams to unbuffered
25035status, but also sets them in binary mode. (This can also be done
25036using msvcrt.setmode(), by the way.)
25037
Victor Stinner554fd082014-03-17 22:33:49 +010025038- The, sys.prefix and sys.exec_prefix variables point to the directory
25039where Python is installed, or to the top of the source tree, if it was run
Guido van Rossum439d1fa1998-12-21 21:41:14 +000025040from there.
25041
25042- The various os.path modules (posixpath, ntpath, macpath) now support
25043passing more than two arguments to the join() function, so
25044os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
25045c)).
25046
Victor Stinner554fd082014-03-17 22:33:49 +010025047- The ntpath module (normally used as os.path) supports ~ to $HOME
Guido van Rossum439d1fa1998-12-21 21:41:14 +000025048expansion in expanduser().
25049
25050- The freeze tool now works on Windows.
25051
25052- See also the Tkinter category for a sad note on
25053_tkinter.createfilehandler().
25054
25055- The truncate() method for file objects now works on Windows.
25056
25057- Py_Initialize() is no longer called when the DLL is loaded. You
25058must call it yourself.
25059
25060- The time module's clock() function now has good precision through
25061the use of the Win32 API QueryPerformanceCounter().
25062
25063- Mark Hammond will release Python 1.5 versions of PythonWin and his
25064other Windows specific code: the win32api extensions, COM/ActiveX
25065support, and the MFC interface.
25066
25067
25068Mac
25069---
25070
25071- As always, the Macintosh port will be done by Jack Jansen. He will
25072make a separate announcement for the Mac specific source code and the
25073binary distribution(s) when these are ready.
25074
25075
25076======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +000025077
Guido van Rossumaa253861994-10-06 17:18:57 +000025078
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025079=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +000025080==> Release 1.4 (October 25 1996) <==
25081=====================================
25082
25083(Starting in reverse chronological order:)
25084
25085- Changed disclaimer notice.
25086
25087- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
25088default to the user's login shell.
25089
25090- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
25091widget, and bogus bspace() function.
25092
25093- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
25094paragraph.
25095
25096- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
25097subprojects, and to remove the (broken) experimental NumPy
25098subprojects.
25099
25100- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
25101(where os.stat() returns mtimes as floats.)
25102- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
25103fix POST in CGIHTTPServer.py.
25104
25105- Version 2.83 of Misc/python-mode.el for Emacs is included.
25106
25107- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
25108group starting immediately after a group tag.
25109
25110- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
25111
25112- In Objects/stringobject.c, fixed the compare function to do the
25113first char comparison in unsigned mode, for consistency with the way
25114other characters are compared by memcmp().
25115
25116- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
25117
25118- In Lib/urllib.py, fix another case where openedurl wasn't set.
25119
25120(XXX Sorry, the rest is in totally random order. No time to fix it.)
25121
25122- SyntaxError exceptions detected during code generation
25123(e.g. assignment to an expression) now include a line number.
25124
25125- Don't leave trailing / or \ in script directory inserted in front of
25126sys.path.
25127
25128- Added a note to Tools/scripts/classfix.py abouts its historical
25129importance.
25130
25131- Added Misc/Makefile.pre.in, a universal Makefile for extensions
25132built outside the distribution.
25133
25134- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
25135
25136- Install shared modules with mode 555 (needed for performance on some
25137platforms).
25138
25139- Some changes to standard library modules to avoid calling append()
25140with more than one argument -- while supported, this should be
25141outlawed, and I don't want to set a bad example.
25142
25143- bdb.py (and hence pdb.py) supports calling run() with a code object
25144instead of a code string.
25145
25146- Fixed an embarrassing bug cgi.py which prevented correct uploading
25147of binary files from Netscape (which doesn't distinguish between
25148binary and text files). Also added dormant logging support, which
25149makes it easier to debug the cgi module itself.
25150
25151- Added default writer to constructor of NullFormatter class.
25152
25153- Use binary mode for socket.makefile() calls in ftplib.py.
25154
25155- The ihooks module no longer "installs" itself upon import -- this
25156was an experimental feature that helped ironing out some bugs but that
25157slowed down code that imported it without the need to install it
25158(e.g. the rexec module). Also close the file in some cases and add
25159the __file__ attribute to loaded modules.
25160
25161- The test program for mailbox.py is now more useful.
25162
25163- Added getparamnames() to Message class in mimetools.py -- it returns
25164the names of parameters to the content-type header.
25165
25166- Fixed a typo in ni that broke the loop stripping "__." from names.
25167
25168- Fix sys.path[0] for scripts run via pdb.py's new main program.
25169
25170- profile.py can now also run a script, like pdb.
25171
25172- Fix a small bug in pyclbr -- don't add names starting with _ when
25173emulating from ... import *.
25174
25175- Fixed a series of embarrassing typos in rexec's handling of standard
25176I/O redirection. Added some more "safe" built-in modules: cmath,
25177errno, operator.
25178
25179- Fixed embarrassing typo in shelve.py.
25180
25181- Added SliceType and EllipsisType to types.py.
25182
25183- In urllib.py, added handling for error 301 (same as 302); added
25184geturl() method to get the URL after redirection.
25185
25186- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
25187for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
25188
25189- Fixed bsddbmodule.c to add binary mode indicator on platforms that
25190have it. This should make it working on Windows NT.
25191
25192- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
25193whatever applies. Also rationalized some other tests for various MS
25194platforms.
25195
25196- Added the sources for the NT installer script used for Python
251971.4beta3. Not tested with this release, but better than nothing.
25198
25199- A compromise in pickle's defenses against Trojan horses: a
25200user-defined function is now okay where a class is expected. A
25201built-in function is not okay, to prevent pickling something that
25202will execute os.system("rm -f *") when unpickling.
25203
25204- dis.py will print the name of local variables referenced by local
25205load/store/delete instructions.
25206
25207- Improved portability of SimpleHTTPServer module to non-Unix
25208platform.
25209
25210- The thread.h interface adds an extra argument to down_sema(). This
25211only affects other C code that uses thread.c; the Python thread module
25212doesn't use semaphores (which aren't provided on all platforms where
25213Python threads are supported). Note: on NT, this change is not
25214implemented.
25215
25216- Fixed some typos in abstract.h; corrected signature of
25217PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
25218abstract.c's PyObject_CallMethod().
25219
25220- apply(classname, (), {}) now works even if the class has no
25221__init__() method.
25222
25223- Implemented complex remainder and divmod() (these would dump core!).
25224Conversion of complex numbers to int, long int or float now raises an
25225exception, since there is no meaningful way to do it without losing
25226information.
25227
25228- Fixed bug in built-in complex() function which gave the wrong result
25229for two real arguments.
25230
25231- Change the hash algorithm for strings -- the multiplier is now
252321000003 instead of 3, which gives better spread for short strings.
25233
25234- New default path for Windows NT, the registry structure now supports
25235default paths for different install packages. (Mark Hammond -- the
25236next PythonWin release will use this.)
25237
25238- Added more symbols to the python_nt.def file.
25239
25240- When using GNU readline, set rl_readline_name to "python".
25241
25242- The Ellipses built-in name has been renamed to Ellipsis -- this is
25243the correct singular form. Thanks to Ka-Ping Yee, who saved us from
25244eternal embarrassment.
25245
25246- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
25247Ellipsis name change.
25248
25249- Updated the library reference manual. Added documentation of
25250restricted mode (rexec, Bastion) and the formatter module (for use
25251with the htmllib module). Fixed the documentation of htmllib
25252(finally).
25253
25254- The reference manual is now maintained in FrameMaker.
25255
25256- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
25257
25258- Slight improvements to Doc/Makefile.
25259
25260- Added fcntl.lockf(). This should be used for Unix file locking
25261instead of the posixfile module; lockf() is more portable.
25262
25263- The getopt module now supports long option names, thanks to Lars
25264Wizenius.
25265
25266- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
25267and Nils Fischbeck.
25268
25269- Use more bits of time.time() in whrandom's default seed().
25270
25271- Performance hack for regex module's regs attribute.
25272
25273- Don't close already closed socket in socket module.
25274
25275- Correctly handle separators containing embedded nulls in
25276strop.split, strop.find and strop.rfind. Also added more detail to
25277error message for strop.atoi and friends.
25278
25279- Moved fallback definition for hypot() to Python/hypot.c.
25280
25281- Added fallback definition for strdup, in Python/strdup.c.
25282
25283- Fixed some bugs where a function would return 0 to indicate an error
25284where it should return -1.
25285
25286- Test for error returned by time.localtime(), and rationalized its MS
25287tests.
25288
25289- Added Modules/Setup.local file, which is processed after Setup.
25290
25291- Corrected bug in toplevel Makefile.in -- execution of regen script
25292would not use the right PATH and PYTHONPATH.
25293
25294- Various and sundry NeXT configuration changes (sigh).
25295
25296- Support systems where libreadline needs neither termcap nor curses.
25297
25298- Improved ld_so_aix script and python.exp file (for AIX).
25299
25300- More stringent test for working <stdarg.h> in configure script.
25301
25302- Removed Demo/www subdirectory -- it was totally out of date.
25303
25304- Improved demos and docs for Fred Drake's parser module; fixed one
25305typo in the module itself.
25306
25307
25308=========================================
25309==> Release 1.4beta3 (August 26 1996) <==
25310=========================================
25311
25312
25313(XXX This is less readable that it should. I promise to restructure
25314it for the final 1.4 release.)
25315
25316
25317What's new in 1.4beta3 (since beta2)?
25318-------------------------------------
25319
25320- Name mangling to implement a simple form of class-private variables.
25321A name of the form "__spam" can't easily be used outside the class.
25322(This was added in 1.4beta3, but left out of the 1.4beta3 release
25323message.)
25324
25325- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
25326handled correctly when using a proxy server.
25327
25328- In ntpath.normpath(): don't truncate to 8+3 format.
25329
25330- In mimetools.choose_boundary(): don't die when getuid() or getpid()
25331aren't defined.
25332
25333- Module urllib: some optimizations to (un)quoting.
25334
25335- New module MimeWriter for writing MIME documents.
25336
25337- More changes to formatter module.
25338
25339- The freeze script works once again and is much more robust (using
25340sys.prefix etc.). It also supports a -o option to specify an
25341output directory.
25342
25343- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
25344
Victor Stinner554fd082014-03-17 22:33:49 +010025345- The Doc/Makefile targets have been reorganized somewhat to remove the
Guido van Rossum821a5581997-05-23 04:05:31 +000025346insistence on always generating PostScript.
25347
25348- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
25349
Victor Stinner554fd082014-03-17 22:33:49 +010025350- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
Guido van Rossum821a5581997-05-23 04:05:31 +000025351name conflict on the Mac.
25352
Victor Stinner554fd082014-03-17 22:33:49 +010025353- Linking a module compiled with a different setting for Py_TRACE_REFS now
Guido van Rossum821a5581997-05-23 04:05:31 +000025354generates a linker error rather than a core dump.
25355
Victor Stinner554fd082014-03-17 22:33:49 +010025356- The cgi module has a new convenience function print_exception(), which
25357formats a python exception using HTML. It also fixes a bug in the
25358compatibility code and adds a dubious feature which makes it possible to
Guido van Rossum821a5581997-05-23 04:05:31 +000025359have two query strings, one in the URL and one in the POST data.
25360
Victor Stinner554fd082014-03-17 22:33:49 +010025361- A subtle change in the unpickling of class instances makes it possible
25362to unpickle in restricted execution mode, where the __dict__ attribute is
Guido van Rossum821a5581997-05-23 04:05:31 +000025363not available (but setattr() is).
25364
Victor Stinner554fd082014-03-17 22:33:49 +010025365- Documentation for os.path.splitext() (== posixpath.splitext()) has been
Guido van Rossum821a5581997-05-23 04:05:31 +000025366cleared up. It splits at the *last* dot.
25367
25368- posixfile locking is now also correctly supported on AIX.
25369
Victor Stinner554fd082014-03-17 22:33:49 +010025370- The tempfile module once again honors an initial setting of tmpdir. It
Guido van Rossum821a5581997-05-23 04:05:31 +000025371now works on Windows, too.
25372
Victor Stinner554fd082014-03-17 22:33:49 +010025373- The traceback module has some new functions to extract, format and print
Guido van Rossum821a5581997-05-23 04:05:31 +000025374the active stack.
25375
Victor Stinner554fd082014-03-17 22:33:49 +010025376- Some translation functions in the urllib module have been made a little
Guido van Rossum821a5581997-05-23 04:05:31 +000025377less sluggish.
25378
Victor Stinner554fd082014-03-17 22:33:49 +010025379- The addtag_* methods for Canvas widgets in Tkinter as well as in the
25380separate Canvas class have been fixed so they actually do something
Guido van Rossum821a5581997-05-23 04:05:31 +000025381meaningful.
25382
25383- A tiny _test() function has been added to Tkinter.py.
25384
Victor Stinner554fd082014-03-17 22:33:49 +010025385- A generic Makefile for dynamically loaded modules is provided in the Misc
Guido van Rossum821a5581997-05-23 04:05:31 +000025386subdirectory (Misc/gMakefile).
25387
25388- A new version of python-mode.el for Emacs is provided. See
25389http://www.python.org/ftp/emacs/pmdetails.html for details. The
25390separate file pyimenu.el is no longer needed, imenu support is folded
25391into python-mode.el.
25392
Victor Stinner554fd082014-03-17 22:33:49 +010025393- The configure script can finally correctly find the readline library in a
25394non-standard location. The LDFLAGS variable is passed on the Makefiles
Guido van Rossum821a5581997-05-23 04:05:31 +000025395from the configure script.
25396
Victor Stinner554fd082014-03-17 22:33:49 +010025397- Shared libraries are now installed as programs (i.e. with executable
Guido van Rossum821a5581997-05-23 04:05:31 +000025398permission). This is required on HP-UX and won't hurt on other systems.
25399
Victor Stinner554fd082014-03-17 22:33:49 +010025400- The objc.c module is no longer part of the distribution. Objective-C
Guido van Rossum821a5581997-05-23 04:05:31 +000025401support may become available as contributed software on the ftp site.
25402
25403- The sybase module is no longer part of the distribution. A much
25404improved sybase module is available as contributed software from the
25405ftp site.
25406
Victor Stinner554fd082014-03-17 22:33:49 +010025407- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
25408Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
Guido van Rossum821a5581997-05-23 04:05:31 +000025409now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
25410
Victor Stinner554fd082014-03-17 22:33:49 +010025411- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
Guido van Rossum821a5581997-05-23 04:05:31 +000025412can use *.so and *.sl as shared libraries.
25413
25414- Some more fidgeting for AIX shared libraries.
25415
25416- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
25417(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
25418available from the contrib directory on the ftp site.)
25419
Victor Stinner554fd082014-03-17 22:33:49 +010025420- A warning is written to sys.stderr when a __del__ method raises an
Guido van Rossum821a5581997-05-23 04:05:31 +000025421exception (formerly, such exceptions were completely ignored).
25422
Victor Stinner554fd082014-03-17 22:33:49 +010025423- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
Guido van Rossum821a5581997-05-23 04:05:31 +000025424incapable of ANSI style token concatenation and stringification.
25425
Victor Stinner554fd082014-03-17 22:33:49 +010025426- All source files (except a few platform specific modules) are once again
Guido van Rossum821a5581997-05-23 04:05:31 +000025427compatible with K&R C compilers as well as ANSI compilers. In particular,
Victor Stinner554fd082014-03-17 22:33:49 +010025428ANSI-isms have been removed or made conditional in complexobject.c,
Guido van Rossum821a5581997-05-23 04:05:31 +000025429getargs.c and operator.c.
25430
Victor Stinner554fd082014-03-17 22:33:49 +010025431- The abstract object API has three new functions, PyObject_DelItem,
Guido van Rossum821a5581997-05-23 04:05:31 +000025432PySequence_DelItem, and PySequence_DelSlice.
25433
Victor Stinner554fd082014-03-17 22:33:49 +010025434- The operator module has new functions delitem and delslice, and the
25435functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
Guido van Rossum821a5581997-05-23 04:05:31 +000025436"and" are reserved words). ("__or__" and "__and__" are unchanged.)
25437
Victor Stinner554fd082014-03-17 22:33:49 +010025438- The environment module is no longer supported; putenv() is now a function
Guido van Rossum821a5581997-05-23 04:05:31 +000025439in posixmodule (also under NT).
25440
25441- Error in filter(<function>, "") has been fixed.
25442
25443- Unrecognized keyword arguments raise TypeError, not KeyError.
25444
Victor Stinner554fd082014-03-17 22:33:49 +010025445- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
Guido van Rossum821a5581997-05-23 04:05:31 +000025446some more documentation.
25447
Victor Stinner554fd082014-03-17 22:33:49 +010025448- Bug in float power boundary case (0.0 to the negative integer power)
Guido van Rossum821a5581997-05-23 04:05:31 +000025449fixed.
25450
Victor Stinner554fd082014-03-17 22:33:49 +010025451- The test of negative number to the float power has been moved from the
Berker Peksag4882cac2015-04-14 09:30:01 +030025452built-in pow() function to floatobject.c (so complex numbers can yield the
Guido van Rossum821a5581997-05-23 04:05:31 +000025453correct result).
25454
Victor Stinner554fd082014-03-17 22:33:49 +010025455- The bug introduced in beta2 where shared libraries loaded (using
Guido van Rossum821a5581997-05-23 04:05:31 +000025456dlopen()) from the current directory would fail, has been fixed.
25457
Victor Stinner554fd082014-03-17 22:33:49 +010025458- Modules imported as shared libraries now also have a __file__ attribute,
25459giving the filename from which they were loaded. The only modules without
Guido van Rossum821a5581997-05-23 04:05:31 +000025460a __file__ attribute now are built-in modules.
25461
Victor Stinner554fd082014-03-17 22:33:49 +010025462- On the Mac, dynamically loaded modules can end in either ".slb" or
25463".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
Guido van Rossum821a5581997-05-23 04:05:31 +000025464extension should only be used for "fat" binaries.
25465
Victor Stinner554fd082014-03-17 22:33:49 +010025466- C API addition: marshal.c now supports
Guido van Rossum821a5581997-05-23 04:05:31 +000025467PyMarshal_WriteObjectToString(object).
25468
25469- C API addition: getargs.c now supports
25470PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
25471to parse keyword arguments.
25472
Victor Stinner554fd082014-03-17 22:33:49 +010025473- The PC versioning scheme (sys.winver) has changed once again. the
25474version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
25475first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
25476"1.4.1" for Python 1.4.1 -- the beta level is not included) and
Guido van Rossum821a5581997-05-23 04:05:31 +000025477<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
25478
25479- h2py.py accepts whitespace before the # in CPP directives
25480
Victor Stinner554fd082014-03-17 22:33:49 +010025481- On Solaris 2.5, it should now be possible to use either Posix threads or
25482Solaris threads (XXX: how do you select which is used???). (Note: the
25483Python pthreads interface doesn't fully support semaphores yet -- anyone
Guido van Rossum821a5581997-05-23 04:05:31 +000025484care to fix this?)
25485
Victor Stinner554fd082014-03-17 22:33:49 +010025486- Thread support should now work on AIX, using either DCE threads or
Guido van Rossum821a5581997-05-23 04:05:31 +000025487pthreads.
25488
25489- New file Demo/sockets/unicast.py
25490
Victor Stinner554fd082014-03-17 22:33:49 +010025491- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
Guido van Rossum821a5581997-05-23 04:05:31 +000025492both) (XXX)
25493
Victor Stinner554fd082014-03-17 22:33:49 +010025494- New project setup for PC port, now compatible with PythonWin, with
Guido van Rossum821a5581997-05-23 04:05:31 +000025495_tkinter and NumPy support (XXX)
25496
25497- New module site.py (XXX)
25498
25499- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
25500
25501- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
25502
25503- regen script fixed (XXX)
25504
25505- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
25506
25507- testall now also tests math module (XXX)
25508
25509- string.atoi c.s. now raise an exception for an empty input string.
25510
Victor Stinner554fd082014-03-17 22:33:49 +010025511- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
Guido van Rossum821a5581997-05-23 04:05:31 +000025512have config.h included at various places.
25513
25514- Unrecognized keyword arguments now raise TypeError rather than KeyError.
25515
25516- The makesetup script recognizes files with extension .so or .sl as
25517(shared) libraries.
25518
Victor Stinner554fd082014-03-17 22:33:49 +010025519- 'access' is no longer a reserved word, and all code related to its
25520implementation is gone (or at least #ifdef'ed out). This should make
Guido van Rossum821a5581997-05-23 04:05:31 +000025521Python a little speedier too!
25522
Victor Stinner554fd082014-03-17 22:33:49 +010025523- Performance enhancements suggested by Sjoerd Mullender. This includes
25524the introduction of two new optional function pointers in type object,
25525getattro and setattro, which are like getattr and setattr but take a
Guido van Rossum821a5581997-05-23 04:05:31 +000025526string object instead of a C string pointer.
25527
Victor Stinner554fd082014-03-17 22:33:49 +010025528- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
25529only on the left or only on the right, A new optional third argument to
25530split() specifies the maximum number of separators honored (so
25531splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
Guido van Rossum821a5581997-05-23 04:05:31 +0000255321.3, splitfields(s, None) is totally equivalent to split(s).)
Victor Stinner554fd082014-03-17 22:33:49 +010025533string.capwords() has an optional second argument specifying the
Guido van Rossum821a5581997-05-23 04:05:31 +000025534separator (which is passed to split()).
25535
Victor Stinner554fd082014-03-17 22:33:49 +010025536- regsub.split() has the same addition as string.split(). regsub.splitx(s,
25537sep, maxsep) implements the functionality that was regsub.split(s, 1) in
Guido van Rossum821a5581997-05-23 04:05:31 +0000255381.4beta2 (return a list containing the delimiters as well as the words).
25539
25540- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
25541
25542- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
25543argument to _tkinter.create() to set Tcl's argv0 variable, so X
25544resources use the right resource class again.
25545
25546- Add #undef fabs to Modules/mathmodule.c for macintosh.
25547
25548- Added some macro renames for AIX in Modules/operator.c.
25549
25550- Removed spurious 'E' from Doc/liberrno.tex.
25551
25552- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
25553Misc/gMakefile and new version of Misc/python-mode.el.
25554
25555- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
25556NameError).
25557
25558- Added missing "from types import *" to Lib/tkinter/Canvas.py.
25559
25560- Added hint about using default args for __init__ to pickle docs.
25561
25562- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
25563PySequence_Length.
25564
25565- Some improvements to Doc/texi2html.py.
25566
25567- In Python/import.c, Cast unsigned char * in struct _frozen to char *
25568in calls to rds_object().
25569
25570- In doc/ref4.tex, added note about scope of lambda bodies.
25571
25572What's new in 1.4beta2 (since beta1)?
25573-------------------------------------
25574
25575- Portability bug in the md5.h header solved.
25576
25577- The PC build procedure now really works, and sets sys.platform to a
25578meaningful value (a few things were botched in beta 1). Lib/dos_8x3
25579is now a standard part of the distribution (alas).
25580
Victor Stinner554fd082014-03-17 22:33:49 +010025581- More improvements to the installation procedure. Typing "make install"
25582now inserts the version number in the pathnames of almost everything
25583installed, and creates the machine dependent modules (FCNTL.py etc.) if not
25584supplied by the distribution. (XXX There's still a problem with the latter
25585because the "regen" script requires that Python is installed. Some manual
Guido van Rossum821a5581997-05-23 04:05:31 +000025586intervention may still be required.) (This has been fixed in 1.4beta3.)
25587
25588- New modules: errno, operator (XXX).
25589
Georg Brandl93dc9eb2010-03-14 10:56:14 +000025590- Changes for use with Numerical Python: built-in function slice() and
Guido van Rossum821a5581997-05-23 04:05:31 +000025591Ellipses object, and corresponding syntax:
25592
25593 x[lo:hi:stride] == x[slice(lo, hi, stride)]
25594 x[a, ..., z] == x[(a, Ellipses, z)]
25595
Raymond Hettinger565ea5a2004-10-02 11:02:59 +000025596- New documentation for errno and cgi modules.
Guido van Rossum821a5581997-05-23 04:05:31 +000025597
25598- The directory containing the script passed to the interpreter is
25599inserted in from of sys.path; "." is no longer a default path
25600component.
25601
25602- Optional third string argument to string.translate() specifies
25603characters to delete. New function string.maketrans() creates a
25604translation table for translate() or for regex.compile().
25605
25606- Module posix (and hence module os under Unix) now supports putenv().
25607Moreover, module os is enhanced so that if putenv() is supported,
25608assignments to os.environ entries make the appropriate putenv() call.
25609(XXX the putenv() implementation can leak a small amount of memory per
25610call.)
25611
25612- pdb.py can now be invoked from the command line to debug a script:
25613python pdb.py <script> <arg> ...
25614
25615- Much improved parseaddr() in rfc822.
25616
25617- In cgi.py, you can now pass an alternative value for environ to
25618nearly all functions.
25619
25620- You can now assign to instance variables whose name begins and ends
25621with '__'.
25622
25623- New version of Fred Drake's parser module and associates (token,
25624symbol, AST).
25625
25626- New PYTHON_API_VERSION value and .pyc file magic number (again!).
25627
25628- The "complex" internal structure type is now called "Py_complex" to
25629avoid name conflicts.
25630
25631- Numerous small bugs fixed.
25632
25633- Slight pickle speedups.
25634
25635- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
25636
25637- NeXT portability mods by Bill Bumgarner integrated.
25638
25639- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
25640converted to new naming style.
25641
25642
25643What's new in 1.4beta1 (since 1.3)?
25644-----------------------------------
25645
25646- Added sys.platform and sys.exec_platform for Bill Janssen.
25647
Victor Stinner554fd082014-03-17 22:33:49 +010025648- Installation has been completely overhauled. "make install" now installs
25649everything, not just the python binary. Installation uses the install-sh
Guido van Rossum821a5581997-05-23 04:05:31 +000025650script (borrowed from X11) to install each file.
25651
25652- New functions in the posix module: mkfifo, plock, remove (== unlink),
25653and ftruncate. More functions are also available under NT.
25654
25655- New function in the fcntl module: flock.
25656
25657- Shared library support for FreeBSD.
25658
Victor Stinner554fd082014-03-17 22:33:49 +010025659- The --with-readline option can now be used without a DIRECTORY argument,
25660for systems where libreadline.* is in one of the standard places. It is
Guido van Rossum821a5581997-05-23 04:05:31 +000025661also possible for it to be a shared library.
25662
Victor Stinner554fd082014-03-17 22:33:49 +010025663- The extension tkinter has been renamed to _tkinter, to avoid confusion
25664with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
Guido van Rossum821a5581997-05-23 04:05:31 +000025665well as 4.0.
25666
Victor Stinner554fd082014-03-17 22:33:49 +010025667- Author's change of address from CWI in Amsterdam, The Netherlands, to
Guido van Rossum821a5581997-05-23 04:05:31 +000025668CNRI in Reston, VA, USA.
25669
Victor Stinner554fd082014-03-17 22:33:49 +010025670- The math.hypot() function is now always available (if it isn't found in
Guido van Rossum821a5581997-05-23 04:05:31 +000025671the C math library, Python provides its own implementation).
25672
Victor Stinner554fd082014-03-17 22:33:49 +010025673- The latex documentation is now compatible with latex2e, thanks to David
Guido van Rossum821a5581997-05-23 04:05:31 +000025674Ascher.
25675
25676- The expression x**y is now equivalent to pow(x, y).
25677
25678- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
25679
Victor Stinner554fd082014-03-17 22:33:49 +010025680- Complex numbers are now supported. Imaginary constants are written with
25681a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
25682part to an imaginary part, like 3+4j. Complex numbers are always stored in
25683floating point form, so this is equivalent to 3.0+4.0j. It is also
25684possible to create complex numbers with the new built-in function
25685complex(re, [im]). For the footprint-conscious, complex number support can
Guido van Rossum821a5581997-05-23 04:05:31 +000025686be disabled by defining the symbol WITHOUT_COMPLEX.
25687
25688- New built-in function list() is the long-awaited counterpart of tuple().
25689
Victor Stinner554fd082014-03-17 22:33:49 +010025690- There's a new "cmath" module which provides the same functions as the
25691"math" library but with complex arguments and results. (There are very
25692good reasons why math.sqrt(-1) still raises an exception -- you have to use
Guido van Rossum821a5581997-05-23 04:05:31 +000025693cmath.sqrt(-1) to get 1j for an answer.)
25694
Victor Stinner554fd082014-03-17 22:33:49 +010025695- The Python.h header file (which is really the same as allobjects.h except
25696it disables support for old style names) now includes several more files,
Guido van Rossum821a5581997-05-23 04:05:31 +000025697so you have to have fewer #include statements in the average extension.
25698
Victor Stinner554fd082014-03-17 22:33:49 +010025699- The NDEBUG symbol is no longer used. Code that used to be dependent on
25700the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
25701and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
25702respectively. At long last, the source actually compiles and links without
Guido van Rossum821a5581997-05-23 04:05:31 +000025703errors when this symbol is defined.
25704
Victor Stinner554fd082014-03-17 22:33:49 +010025705- Several symbols that didn't follow the new naming scheme have been
25706renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
25707are no external symbols left without a Py or _Py prefix, not even those
25708defined by sources that were incorporated from elsewhere (regexpr.c,
Guido van Rossum821a5581997-05-23 04:05:31 +000025709md5c.c). (Macros are a different story...)
25710
Victor Stinner554fd082014-03-17 22:33:49 +010025711- There are now typedefs for the structures defined in config.c and
Guido van Rossum821a5581997-05-23 04:05:31 +000025712frozen.c.
25713
25714- New PYTHON_API_VERSION value and .pyc file magic number.
25715
25716- New module Bastion. (XXX)
25717
25718- Improved performance of StringIO module.
25719
25720- UserList module now supports + and * operators.
25721
25722- The binhex and binascii modules now actually work.
25723
25724- The cgi module has been almost totally rewritten and documented.
Victor Stinner554fd082014-03-17 22:33:49 +010025725It now supports file upload and a new data type to handle forms more
Guido van Rossum821a5581997-05-23 04:05:31 +000025726flexibly.
25727
25728- The formatter module (for use with htmllib) has been overhauled (again).
25729
25730- The ftplib module now supports passive mode and has doc strings.
25731
Victor Stinner554fd082014-03-17 22:33:49 +010025732- In (ideally) all places where binary files are read or written, the file
25733is now correctly opened in binary mode ('rb' or 'wb') so the code will work
Guido van Rossum821a5581997-05-23 04:05:31 +000025734on Mac or PC.
25735
Victor Stinner554fd082014-03-17 22:33:49 +010025736- Dummy versions of os.path.expandvars() and expanduser() are now provided
Guido van Rossum821a5581997-05-23 04:05:31 +000025737on non-Unix platforms.
25738
Victor Stinner554fd082014-03-17 22:33:49 +010025739- Module urllib now has two new functions url2pathname and pathname2url
25740which turn local filenames into "file:..." URLs using the same rules as
25741Netscape (why be different). it also supports urlretrieve() with a
25742pathname parameter, and honors the proxy environment variables (http_proxy
Guido van Rossum821a5581997-05-23 04:05:31 +000025743etc.). The URL parsing has been improved somewhat, too.
25744
Victor Stinner554fd082014-03-17 22:33:49 +010025745- Micro improvements to urlparse. Added urlparse.urldefrag() which
Guido van Rossum821a5581997-05-23 04:05:31 +000025746removes a trailing ``#fragment'' if any.
25747
25748- The mailbox module now supports MH style message delimiters as well.
25749
Victor Stinner554fd082014-03-17 22:33:49 +010025750- The mhlib module contains some new functionality: setcontext() to set the
25751current folder and parsesequence() to parse a sequence as commonly passed
Guido van Rossum821a5581997-05-23 04:05:31 +000025752to MH commands (e.g. 1-10 or last:5).
25753
Victor Stinner554fd082014-03-17 22:33:49 +010025754- New module mimify for conversion to and from MIME format of email
Guido van Rossum821a5581997-05-23 04:05:31 +000025755messages.
25756
Victor Stinner554fd082014-03-17 22:33:49 +010025757- Module ni now automatically installs itself when first imported -- this
25758is against the normal rule that modules should define classes and functions
25759but not invoke them, but appears more useful in the case that two
Guido van Rossum821a5581997-05-23 04:05:31 +000025760different, independent modules want to use ni's features.
25761
25762- Some small performance enhancements in module pickle.
25763
Victor Stinner554fd082014-03-17 22:33:49 +010025764- Small interface change to the profile.run*() family of functions -- more
Guido van Rossum821a5581997-05-23 04:05:31 +000025765sensible handling of return values.
25766
Victor Stinner554fd082014-03-17 22:33:49 +010025767- The officially registered Mac creator for Python files is 'Pyth'. This
Guido van Rossum821a5581997-05-23 04:05:31 +000025768replaces 'PYTH' which was used before but never registered.
25769
25770- Added regsub.capwords(). (XXX)
25771
Victor Stinner554fd082014-03-17 22:33:49 +010025772- Added string.capwords(), string.capitalize() and string.translate().
Guido van Rossum821a5581997-05-23 04:05:31 +000025773(XXX)
25774
Victor Stinner554fd082014-03-17 22:33:49 +010025775- Fixed an interface bug in the rexec module: it was impossible to pass a
25776hooks instance to the RExec class. rexec now also supports the dynamic
25777loading of modules from shared libraries. Some other interfaces have been
Guido van Rossum821a5581997-05-23 04:05:31 +000025778added too.
25779
Victor Stinner554fd082014-03-17 22:33:49 +010025780- Module rfc822 now caches the headers in a dictionary for more efficient
Guido van Rossum821a5581997-05-23 04:05:31 +000025781lookup.
25782
Victor Stinner554fd082014-03-17 22:33:49 +010025783- The sgmllib module now understands a limited number of SGML "shorthands"
Guido van Rossum821a5581997-05-23 04:05:31 +000025784like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
25785
Victor Stinner554fd082014-03-17 22:33:49 +010025786- The tempfile module actually tries a number of different places to find a
25787usable temporary directory. (This was prompted by certain Linux
25788installations that appear to be missing a /usr/tmp directory.) [A bug in
25789the implementation that would ignore a pre-existing tmpdir global has been
Guido van Rossum821a5581997-05-23 04:05:31 +000025790fixed in beta3.]
25791
25792- Much improved and enhanved FileDialog module for Tkinter.
25793
Victor Stinner554fd082014-03-17 22:33:49 +010025794- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
Guido van Rossum821a5581997-05-23 04:05:31 +000025795well as Tk 4.1).
25796
Victor Stinner554fd082014-03-17 22:33:49 +010025797- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
25798s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
25799extension is called _socket and a wrapper module win/socket.py provides
25800"makefile()" and "dup()" functionality. On Windows, the select module
Guido van Rossum821a5581997-05-23 04:05:31 +000025801works only with socket objects.
25802
25803- Bugs in bsddb module fixed (e.g. missing default argument values).
25804
25805- The curses extension now includes <ncurses.h> when available.
25806
Victor Stinner554fd082014-03-17 22:33:49 +010025807- The gdbm module now supports opening databases in "fast" mode by
Guido van Rossum821a5581997-05-23 04:05:31 +000025808specifying 'f' as the second character or the mode string.
25809
Victor Stinner554fd082014-03-17 22:33:49 +010025810- new variables sys.prefix and sys.exec_prefix pass corresponding
Guido van Rossum821a5581997-05-23 04:05:31 +000025811configuration options / Makefile variables to the Python programmer.
25812
Victor Stinner554fd082014-03-17 22:33:49 +010025813- The ``new'' module now supports creating new user-defined classes as well
Guido van Rossum821a5581997-05-23 04:05:31 +000025814as instances thereof.
25815
Victor Stinner554fd082014-03-17 22:33:49 +010025816- The soundex module now sports get_soundex() to get the soundex value for an
25817arbitrary string (formerly it would only do soundex-based string
Guido van Rossum821a5581997-05-23 04:05:31 +000025818comparison) as well as doc strings.
25819
Victor Stinner554fd082014-03-17 22:33:49 +010025820- New object type "cobject" to safely wrap void pointers for passing them
Guido van Rossum821a5581997-05-23 04:05:31 +000025821between various extension modules.
25822
25823- More efficient computation of float**smallint.
25824
Victor Stinner554fd082014-03-17 22:33:49 +010025825- The mysterious bug whereby "x.x" (two occurrences of the same
25826one-character name) typed from the commandline would sometimes fail
Guido van Rossum821a5581997-05-23 04:05:31 +000025827mysteriously.
25828
Victor Stinner554fd082014-03-17 22:33:49 +010025829- The initialization of the readline function can now be invoked by a C
Guido van Rossum821a5581997-05-23 04:05:31 +000025830extension through PyOS_ReadlineInit().
25831
Victor Stinner554fd082014-03-17 22:33:49 +010025832- There's now an externally visible pointer PyImport_FrozenModules which
Guido van Rossum821a5581997-05-23 04:05:31 +000025833can be changed by an embedding application.
25834
Victor Stinner554fd082014-03-17 22:33:49 +010025835- The argument parsing functions now support a new format character 'D' to
Guido van Rossum821a5581997-05-23 04:05:31 +000025836specify complex numbers.
25837
25838- Various memory leaks plugged and bugs fixed.
25839
Victor Stinner554fd082014-03-17 22:33:49 +010025840- Improved support for posix threads (now that real implementations are
Guido van Rossum821a5581997-05-23 04:05:31 +000025841beginning to apepar). Still no fully functioning semaphores.
25842
Victor Stinner554fd082014-03-17 22:33:49 +010025843- Some various and sundry improvements and new entries in the Tools
Guido van Rossum821a5581997-05-23 04:05:31 +000025844directory.
25845
25846
25847=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +000025848==> Release 1.3 (13 October 1995) <==
25849=====================================
25850
25851Major change
25852============
25853
25854Two words: Keyword Arguments. See the first section of Chapter 12 of
25855the Tutorial.
25856
25857(The rest of this file is textually the same as the remaining sections
25858of that chapter.)
25859
25860
25861Changes to the WWW and Internet tools
25862=====================================
25863
25864The "htmllib" module has been rewritten in an incompatible fashion.
25865The new version is considerably more complete (HTML 2.0 except forms,
25866but including all ISO-8859-1 entity definitions), and easy to use.
25867Small changes to "sgmllib" have also been made, to better match the
25868tokenization of HTML as recognized by other web tools.
25869
25870A new module "formatter" has been added, for use with the new
25871"htmllib" module.
25872
25873The "urllib"and "httplib" modules have been changed somewhat to allow
25874overriding unknown URL types and to support authentication. They now
25875use "mimetools.Message" instead of "rfc822.Message" to parse headers.
25876The "endrequest()" method has been removed from the HTTP class since
25877it breaks the interaction with some servers.
25878
25879The "rfc822.Message" class has been changed to allow a flag to be
25880passed in that says that the file is unseekable.
25881
25882The "ftplib" module has been fixed to be (hopefully) more robust on
25883Linux.
25884
25885Several new operations that are optionally supported by servers have
25886been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
25887
25888Other Language Changes
25889======================
25890
25891The "raise" statement now takes an optional argument which specifies
25892the traceback to be used when printing the exception's stack trace.
25893This must be a traceback object, such as found in "sys.exc_traceback".
25894When omitted or given as "None", the old behavior (to generate a stack
25895trace entry for the current stack frame) is used.
25896
25897The tokenizer is now more tolerant of alien whitespace. Control-L in
25898the leading whitespace of a line resets the column number to zero,
25899while Control-R just before the end of the line is ignored.
25900
25901Changes to Built-in Operations
25902==============================
25903
25904For file objects, "f.read(0)" and "f.readline(0)" now return an empty
25905string rather than reading an unlimited number of bytes. For the
25906latter, omit the argument altogether or pass a negative value.
25907
25908A new system variable, "sys.platform", has been added. It specifies
25909the current platform, e.g. "sunos5" or "linux1".
25910
25911The built-in functions "input()" and "raw_input()" now use the GNU
25912readline library when it has been configured (formerly, only
25913interactive input to the interpreter itself was read using GNU
25914readline). The GNU readline library provides elaborate line editing
25915and history. The Python debugger ("pdb") is the first beneficiary of
25916this change.
25917
25918Two new built-in functions, "globals()" and "locals()", provide access
25919to dictionaries containming current global and local variables,
25920respectively. (These augment rather than replace "vars()", which
25921returns the current local variables when called without an argument,
25922and a module's global variables when called with an argument of type
25923module.)
25924
25925The built-in function "compile()" now takes a third possible value for
25926the kind of code to be compiled: specifying "'single'" generates code
25927for a single interactive statement, which prints the output of
25928expression statements that evaluate to something else than "None".
25929
25930Library Changes
25931===============
25932
25933There are new module "ni" and "ihooks" that support importing modules
25934with hierarchical names such as "A.B.C". This is enabled by writing
25935"import ni; ni.ni()" at the very top of the main program. These
25936modules are amply documented in the Python source.
25937
25938The module "rexec" has been rewritten (incompatibly) to define a class
25939and to use "ihooks".
25940
25941The "string.split()" and "string.splitfields()" functions are now the
25942same function (the presence or absence of the second argument
25943determines which operation is invoked); similar for "string.join()"
25944and "string.joinfields()".
25945
25946The "Tkinter" module and its helper "Dialog" have been revamped to use
25947keyword arguments. Tk 4.0 is now the standard. A new module
25948"FileDialog" has been added which implements standard file selection
25949dialogs.
25950
25951The optional built-in modules "dbm" and "gdbm" are more coordinated
25952--- their "open()" functions now take the same values for their "flag"
25953argument, and the "flag" and "mode" argument have default values (to
25954open the database for reading only, and to create the database with
25955mode "0666" minuse the umask, respectively). The memory leaks have
25956finally been fixed.
25957
25958A new dbm-like module, "bsddb", has been added, which uses the BSD DB
25959package's hash method.
25960
25961A portable (though slow) dbm-clone, implemented in Python, has been
25962added for systems where none of the above is provided. It is aptly
25963dubbed "dumbdbm".
25964
25965The module "anydbm" provides a unified interface to "bsddb", "gdbm",
25966"dbm", and "dumbdbm", choosing the first one available.
25967
25968A new extension module, "binascii", provides a variety of operations
25969for conversion of text-encoded binary data.
25970
25971There are three new or rewritten companion modules implemented in
25972Python that can encode and decode the most common such formats: "uu"
25973(uuencode), "base64" and "binhex".
25974
25975A module to handle the MIME encoding quoted-printable has also been
25976added: "quopri".
25977
25978The parser module (which provides an interface to the Python parser's
25979abstract syntax trees) has been rewritten (incompatibly) by Fred
25980Drake. It now lets you change the parse tree and compile the result!
25981
25982The \code{syslog} module has been upgraded and documented.
25983
25984Other Changes
25985=============
25986
25987The dynamic module loader recognizes the fact that different filenames
25988point to the same shared library and loads the library only once, so
25989you can have a single shared library that defines multiple modules.
25990(SunOS / SVR4 style shared libraries only.)
25991
25992Jim Fulton's ``abstract object interface'' has been incorporated into
25993the run-time API. For more detailes, read the files
25994"Include/abstract.h" and "Objects/abstract.c".
25995
25996The Macintosh version is much more robust now.
25997
25998Numerous things I have forgotten or that are so obscure no-one will
25999notice them anyway :-)
26000
26001
Guido van Rossumf456b6d1995-01-04 19:20:37 +000026002===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +000026003==> Release 1.2 (13 April 1995) <==
26004===================================
26005
26006- Changes to Misc/python-mode.el:
26007 - Wrapping and indentation within triple quote strings should work
26008 properly now.
26009 - `Standard' bug reporting mechanism (use C-c C-b)
26010 - py-mark-block was moved to C-c C-m
26011 - C-c C-v shows you the python-mode version
26012 - a basic python-font-lock-keywords has been added for Emacs 19
26013 font-lock colorizations.
26014 - proper interaction with pending-del and del-sel modes.
26015 - New py-electric-colon (:) command for improved outdenting. Also
26016 py-indent-line (TAB) should handle outdented lines better.
26017 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
26018
26019- The Library Reference has been restructured, and many new and
26020existing modules are now documented, in particular the debugger and
26021the profiler, as well as the persistency and the WWW/Internet support
26022modules.
26023
26024- All known bugs have been fixed. For example the pow(2,2,3L) bug on
26025Linux has been fixed. Also the re-entrancy problems with __del__ have
26026been fixed.
26027
26028- All known memory leaks have been fixed.
26029
26030- Phase 2 of the Great Renaming has been executed. The header files
26031now use the new names (PyObject instead of object, etc.). The linker
26032also sees the new names. Most source files still use the old names,
26033by virtue of the rename2.h header file. If you include Python.h, you
26034only see the new names. Dynamically linked modules have to be
26035recompiled. (Phase 3, fixing the rest of the sources, will be
26036executed gradually with the release later versions.)
26037
26038- The hooks for implementing "safe-python" (better called "restricted
26039execution") are in place. Specifically, the import statement is
26040implemented by calling the built-in function __import__, and the
26041built-in names used in a particular scope are taken from the
26042dictionary __builtins__ in that scope's global dictionary. See also
26043the new (unsupported, undocumented) module rexec.py.
26044
26045- The import statement now supports the syntax "import a.b.c" and
26046"from a.b.c import name". No officially supported implementation
26047exists, but one can be prototyped by replacing the built-in __import__
26048function. A proposal by Ken Manheimer is provided as newimp.py.
26049
26050- All machinery used by the import statement (or the built-in
26051__import__ function) is now exposed through the new built-in module
26052"imp" (see the library reference manual). All dynamic loading
26053machinery is moved to the new file importdl.c.
26054
26055- Persistent storage is supported through the use of the modules
26056"pickle" and "shelve" (implemented in Python). There's also a "copy"
26057module implementing deepcopy and normal (shallow) copy operations.
26058See the library reference manual.
26059
26060- Documentation strings for many objects types are accessible through
26061the __doc__ attribute. Modules, classes and functions support special
26062syntax to initialize the __doc__ attribute: if the first statement
26063consists of just a string literal, that string literal becomes the
26064value of the __doc__ attribute. The default __doc__ attribute is
26065None. Documentation strings are also supported for built-in
26066functions, types and modules; however this feature hasn't been widely
26067used yet. See the 'new' module for an example. (Basically, the type
26068object's tp_doc field contains the doc string for the type, and the
260694th member of the methodlist structure contains the doc string for the
26070method.)
26071
26072- The __coerce__ and __cmp__ methods for user-defined classes once
26073again work as expected. As an example, there's a new standard class
26074Complex in the library.
26075
26076- The functions posix.popen() and posix.fdopen() now have an optional
26077third argument to specify the buffer size, and default their second
Georg Brandl93dc9eb2010-03-14 10:56:14 +000026078(mode) argument to 'r' -- in analogy to the built-in open() function.
Guido van Rossumd462f3d1995-10-09 21:30:37 +000026079The same applies to posixfile.open() and the socket method makefile().
26080
26081- The thread.exit_thread() function now raises SystemExit so that
26082'finally' clauses are honored and a memory leak is plugged.
26083
26084- Improved X11 and Motif support, by Sjoerd Mullender. This extension
26085is being maintained and distributed separately.
26086
26087- Improved support for the Apple Macintosh, in part by Jack Jansen,
26088e.g. interfaces to (a few) resource mananger functions, get/set file
26089type and creator, gestalt, sound manager, speech manager, MacTCP, comm
26090toolbox, and the think C console library. This is being maintained
26091and distributed separately.
26092
26093- Improved version for Windows NT, by Mark Hammond. This is being
26094maintained and distributed separately.
26095
26096- Used autoconf 2.0 to generate the configure script. Adapted
26097configure.in to use the new features in autoconf 2.0.
26098
26099- It now builds on the NeXT without intervention, even on the 3.3
26100Sparc pre-release.
26101
26102- Characters passed to isspace() and friends are masked to nonnegative
26103values.
26104
26105- Correctly compute pow(-3.0, 3).
26106
26107- Fix portability problems with getopt (configure now checks for a
26108non-GNU getopt).
26109
26110- Don't add frozenmain.o to libPython.a.
26111
26112- Exceptions can now be classes. ALl built-in exceptions are still
26113string objects, but this will change in the future.
26114
26115- The socket module exports a long list of socket related symbols.
26116(More built-in modules will export their symbolic constants instead of
26117relying on a separately generated Python module.)
26118
26119- When a module object is deleted, it clears out its own dictionary.
26120This fixes a circularity in the references between functions and
26121their global dictionary.
26122
26123- Changed the error handling by [new]getargs() e.g. for "O&".
26124
26125- Dynamic loading of modules using shared libraries is supported for
26126several new platforms.
26127
26128- Support "O&", "[...]" and "{...}" in mkvalue().
26129
26130- Extension to findmethod(): findmethodinchain() (where a chain is a
26131linked list of methodlist arrays). The calling interface for
26132findmethod() has changed: it now gets a pointer to the (static!)
26133methodlist structure rather than just to the function name -- this
26134saves copying flags etc. into the (short-lived) method object.
26135
26136- The callable() function is now public.
26137
26138- Object types can define a few new operations by setting function
26139pointers in the type object structure: tp_call defines how an object
26140is called, and tp_str defines how an object's str() is computed.
26141
26142
26143===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +000026144==> Release 1.1.1 (10 Nov 1994) <==
26145===================================
26146
26147This is a pure bugfix release again. See the ChangeLog file for details.
26148
26149One exception: a few new features were added to tkinter.
26150
26151
26152=================================
26153==> Release 1.1 (11 Oct 1994) <==
26154=================================
26155
26156This release adds several new features, improved configuration and
26157portability, and fixes more bugs than I can list here (including some
26158memory leaks).
26159
26160The source compiles and runs out of the box on more platforms than
26161ever -- including Windows NT. Makefiles or projects for a variety of
26162non-UNIX platforms are provided.
26163
26164APOLOGY: some new features are badly documented or not at all. I had
26165the choice -- postpone the new release indefinitely, or release it
26166now, with working code but some undocumented areas. The problem with
26167postponing the release is that people continue to suffer from existing
26168bugs, and send me patches based on the previous release -- which I
26169can't apply directly because my own source has changed. Also, some
26170new modules (like signal) have been ready for release for quite some
26171time, and people are anxiously waiting for them. In the case of
26172signal, the interface is simple enough to figure out without
26173documentation (if you're anxious enough :-). In this case it was not
26174simple to release the module on its own, since it relies on many small
26175patches elsewhere in the source.
26176
26177For most new Python modules, the source code contains comments that
26178explain how to use them. Documentation for the Tk interface, written
26179by Matt Conway, is available as tkinter-doc.tar.gz from the Python
26180home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
26181new operator overloading facilities, have a look at Demo/classes:
26182Complex.py and Rat.py show how to implement a numeric type without and
26183with __coerce__ method. Also have a look at the end of the Tutorial
26184document (Doc/tut.tex). If you're still confused: use the newsgroup
26185or mailing list.
26186
26187
26188New language features:
26189
26190 - More flexible operator overloading for user-defined classes
26191 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
26192
26193 - Classes can define methods named __getattr__, __setattr__ and
26194 __delattr__ to trap attribute accesses. See end of tutorial.
26195
26196 - Classes can define method __call__ so instances can be called
26197 directly. See end of tutorial.
26198
26199
26200New support facilities:
26201
26202 - The Makefiles (for the base interpreter as well as for extensions)
26203 now support creating dynamically loadable modules if the platform
26204 supports shared libraries.
26205
26206 - Passing the interpreter a .pyc file as script argument will execute
26207 the code in that file. (On the Mac such files can be double-clicked!)
26208
26209 - New Freeze script, to create independently distributable "binaries"
26210 of Python programs -- look in Demo/freeze
26211
26212 - Improved h2py script (in Demo/scripts) follows #includes and
26213 supports macros with one argument
26214
26215 - New module compileall generates .pyc files for all modules in a
26216 directory (tree) without also executing them
26217
26218 - Threads should work on more platforms
26219
26220
26221New built-in modules:
26222
26223 - tkinter (support for Tcl's Tk widget set) is now part of the base
26224 distribution
26225
26226 - signal allows catching or ignoring UNIX signals (unfortunately still
26227 undocumented -- any taker?)
26228
26229 - termios provides portable access to POSIX tty settings
26230
26231 - curses provides an interface to the System V curses library
26232
26233 - syslog provides an interface to the (BSD?) syslog daemon
26234
26235 - 'new' provides interfaces to create new built-in object types
26236 (e.g. modules and functions)
26237
26238 - sybase provides an interface to SYBASE database
26239
26240
26241New/obsolete built-in methods:
26242
26243 - callable(x) tests whether x can be called
26244
26245 - sockets now have a setblocking() method
26246
26247 - sockets no longer have an allowbroadcast() method
26248
26249 - socket methods send() and sendto() return byte count
26250
26251
26252New standard library modules:
26253
26254 - types.py defines standard names for built-in types, e.g. StringType
26255
26256 - urlparse.py parses URLs according to the latest Internet draft
26257
26258 - uu.py does uuencode/uudecode (not the fastest in the world, but
26259 quicker than installing uuencode on a non-UNIX machine :-)
26260
26261 - New, faster and more powerful profile module.py
26262
26263 - mhlib.py provides interface to MH folders and messages
26264
26265
26266New facilities for extension writers (unfortunately still
26267undocumented):
26268
26269 - newgetargs() supports optional arguments and improved error messages
26270
26271 - O!, O& O? formats for getargs allow more versatile type checking of
26272 non-standard types
26273
26274 - can register pending asynchronous callback, to be called the next
26275 time the Python VM begins a new instruction (Py_AddPendingCall)
26276
26277 - can register cleanup routines to be called when Python exits
26278 (Py_AtExit)
26279
26280 - makesetup script understands C++ files in Setup file (use file.C
26281 or file.cc)
26282
26283 - Make variable OPT is passed on to sub-Makefiles
26284
26285 - An init<module>() routine may signal an error by not entering
26286 the module in the module table and raising an exception instead
26287
26288 - For long module names, instead of foobarbletchmodule.c you can
26289 use foobarbletch.c
26290
26291 - getintvalue() and getfloatvalue() try to convert any object
26292 instead of requiring an "intobject" or "floatobject"
26293
26294 - All the [new]getargs() formats that retrieve an integer value
26295 will now also work if a float is passed
26296
26297 - C function listtuple() converts list to tuple, fast
26298
26299 - You should now call sigcheck() instead of intrcheck();
26300 sigcheck() also sets an exception when it returns nonzero
26301
26302
Guido van Rossumaa253861994-10-06 17:18:57 +000026303====================================
26304==> Release 1.0.3 (14 July 1994) <==
26305====================================
26306
26307This release consists entirely of bug fixes to the C sources; see the
26308head of ../ChangeLog for a complete list. Most important bugs fixed:
26309
26310- Sometimes the format operator (string%expr) would drop the last
26311character of the format string
26312
26313- Tokenizer looped when last line did not end in \n
26314
26315- Bug when triple-quoted string ended in quote plus newline
26316
26317- Typo in socketmodule (listen) (== instead of =)
26318
26319- typing vars() at the >>> prompt would cause recursive output
26320
26321
26322==================================
26323==> Release 1.0.2 (4 May 1994) <==
26324==================================
26325
26326Overview of the most visible changes. Bug fixes are not listed. See
26327also ChangeLog.
26328
26329Tokens
26330------
26331
26332* String literals follow Standard C rules: they may be continued on
26333the next line using a backslash; adjacent literals are concatenated
26334at compile time.
26335
26336* A new kind of string literals, surrounded by triple quotes (""" or
26337'''), can be continued on the next line without a backslash.
26338
26339Syntax
26340------
26341
26342* Function arguments may have a default value, e.g. def f(a, b=1);
26343defaults are evaluated at function definition time. This also applies
26344to lambda.
26345
26346* The try-except statement has an optional else clause, which is
26347executed when no exception occurs in the try clause.
26348
26349Interpreter
26350-----------
26351
26352* The result of a statement-level expression is no longer printed,
26353except_ for expressions entered interactively. Consequently, the -k
26354command line option is gone.
26355
26356* The result of the last printed interactive expression is assigned to
26357the variable '_'.
26358
26359* Access to implicit global variables has been speeded up by removing
26360an always-failing dictionary lookup in the dictionary of local
26361variables (mod suggested by Steve Makewski and Tim Peters).
26362
26363* There is a new command line option, -u, to force stdout and stderr
26364to be unbuffered.
26365
26366* Incorporated Steve Majewski's mods to import.c for dynamic loading
26367under AIX.
26368
26369* Fewer chances of dumping core when trying to reload or re-import
26370static built-in, dynamically loaded built-in, or frozen modules.
26371
26372* Loops over sequences now don't ask for the sequence's length when
26373they start, but try to access items 0, 1, 2, and so on until they hit
26374an IndexError. This makes it possible to create classes that generate
26375infinite or indefinite sequences a la Steve Majewski. This affects
26376for loops, the (not) in operator, and the built-in functions filter(),
26377map(), max(), min(), reduce().
26378
26379Changed Built-in operations
26380---------------------------
26381
26382* The '%' operator on strings (printf-style formatting) supports a new
26383feature (adapted from a patch by Donald Beaudry) to allow
26384'%(<key>)<format>' % {...} to take values from a dictionary by name
26385instead of from a tuple by position (see also the new function
26386vars()).
26387
26388* The '%s' formatting operator is changed to accept any type and
26389convert it to a string using str().
26390
26391* Dictionaries with more than 20,000 entries can now be created
26392(thanks to Steve Kirsch).
26393
26394New Built-in Functions
26395----------------------
26396
26397* vars() returns a dictionary containing the local variables; vars(m)
26398returns a dictionary containing the variables of module m. Note:
26399dir(x) is now equivalent to vars(x).keys().
26400
26401Changed Built-in Functions
26402--------------------------
26403
26404* open() has an optional third argument to specify the buffer size: 0
26405for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
26406for default.
26407
26408* open()'s second argument is now optional; it defaults to "r".
26409
26410* apply() now checks that its second argument is indeed a tuple.
26411
26412New Built-in Modules
26413--------------------
26414
26415Changed Built-in Modules
26416------------------------
26417
26418The thread module no longer supports exit_prog().
26419
26420New Python Modules
26421------------------
26422
26423* Module addpack contains a standard interface to modify sys.path to
26424find optional packages (groups of related modules).
26425
26426* Module urllib contains a number of functions to access
26427World-Wide-Web files specified by their URL.
26428
26429* Module httplib implements the client side of the HTTP protocol used
26430by World-Wide-Web servers.
26431
26432* Module gopherlib implements the client side of the Gopher protocol.
26433
26434* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
26435style mailbox files.
26436
26437* Module random contains various random distributions, e.g. gauss().
26438
26439* Module lockfile locks and unlocks open files using fcntl (inspired
26440by a similar module by Andy Bensky).
26441
26442* Module ntpath (by Jaap Vermeulen) implements path operations for
26443Windows/NT.
26444
26445* Module test_thread (in Lib/test) contains a small test set for the
26446thread module.
26447
26448Changed Python Modules
26449----------------------
26450
26451* The string module's expandvars() function is now documented and is
26452implemented in Python (using regular expressions) instead of forking
26453off a shell process.
26454
26455* Module rfc822 now supports accessing the header fields using the
26456mapping/dictionary interface, e.g. h['subject'].
26457
26458* Module pdb now makes it possible to set a break on a function
26459(syntax: break <expression>, where <expression> yields a function
26460object).
26461
26462Changed Demos
26463-------------
26464
26465* The Demo/scripts/freeze.py script is working again (thanks to Jaap
26466Vermeulen).
26467
26468New Demos
26469---------
26470
26471* Demo/threads/Generator.py is a proposed interface for restartable
26472functions a la Tim Peters.
26473
26474* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
26475directory full of HTML pages which between them contain links to all
26476the newsgroups available on your server.
26477
26478* Demo/dns contains a DNS (Domain Name Server) client.
26479
26480* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
26481nice enhanced Python shell!!!).
26482
26483* Demo/turing contains a Turing machine by Amrit Prem.
26484
26485Documentation
26486-------------
26487
26488* Documented new language features mentioned above (but not all new
26489modules).
26490
26491* Added a chapter to the Tutorial describing recent additions to
26492Python.
26493
26494* Clarified some sentences in the reference manual,
26495e.g. break/continue, local/global scope, slice assignment.
26496
26497Source Structure
26498----------------
26499
26500* Moved Include/tokenizer.h to Parser/tokenizer.h.
26501
26502* Added Python/getopt.c for systems that don't have it.
26503
26504Emacs mode
26505----------
26506
26507* Indentation of continuated lines is done more intelligently;
26508consequently the variable py-continuation-offset is gone.
26509
Guido van Rossumf2eac992000-09-04 17:24:24 +000026510
Guido van Rossumaa253861994-10-06 17:18:57 +000026511========================================
26512==> Release 1.0.1 (15 February 1994) <==
26513========================================
26514
26515* Many portability fixes should make it painless to build Python on
26516several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
26517
26518* Fixed test for <stdarg.h> -- this broke on some platforms.
26519
26520* Fixed test for shared library dynalic loading -- this broke on SunOS
265214.x using the GNU loader.
26522
26523* Changed order and number of SVR4 networking libraries (it is now
26524-lsocket -linet -lnsl, if these libraries exist).
26525
26526* Installing the build intermediate stages with "make libainstall" now
26527also installs config.c.in, Setup and makesetup, which are used by the
26528new Extensions mechanism.
26529
26530* Improved README file contains more hints and new troubleshooting
26531section.
26532
26533* The built-in module strop now defines fast versions of three more
26534functions of the standard string module: atoi(), atol() and atof().
26535The strop versions of atoi() and atol() support an optional second
26536argument to specify the base (default 10). NOTE: you don't have to
26537explicitly import strop to use the faster versions -- the string
26538module contains code to let versions from stop override the default
26539versions.
26540
26541* There is now a working Lib/dospath.py for those who use Python under
26542DOS (or Windows). Thanks, Jaap!
26543
26544* There is now a working Modules/dosmodule.c for DOS (or Windows)
26545system calls.
26546
26547* Lib.os.py has been reorganized (making it ready for more operating
26548systems).
26549
26550* Lib/ospath.py is now obsolete (use os.path instead).
26551
26552* Many fixes to the tutorial to make it match Python 1.0. Thanks,
26553Tim!
26554
26555* Fixed Doc/Makefile, Doc/README and various scripts there.
26556
26557* Added missing description of fdopen to Doc/libposix.tex.
26558
26559* Made cleanup() global, for the benefit of embedded applications.
26560
26561* Added parsing of addresses and dates to Lib/rfc822.py.
26562
26563* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
26564them usable at all.
26565
26566* New module Lib/wave.py reads RIFF (*.wav) audio files.
26567
26568* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
26569belongs.
26570
26571* New options and comments for Modules/makesetup (used by new
26572Extension mechanism).
26573
26574* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
26575and elsewhere.
26576
26577* Fixed coredump in filter(None, 'abcdefg').
26578
26579
26580=======================================
26581==> Release 1.0.0 (26 January 1994) <==
26582=======================================
26583
26584As is traditional, so many things have changed that I can't pretend to
26585be complete in these release notes, but I'll try anyway :-)
26586
26587Note that the very last section is labeled "remaining bugs".
26588
26589
26590Source organization and build process
26591-------------------------------------
26592
26593* The sources have finally been split: instead of a single src
26594subdirectory there are now separate directories Include, Parser,
26595Grammar, Objects, Python and Modules. Other directories also start
26596with a capital letter: Misc, Doc, Lib, Demo.
26597
26598* A few extensions (notably Amoeba and X support) have been moved to a
26599separate subtree Extensions, which is no longer in the core
26600distribution, but separately ftp'able as extensions.tar.Z. (The
26601distribution contains a placeholder Ext-dummy with a description of
26602the Extensions subtree as well as the most recent versions of the
26603scripts used there.)
26604
26605* A few large specialized demos (SGI video and www) have been
26606moved to a separate subdirectory Demo2, which is no longer in the core
26607distribution, but separately ftp'able as demo2.tar.Z.
26608
26609* Parts of the standard library have been moved to subdirectories:
26610there are now standard subdirectories stdwin, test, sgi and sun4.
26611
26612* The configuration process has radically changed: I now use GNU
26613autoconf. This makes it much easier to build on new Unix flavors, as
26614well as fully supporting VPATH (if your Make has it). The scripts
26615Configure.py and Addmodule.sh are no longer needed. Many source files
26616have been adapted in order to work with the symbols that the configure
26617script generated by autoconf defines (or not); the resulting source is
26618much more portable to different C compilers and operating systems,
26619even non Unix systems (a Mac port was done in an afternoon). See the
26620toplevel README file for a description of the new build process.
26621
26622* GNU readline (a slightly newer version) is now a subdirectory of the
26623Python toplevel. It is still not automatically configured (being
26624totally autoconf-unaware :-). One problem has been solved: typing
26625Control-C to a readline prompt will now work. The distribution no
26626longer contains a "super-level" directory (above the python toplevel
26627directory), and dl, dl-dld and GNU dld are no longer part of the
26628Python distribution (you can still ftp them from
26629ftp.cwi.nl:/pub/dynload).
26630
26631* The DOS functions have been taken out of posixmodule.c and moved
26632into a separate file dosmodule.c.
26633
26634* There's now a separate file version.c which contains nothing but
26635the version number.
26636
26637* The actual main program is now contained in config.c (unless NO_MAIN
26638is defined); pythonmain.c now contains a function realmain() which is
26639called from config.c's main().
26640
26641* All files needed to use the built-in module md5 are now contained in
26642the distribution. The module has been cleaned up considerably.
26643
26644
26645Documentation
26646-------------
26647
26648* The library manual has been split into many more small latex files,
26649so it is easier to edit Doc/lib.tex file to create a custom library
26650manual, describing only those modules supported on your system. (This
26651is not automated though.)
26652
26653* A fourth manual has been added, titled "Extending and Embedding the
26654Python Interpreter" (Doc/ext.tex), which collects information about
26655the interpreter which was previously spread over several files in the
26656misc subdirectory.
26657
26658* The entire documentation is now also available on-line for those who
26659have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
26660"http://www.cwi.nl/~guido/Python.html".
26661
26662
26663Syntax
26664------
26665
26666* Strings may now be enclosed in double quotes as well as in single
26667quotes. There is no difference in interpretation. The repr() of
26668string objects will use double quotes if the string contains a single
26669quote and no double quotes. Thanks to Amrit Prem for these changes!
26670
26671* There is a new keyword 'exec'. This replaces the exec() built-in
26672function. If a function contains an exec statement, local variable
26673optimization is not performed for that particular function, thus
26674making assignment to local variables in exec statements less
26675confusing. (As a consequence, os.exec and python.exec have been
26676renamed to execv.)
26677
26678* There is a new keyword 'lambda'. An expression of the form
26679
26680 lambda <parameters> : <expression>
26681
26682yields an anonymous function. This is really only syntactic sugar;
26683you can just as well define a local function using
26684
26685 def some_temporary_name(<parameters>): return <expression>
26686
26687Lambda expressions are particularly useful in combination with map(),
26688filter() and reduce(), described below. Thanks to Amrit Prem for
26689submitting this code (as well as map(), filter(), reduce() and
26690xrange())!
26691
26692
26693Built-in functions
26694------------------
26695
26696* The built-in module containing the built-in functions is called
26697__builtin__ instead of builtin.
26698
26699* New built-in functions map(), filter() and reduce() perform standard
26700functional programming operations (though not lazily):
26701
26702- map(f, seq) returns a new sequence whose items are the items from
26703seq with f() applied to them.
26704
26705- filter(f, seq) returns a subsequence of seq consisting of those
26706items for which f() is true.
26707
26708- reduce(f, seq, initial) returns a value computed as follows:
26709 acc = initial
26710 for item in seq: acc = f(acc, item)
26711 return acc
26712
26713* New function xrange() creates a "range object". Its arguments are
26714the same as those of range(), and when used in a for loop a range
26715objects also behaves identical. The advantage of xrange() over
26716range() is that its representation (if the range contains many
26717elements) is much more compact than that of range(). The disadvantage
26718is that the result cannot be used to initialize a list object or for
26719the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
26720architectures, benchmarks have shown that "for i in range(...): ..."
26721actually executes *faster* than "for i in xrange(...): ...", but on
26722memory starved machines like PCs running DOS range(100000) may be just
26723too big to be represented at all...
26724
26725* Built-in function exec() has been replaced by the exec statement --
26726see above.
26727
26728
26729The interpreter
26730---------------
26731
26732* Syntax errors are now not printed to stderr by the parser, but
26733rather the offending line and other relevant information are packed up
26734in the SyntaxError exception argument. When the main loop catches a
26735SyntaxError exception it will print the error in the same format as
26736previously, but at the proper position in the stack traceback.
26737
26738* You can now set a maximum to the number of traceback entries
26739printed by assigning to sys.tracebacklimit. The default is 1000.
26740
26741* The version number in .pyc files has changed yet again.
26742
26743* It is now possible to have a .pyc file without a corresponding .py
26744file. (Warning: this may break existing installations if you have an
26745old .pyc file lingering around somewhere on your module search path
26746without a corresponding .py file, when there is a .py file for a
26747module of the same name further down the path -- the new interpreter
26748will find the first .pyc file and complain about it, while the old
26749interpreter would ignore it and use the .py file further down.)
26750
26751* The list sys.builtin_module_names is now sorted and also contains
26752the names of a few hardwired built-in modules (sys, __main__ and
26753__builtin__).
26754
26755* A module can now find its own name by accessing the global variable
26756__name__. Assigning to this variable essentially renames the module
26757(it should also be stored under a different key in sys.modules).
26758A neat hack follows from this: a module that wants to execute a main
26759program when called as a script no longer needs to compare
26760sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
26761
26762* When an object is printed by the print statement, its implementation
26763of str() is used. This means that classes can define __str__(self) to
26764direct how their instances are printed. This is different from
26765__repr__(self), which should define an unambigous string
26766representation of the instance. (If __str__() is not defined, it
26767defaults to __repr__().)
26768
26769* Functions and code objects can now be compared meaningfully.
26770
26771* On systems supporting SunOS or SVR4 style shared libraries, dynamic
26772loading of modules using shared libraries is automatically configured.
26773Thanks to Bill Jansen and Denis Severson for contributing this change!
26774
26775
26776Built-in objects
26777----------------
26778
26779* File objects have acquired a new method writelines() which is the
26780reverse of readlines(). (It does not actually write lines, just a
26781list of strings, but the symmetry makes the choice of name OK.)
26782
26783
26784Built-in modules
26785----------------
26786
26787* Socket objects no longer support the avail() method. Use the select
26788module instead, or use this function to replace it:
26789
26790 def avail(f):
26791 import select
26792 return f in select.select([f], [], [], 0)[0]
26793
26794* Initialization of stdwin is done differently. It actually modifies
26795sys.argv (taking out the options the X version of stdwin recognizes)
26796the first time it is imported.
26797
26798* A new built-in module parser provides a rudimentary interface to the
26799python parser. Corresponding standard library modules token and symbol
26800defines the numeric values of tokens and non-terminal symbols.
26801
Martin Panter46f50722016-05-26 05:35:26 +000026802* The posix module has acquired new functions setuid(), setgid(),
Guido van Rossumaa253861994-10-06 17:18:57 +000026803execve(), and exec() has been renamed to execv().
26804
26805* The array module is extended with 8-byte object swaps, the 'i'
26806format character, and a reverse() method. The read() and write()
26807methods are renamed to fromfile() and tofile().
26808
26809* The rotor module has freed of portability bugs. This introduces a
26810backward compatibility problem: strings encoded with the old rotor
26811module can't be decoded by the new version.
26812
26813* For select.select(), a timeout (4th) argument of None means the same
26814as leaving the timeout argument out.
26815
Martin Panter46f50722016-05-26 05:35:26 +000026816* Module strop (and hence standard library module string) has acquired
Guido van Rossumaa253861994-10-06 17:18:57 +000026817a new function: rindex(). Thanks to Amrit Prem!
26818
26819* Module regex defines a new function symcomp() which uses an extended
26820regular expression syntax: parenthesized subexpressions may be labeled
26821using the form "\(<labelname>...\)", and the group() method can return
26822sub-expressions by name. Thanks to Tracy Tims for these changes!
26823
26824* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
26825Mullender!
26826
26827
26828Standard library modules
26829------------------------
26830
26831* The library is now split in several subdirectories: all stuff using
26832stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
26833is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
26834test modules are in Lib/test. The default module search path will
26835include all relevant subdirectories by default.
26836
26837* Module os now knows about trying to import dos. It defines
26838functions execl(), execle(), execlp() and execvp().
26839
26840* New module dospath (should be attacked by a DOS hacker though).
26841
26842* All modules defining classes now define __init__() constructors
26843instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
26844
26845* Some minor changes and bugfixes module ftplib (mostly Steve
26846Majewski's suggestions); the debug() method is renamed to
26847set_debuglevel().
26848
26849* Some new test modules (not run automatically by testall though):
26850test_audioop, test_md5, test_rgbimg, test_select.
26851
26852* Module string now defines rindex() and rfind() in analogy of index()
26853and find(). It also defines atof() and atol() (and corresponding
26854exceptions) in analogy to atoi().
26855
26856* Added help() functions to modules profile and pdb.
26857
26858* The wdb debugger (now in Lib/stdwin) now shows class or instance
26859variables on a double click. Thanks to Sjoerd Mullender!
26860
26861* The (undocumented) module lambda has gone -- you couldn't import it
26862any more, and it was basically more a demo than a library module...
26863
26864
26865Multimedia extensions
26866---------------------
26867
26868* The optional built-in modules audioop and imageop are now standard
26869parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
26870for contributing this code!
26871
26872* There's a new operation in audioop: minmax().
26873
26874* There's a new built-in module called rgbimg which supports portable
26875efficient reading of SGI RCG image files. Thanks also to Paul
26876Haeberli for the original code! (Who will contribute a GIF reader?)
26877
26878* The module aifc is gone -- you should now always use aifc, which has
26879received a facelift.
26880
26881* There's a new module sunau., for reading Sun (and NeXT) audio files.
26882
26883* There's a new module audiodev which provides a uniform interface to
26884(SGI Indigo and Sun Sparc) audio hardware.
26885
26886* There's a new module sndhdr which recognizes various sound files by
26887looking in their header and checking for various magic words.
26888
26889
26890Optimizations
26891-------------
26892
26893* Most optimizations below can be configured by compile-time flags.
26894Thanks to Sjoerd Mullender for submitting these optimizations!
26895
26896* Small integers (default -1..99) are shared -- i.e. if two different
26897functions compute the same value it is possible (but not
26898guaranteed!!!) that they return the same *object*. Python programs
26899can detect this but should *never* rely on it.
26900
26901* Empty tuples (which all compare equal) are shared in the same
26902manner.
26903
26904* Tuples of size up to 20 (default) are put in separate free lists
26905when deallocated.
26906
26907* There is a compile-time option to cache a string's hash function,
26908but this appeared to have a negligeable effect, and as it costs 4
26909bytes per string it is disabled by default.
26910
26911
26912Embedding Python
26913----------------
26914
26915* The initialization interface has been simplified somewhat. You now
26916only call "initall()" to initialize the interpreter.
26917
26918* The previously announced renaming of externally visible identifiers
26919has not been carried out. It will happen in a later release. Sorry.
26920
26921
26922Miscellaneous bugs that have been fixed
26923---------------------------------------
26924
26925* All known portability bugs.
26926
26927* Version 0.9.9 dumped core in <listobject>.sort() which has been
26928fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
26929on the mailing list while I was away!
26930
26931* Core dump on a format string ending in '%', e.g. in the expression
26932'%' % None.
26933
26934* The array module yielded a bogus result for concatenation (a+b would
26935yield a+a).
26936
26937* Some serious memory leaks in strop.split() and strop.splitfields().
26938
26939* Several problems with the nis module.
26940
26941* Subtle problem when copying a class method from another class
26942through assignment (the method could not be called).
26943
26944
26945Remaining bugs
26946--------------
26947
26948* One problem with 64-bit machines remains -- since .pyc files are
26949portable and use only 4 bytes to represent an integer object, 64-bit
26950integer literals are silently truncated when written into a .pyc file.
26951Work-around: use eval('123456789101112').
26952
26953* The freeze script doesn't work any more. A new and more portable
26954one can probably be cooked up using tricks from Extensions/mkext.py.
26955
26956* The dos support hasn't been tested yet. (Really Soon Now we should
26957have a PC with a working C compiler!)
26958
26959
Guido van Rossuma7925f11994-01-26 10:20:16 +000026960===================================
26961==> Release 0.9.9 (29 Jul 1993) <==
26962===================================
26963
26964I *believe* these are the main user-visible changes in this release,
26965but there may be others. SGI users may scan the {src,lib}/ChangeLog
26966files for improvements of some SGI specific modules, e.g. aifc and
26967cl. Developers of extension modules should also read src/ChangeLog.
26968
26969
26970Naming of C symbols used by the Python interpreter
26971--------------------------------------------------
26972
26973* This is the last release using the current naming conventions. New
26974naming conventions are explained in the file misc/NAMING.
26975Summarizing, all externally visible symbols get (at least) a "Py"
26976prefix, and most functions are renamed to the standard form
26977PyModule_FunctionName.
26978
26979* Writers of extensions are urged to start using the new naming
26980conventions. The next release will use the new naming conventions
26981throughout (it will also have a different source directory
26982structure).
26983
26984* As a result of the preliminary work for the great renaming, many
26985functions that were accidentally global have been made static.
26986
26987
26988BETA X11 support
26989----------------
26990
26991* There are now modules interfacing to the X11 Toolkit Intrinsics, the
26992Athena widgets, and the Motif 1.1 widget set. These are not yet
26993documented except through the examples and README file in the demo/x11
26994directory. It is expected that this interface will be replaced by a
26995more powerful and correct one in the future, which may or may not be
26996backward compatible. In other words, this part of the code is at most
26997BETA level software! (Note: the rest of Python is rock solid as ever!)
26998
26999* I understand that the above may be a bit of a disappointment,
27000however my current schedule does not allow me to change this situation
27001before putting the release out of the door. By releasing it
27002undocumented and buggy, at least some of the (working!) demo programs,
27003like itr (my Internet Talk Radio browser) become available to a larger
27004audience.
27005
27006* There are also modules interfacing to SGI's "Glx" widget (a GL
27007window wrapped in a widget) and to NCSA's "HTML" widget (which can
27008format HyperText Markup Language, the document format used by the
27009World Wide Web).
27010
27011* I've experienced some problems when building the X11 support. In
27012particular, the Xm and Xaw widget sets don't go together, and it
27013appears that using X11R5 is better than using X11R4. Also the threads
27014module and its link time options may spoil things. My own strategy is
27015to build two Python binaries: one for use with X11 and one without
27016it, which can contain a richer set of built-in modules. Don't even
27017*think* of loading the X11 modules dynamically...
27018
27019
27020Environmental changes
27021---------------------
27022
27023* Compiled files (*.pyc files) created by this Python version are
27024incompatible with those created by the previous version. Both
27025versions detect this and silently create a correct version, but it
27026means that it is not a good idea to use the same library directory for
27027an old and a new interpreter, since they will start to "fight" over
27028the *.pyc files...
27029
27030* When a stack trace is printed, the exception is printed last instead
27031of first. This means that if the beginning of the stack trace
27032scrolled out of your window you can still see what exception caused
27033it.
27034
27035* Sometimes interrupting a Python operation does not work because it
27036hangs in a blocking system call. You can now kill the interpreter by
27037interrupting it three times. The second time you interrupt it, a
27038message will be printed telling you that the third interrupt will kill
27039the interpreter. The "sys.exitfunc" feature still makes limited
27040clean-up possible in this case.
27041
27042
27043Changes to the command line interface
27044-------------------------------------
27045
27046* The python usage message is now much more informative.
27047
27048* New option -i enters interactive mode after executing a script --
27049useful for debugging.
27050
27051* New option -k raises an exception when an expression statement
27052yields a value other than None.
27053
27054* For each option there is now also a corresponding environment
27055variable.
27056
27057
27058Using Python as an embedded language
27059------------------------------------
27060
27061* The distribution now contains (some) documentation on the use of
27062Python as an "embedded language" in other applications, as well as a
27063simple example. See the file misc/EMBEDDING and the directory embed/.
27064
27065
27066Speed improvements
27067------------------
27068
27069* Function local variables are now generally stored in an array and
27070accessed using an integer indexing operation, instead of through a
27071dictionary lookup. (This compensates the somewhat slower dictionary
27072lookup caused by the generalization of the dictionary module.)
27073
27074
27075Changes to the syntax
27076---------------------
27077
27078* Continuation lines can now *sometimes* be written without a
27079backslash: if the continuation is contained within nesting (), [] or
27080{} brackets the \ may be omitted. There's a much improved
27081python-mode.el in the misc directory which knows about this as well.
27082
27083* You can no longer use an empty set of parentheses to define a class
27084without base classes. That is, you no longer write this:
27085
27086 class Foo(): # syntax error
27087 ...
27088
27089You must write this instead:
27090
27091 class Foo:
27092 ...
27093
27094This was already the preferred syntax in release 0.9.8 but many
27095people seemed not to have picked it up. There's a Python script that
27096fixes old code: demo/scripts/classfix.py.
27097
27098* There's a new reserved word: "access". The syntax and semantics are
Georg Brandleeb575f2009-06-24 06:42:05 +000027099still subject of research and debate (as well as undocumented), but
Guido van Rossuma7925f11994-01-26 10:20:16 +000027100the parser knows about the keyword so you must not use it as a
27101variable, function, or attribute name.
27102
27103
27104Changes to the semantics of the language proper
27105-----------------------------------------------
27106
27107* The following compatibility hack is removed: if a function was
27108defined with two or more arguments, and called with a single argument
27109that was a tuple with just as many arguments, the items of this tuple
27110would be used as the arguments. This is no longer supported.
27111
27112
27113Changes to the semantics of classes and instances
27114-------------------------------------------------
27115
27116* Class variables are now also accessible as instance variables for
27117reading (assignment creates an instance variable which overrides the
27118class variable of the same name though).
27119
27120* If a class attribute is a user-defined function, a new kind of
27121object is returned: an "unbound method". This contains a pointer to
27122the class and can only be called with a first argument which is a
27123member of that class (or a derived class).
27124
27125* If a class defines a method __init__(self, arg1, ...) then this
27126method is called when a class instance is created by the classname()
27127construct. Arguments passed to classname() are passed to the
27128__init__() method. The __init__() methods of base classes are not
27129automatically called; the derived __init__() method must call these if
27130necessary (this was done so the derived __init__() method can choose
27131the call order and arguments for the base __init__() methods).
27132
27133* If a class defines a method __del__(self) then this method is called
27134when an instance of the class is about to be destroyed. This makes it
27135possible to implement clean-up of external resources attached to the
27136instance. As with __init__(), the __del__() methods of base classes
27137are not automatically called. If __del__ manages to store a reference
27138to the object somewhere, its destruction is postponed; when the object
27139is again about to be destroyed its __del__() method will be called
27140again.
27141
27142* Classes may define a method __hash__(self) to allow their instances
27143to be used as dictionary keys. This must return a 32-bit integer.
27144
27145
27146Minor improvements
27147------------------
27148
27149* Function and class objects now know their name (the name given in
27150the 'def' or 'class' statement that created them).
27151
27152* Class instances now know their class name.
27153
27154
27155Additions to built-in operations
27156--------------------------------
27157
27158* The % operator with a string left argument implements formatting
27159similar to sprintf() in C. The right argument is either a single
27160value or a tuple of values. All features of Standard C sprintf() are
27161supported except %p.
27162
27163* Dictionaries now support almost any key type, instead of just
27164strings. (The key type must be an immutable type or must be a class
27165instance where the class defines a method __hash__(), in order to
27166avoid losing track of keys whose value may change.)
27167
27168* Built-in methods are now compared properly: when comparing x.meth1
27169and y.meth2, if x is equal to y and the methods are defined by the
27170same function, x.meth1 compares equal to y.meth2.
27171
27172
27173Additions to built-in functions
27174-------------------------------
27175
27176* str(x) returns a string version of its argument. If the argument is
27177a string it is returned unchanged, otherwise it returns `x`.
27178
27179* repr(x) returns the same as `x`. (Some users found it easier to
27180have this as a function.)
27181
Serhiy Storchaka6a7b3a72016-04-17 08:32:47 +030027182* round(x) returns the floating point number x rounded to a whole
Guido van Rossuma7925f11994-01-26 10:20:16 +000027183number, represented as a floating point number. round(x, n) returns x
27184rounded to n digits.
27185
27186* hasattr(x, name) returns true when x has an attribute with the given
27187name.
27188
27189* hash(x) returns a hash code (32-bit integer) of an arbitrary
27190immutable object's value.
27191
27192* id(x) returns a unique identifier (32-bit integer) of an arbitrary
27193object.
27194
27195* compile() compiles a string to a Python code object.
27196
27197* exec() and eval() now support execution of code objects.
27198
27199
27200Changes to the documented part of the library (standard modules)
27201----------------------------------------------------------------
27202
27203* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
27204the border case '/foo/..' returns '/' instead of ''.
27205
27206* A new function string.find() is added with similar semantics to
27207string.index(); however when it does not find the given substring it
27208returns -1 instead of raising string.index_error.
27209
27210
27211Changes to built-in modules
27212---------------------------
27213
27214* New optional module 'array' implements operations on sequences of
27215integers or floating point numbers of a particular size. This is
27216useful to manipulate large numerical arrays or to read and write
27217binary files consisting of numerical data.
27218
27219* Regular expression objects created by module regex now support a new
27220method named group(), which returns one or more \(...\) groups by number.
27221The number of groups is increased from 10 to 100.
27222
27223* Function compile() in module regex now supports an optional mapping
27224argument; a variable casefold is added to the module which can be used
27225as a standard uppercase to lowercase mapping.
27226
27227* Module time now supports many routines that are defined in the
27228Standard C time interface (<time.h>): gmtime(), localtime(),
27229asctime(), ctime(), mktime(), as well as these variables (taken from
27230System V): timezone, altzone, daylight and tzname. (The corresponding
27231functions in the undocumented module calendar have been removed; the
27232undocumented and unfinished module tzparse is now obsolete and will
27233disappear in a future release.)
27234
27235* Module strop (the fast built-in version of standard module string)
27236now uses C's definition of whitespace instead of fixing it to space,
27237tab and newline; in practice this usually means that vertical tab,
27238form feed and return are now also considered whitespace. It exports
27239the string of characters that are considered whitespace as well as the
27240characters that are considered lowercase or uppercase.
27241
27242* Module sys now defines the variable builtin_module_names, a list of
27243names of modules built into the current interpreter (including not
27244yet imported, but excluding two special modules that always have to be
27245defined -- sys and builtin).
27246
27247* Objects created by module sunaudiodev now also support flush() and
27248close() methods.
27249
27250* Socket objects created by module socket now support an optional
27251flags argument for their methods sendto() and recvfrom().
27252
27253* Module marshal now supports dumping to and loading from strings,
27254through the functions dumps() and loads().
27255
27256* Module stdwin now supports some new functionality. You may have to
27257ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
27258
27259
27260Bugs fixed
27261----------
27262
27263* Fixed comparison of negative long integers.
27264
27265* The tokenizer no longer botches input lines longer than BUFSIZ.
27266
27267* Fixed several severe memory leaks in module select.
27268
27269* Fixed memory leaks in modules socket and sv.
27270
27271* Fixed memory leak in divmod() for long integers.
27272
27273* Problems with definition of floatsleep() on Suns fixed.
27274
27275* Many portability bugs fixed (and undoubtedly new ones added :-).
27276
27277
27278Changes to the build procedure
27279------------------------------
27280
27281* The Makefile supports some new targets: "make default" and "make
27282all". Both are by normally equivalent to "make python".
27283
27284* The Makefile no longer uses $> since it's not supported by all
27285versions of Make.
27286
27287* The header files now all contain #ifdef constructs designed to make
27288it safe to include the same header file twice, as well as support for
27289inclusion from C++ programs (automatic extern "C" { ... } added).
27290
27291
27292Freezing Python scripts
27293-----------------------
27294
27295* There is now some support for "freezing" a Python script as a
27296stand-alone executable binary file. See the script
27297demo/scripts/freeze.py. It will require some site-specific tailoring
27298of the script to get this working, but is quite worthwhile if you write
27299Python code for other who may not have built and installed Python.
27300
27301
27302MS-DOS
27303------
27304
27305* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
27306Marcel van der Peijl! This requires fewer compatibility hacks in
27307posixmodule.c. The executable is not yet available but will be soon
27308(check the mailing list).
27309
27310* The default PYTHONPATH has changed.
27311
27312
27313Changes for developers of extension modules
27314-------------------------------------------
27315
27316* Read src/ChangeLog for full details.
27317
27318
27319SGI specific changes
27320--------------------
27321
27322* Read src/ChangeLog for full details.
27323
Guido van Rossumaa253861994-10-06 17:18:57 +000027324
Guido van Rossuma7925f11994-01-26 10:20:16 +000027325==================================
27326==> Release 0.9.8 (9 Jan 1993) <==
27327==================================
27328
27329I claim no completeness here, but I've tried my best to scan the log
27330files throughout my source tree for interesting bits of news. A more
27331complete account of the changes is to be found in the various
27332ChangeLog files. See also "News for release 0.9.7beta" below if you're
27333still using release 0.9.6, and the file HISTORY if you have an even
27334older release.
27335
27336 --Guido
27337
27338
27339Changes to the language proper
27340------------------------------
27341
27342There's only one big change: the conformance checking for function
27343argument lists (of user-defined functions only) is stricter. Earlier,
27344you could get away with the following:
27345
27346 (a) define a function of one argument and call it with any
27347 number of arguments; if the actual argument count wasn't
27348 one, the function would receive a tuple containing the
Georg Brandleeb575f2009-06-24 06:42:05 +000027349 arguments (an empty tuple if there were none).
Guido van Rossuma7925f11994-01-26 10:20:16 +000027350
27351 (b) define a function of two arguments, and call it with more
27352 than two arguments; if there were more than two arguments,
27353 the second argument would be passed as a tuple containing
27354 the second and further actual arguments.
27355
27356(Note that an argument (formal or actual) that is a tuple is counted as
27357one; these rules don't apply inside such tuples, only at the top level
27358of the argument list.)
27359
27360Case (a) was needed to accommodate variable-length argument lists;
27361there is now an explicit "varargs" feature (precede the last argument
27362with a '*'). Case (b) was needed for compatibility with old class
27363definitions: up to release 0.9.4 a method with more than one argument
27364had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
27365Version 0.9.6 provide better ways to handle both casees, bot provided
27366backward compatibility; version 0.9.8 retracts the compatibility hacks
27367since they also cause confusing behavior if a function is called with
27368the wrong number of arguments.
27369
27370There's a script that helps converting classes that still rely on (b),
27371provided their methods' first argument is called "self":
27372demo/scripts/methfix.py.
27373
27374If this change breaks lots of code you have developed locally, try
27375#defining COMPAT_HACKS in ceval.c.
27376
27377(There's a third compatibility hack, which is the reverse of (a): if a
27378function is defined with two or more arguments, and called with a
27379single argument that is a tuple with just as many arguments, the items
27380of this tuple will be used as the arguments. Although this can (and
27381should!) be done using the built-in function apply() instead, it isn't
27382withdrawn yet.)
27383
27384
27385One minor change: comparing instance methods works like expected, so
27386that if x is an instance of a user-defined class and has a method m,
27387then (x.m==x.m) yields 1.
27388
27389
27390The following was already present in 0.9.7beta, but not explicitly
27391mentioned in the NEWS file: user-defined classes can now define types
27392that behave in almost allrespects like numbers. See
27393demo/classes/Rat.py for a simple example.
27394
27395
27396Changes to the build process
27397----------------------------
27398
27399The Configure.py script and the Makefile has been made somewhat more
27400bullet-proof, after reports of (minor) trouble on certain platforms.
27401
27402There is now a script to patch Makefile and config.c to add a new
27403optional built-in module: Addmodule.sh. Read the script before using!
27404
27405Useing Addmodule.sh, all optional modules can now be configured at
27406compile time using Configure.py, so there are no modules left that
27407require dynamic loading.
27408
27409The Makefile has been fixed to make it easier to use with the VPATH
27410feature of some Make versions (e.g. SunOS).
27411
27412
27413Changes affecting portability
27414-----------------------------
27415
27416Several minor portability problems have been solved, e.g. "malloc.h"
27417has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
27418the system now tolerates malloc(0) returning 0.
27419
27420For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
27421distributed with Python. This solves several minor problems, in
27422particular scripts invoked using #! can now use dynamic loading.
27423
27424
27425Changes to the interpreter interface
27426------------------------------------
27427
27428On popular demand, there's finally a "profile" feature for interactive
27429use of the interpreter. If the environment variable $PYTHONSTARTUP is
27430set to the name of an existing file, Python statements in this file
27431are executed when the interpreter is started in interactive mode.
27432
27433There is a new clean-up mechanism, complementing try...finally: if you
27434assign a function object to sys.exitfunc, it will be called when
27435Python exits or receives a SIGTERM or SIGHUP signal.
27436
27437The interpreter is now generally assumed to live in
27438/usr/local/bin/python (as opposed to /usr/local/python). The script
27439demo/scripts/fixps.py will update old scripts in place (you can easily
27440modify it to do other similar changes).
27441
27442Most I/O that uses sys.stdin/stdout/stderr will now use any object
27443assigned to those names as long as the object supports readline() or
27444write() methods.
27445
27446The parser stack has been increased to 500 to accommodate more
27447complicated expressions (7 levels used to be the practical maximum,
27448it's now about 38).
27449
27450The limit on the size of the *run-time* stack has completely been
27451removed -- this means that tuple or list displays can contain any
27452number of elements (formerly more than 50 would crash the
Victor Stinner554fd082014-03-17 22:33:49 +010027453interpreter).
Guido van Rossuma7925f11994-01-26 10:20:16 +000027454
27455
27456Changes to existing built-in functions and methods
27457--------------------------------------------------
27458
27459The built-in functions int(), long(), float(), oct() and hex() now
27460also apply to class instalces that define corresponding methods
27461(__int__ etc.).
27462
27463
27464New built-in functions
27465----------------------
27466
27467The new functions str() and repr() convert any object to a string.
27468The function repr(x) is in all respects equivalent to `x` -- some
27469people prefer a function for this. The function str(x) does the same
27470except if x is already a string -- then it returns x unchanged
27471(repr(x) adds quotes and escapes "funny" characters as octal escapes).
27472
27473The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
27474
27475
27476Changes to general built-in modules
27477-----------------------------------
27478
27479The time module's functions are more general: time() returns a
27480floating point number and sleep() accepts one. Their accuracies
27481depends on the precision of the system clock. Millisleep is no longer
27482needed (although it still exists for now), but millitimer is still
27483needed since on some systems wall clock time is only available with
27484seconds precision, while a source of more precise time exists that
27485isn't synchronized with the wall clock. (On UNIX systems that support
27486the BSD gettimeofday() function, time.time() is as time.millitimer().)
27487
27488The string representation of a file object now includes an address:
27489'<file 'filename', mode 'r' at #######>' where ###### is a hex number
27490(the object's address) to make it unique.
27491
27492New functions added to posix: nice(), setpgrp(), and if your system
27493supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
27494
27495Improvements to the socket module: socket objects have new methods
27496getpeername() and getsockname(), and the {get,set}sockopt methods can
27497now get/set any kind of option using strings built with the new struct
27498module. And there's a new function fromfd() which creates a socket
27499object given a file descriptor (useful for servers started by inetd,
27500which have a socket connected to stdin and stdout).
27501
27502
27503Changes to SGI-specific built-in modules
27504----------------------------------------
27505
27506The FORMS library interface (fl) now requires FORMS 2.1a. Some new
27507functions have been added and some bugs have been fixed.
27508
27509Additions to al (audio library interface): added getname(),
27510getdefault() and getminmax().
27511
27512The gl modules doesn't call "foreground()" when initialized (this
27513caused some problems) like it dit in 0.9.7beta (but not before).
27514There's a new gl function 'gversion() which returns a version string.
27515
27516The interface to sv (Indigo video interface) has totally changed.
27517(Sorry, still no documentation, but see the examples in
27518demo/sgi/{sv,video}.)
27519
27520
27521Changes to standard library modules
27522-----------------------------------
27523
27524Most functions in module string are now much faster: they're actually
27525implemented in C. The module containing the C versions is called
27526"strop" but you should still import "string" since strop doesn't
27527provide all the interfaces defined in string (and strop may be renamed
27528to string when it is complete in a future release).
27529
27530string.index() now accepts an optional third argument giving an index
27531where to start searching in the first argument, so you can find second
27532and further occurrences (this is similar to the regular expression
27533functions in regex).
27534
27535The definition of what string.splitfields(anything, '') should return
27536is changed for the last time: it returns a singleton list containing
27537its whole first argument unchanged. This is compatible with
27538regsub.split() which also ignores empty delimiter matches.
27539
27540posixpath, macpath: added dirname() and normpath() (and basename() to
27541macpath).
27542
27543The mainloop module (for use with stdwin) can now demultiplex input
27544from other sources, as long as they can be polled with select().
27545
27546
27547New built-in modules
27548--------------------
27549
27550Module struct defines functions to pack/unpack values to/from strings
27551representing binary values in native byte order.
27552
27553Module strop implements C versions of many functions from string (see
27554above).
27555
27556Optional module fcntl defines interfaces to fcntl() and ioctl() --
27557UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
27558
27559Optional module mpz defines an interface to an altaernative long
27560integer implementation, the GNU MPZ library.
27561
27562Optional module md5 uses the GNU MPZ library to calculate MD5
27563signatures of strings.
27564
27565There are also optional new modules specific to SGI machines: imageop
27566defines some simple operations to images represented as strings; sv
27567interfaces to the Indigo video board; cl interfaces to the (yet
27568unreleased) compression library.
27569
27570
27571New standard library modules
27572----------------------------
27573
27574(Unfortunately the following modules are not all documented; read the
27575sources to find out more about them!)
27576
27577autotest: run testall without showing any output unless it differs
27578from the expected output
27579
27580bisect: use bisection to insert or find an item in a sorted list
27581
27582colorsys: defines conversions between various color systems (e.g. RGB
27583<-> YUV)
27584
27585nntplib: a client interface to NNTP servers
27586
27587pipes: utility to construct pipeline from templates, e.g. for
27588conversion from one file format to another using several utilities.
27589
27590regsub: contains three functions that are more or less compatible with
27591awk functions of the same name: sub() and gsub() do string
27592substitution, split() splits a string using a regular expression to
27593define how separators are define.
27594
27595test_types: test operations on the built-in types of Python
27596
27597toaiff: convert various audio file formats to AIFF format
27598
27599tzparse: parse the TZ environment parameter (this may be less general
27600than it could be, let me know if you fix it).
27601
27602(Note that the obsolete module "path" no longer exists.)
27603
27604
27605New SGI-specific library modules
27606--------------------------------
27607
27608CL: constants for use with the built-in compression library interface (cl)
27609
27610Queue: a multi-producer, multi-consumer queue class implemented for
27611use with the built-in thread module
27612
27613SOCKET: constants for use with built-in module socket, e.g. to set/get
27614socket options. This is SGI-specific because the constants to be
27615passed are system-dependent. You can generate a version for your own
27616system by running the script demo/scripts/h2py.py with
27617/usr/include/sys/socket.h as input.
27618
Walter Dörwaldf0dfc7a2003-10-20 14:01:56 +000027619cddb: interface to the database used by the CD player
Guido van Rossuma7925f11994-01-26 10:20:16 +000027620
27621torgb: convert various image file types to rgb format (requires pbmplus)
27622
27623
27624New demos
27625---------
27626
27627There's an experimental interface to define Sun RPC clients and
27628servers in demo/rpc.
27629
27630There's a collection of interfaces to WWW, WAIS and Gopher (both
27631Python classes and program providing a user interface) in demo/www.
27632This includes a program texi2html.py which converts texinfo files to
27633HTML files (the format used hy WWW).
27634
27635The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
27636
27637For SGI systems, there's a whole collection of programs and classes
27638that make use of the Indigo video board in demo/sgi/{sv,video}. This
27639represents a significant amount of work that we're giving away!
27640
27641There are demos "rsa" and "md5test" that exercise the mpz and md5
27642modules, respectively. The rsa demo is a complete implementation of
27643the RSA public-key cryptosystem!
27644
27645A bunch of games and examples submitted by Stoffel Erasmus have been
27646included in demo/stoffel.
27647
27648There are miscellaneous new files in some existing demo
27649subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
27650sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
27651
27652There are also many minor changes to existing files, but I'm too lazy
27653to run a diff and note the differences -- you can do this yourself if
27654you save the old distribution's demos. One highlight: the
27655stdwin/python.py demo is much improved!
27656
27657
27658Changes to the documentation
27659----------------------------
27660
27661The LaTeX source for the library uses different macros to enable it to
27662be converted to texinfo, and from there to INFO or HTML format so it
27663can be browsed as a hypertext. The net result is that you can now
27664read the Python library documentation in Emacs info mode!
27665
27666
27667Changes to the source code that affect C extension writers
27668----------------------------------------------------------
27669
27670The function strdup() no longer exists (it was used only in one places
Georg Brandleeb575f2009-06-24 06:42:05 +000027671and is somewhat of a portability problem since some systems have the
Guido van Rossuma7925f11994-01-26 10:20:16 +000027672same function in their C library.
27673
27674The functions NEW() and RENEW() allocate one spare byte to guard
27675against a NULL return from malloc(0) being taken for an error, but
27676this should not be relied upon.
27677
27678
27679=========================
27680==> Release 0.9.7beta <==
27681=========================
27682
27683
27684Changes to the language proper
27685------------------------------
27686
27687User-defined classes can now implement operations invoked through
27688special syntax, such as x[i] or `x` by defining methods named
27689__getitem__(self, i) or __repr__(self), etc.
27690
27691
27692Changes to the build process
27693----------------------------
27694
27695Instead of extensive manual editing of the Makefile to select
27696compile-time options, you can now run a Configure.py script.
27697The Makefile as distributed builds a minimal interpreter sufficient to
27698run Configure.py. See also misc/BUILD
27699
27700The Makefile now includes more "utility" targets, e.g. install and
27701tags/TAGS
27702
27703Using the provided strtod.c and strtol.c are now separate options, as
27704on the Sun the provided strtod.c dumps core :-(
27705
27706The regex module is now an option chosen by the Makefile, since some
27707(old) C compilers choke on regexpr.c
27708
27709
27710Changes affecting portability
27711-----------------------------
27712
27713You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
27714interface
27715
27716Dynamic loading is now supported for Sun (and other non-COFF systems)
27717throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
27718DL is out, 1.4)
27719
27720The system-dependent code for the use of the select() system call is
27721moved to one file: myselect.h
27722
27723Thanks to Jaap Vermeulen, the code should now port cleanly to the
27724SEQUENT
27725
27726
27727Changes to the interpreter interface
27728------------------------------------
27729
27730The interpretation of $PYTHONPATH in the environment is different: it
27731is inserted in front of the default path instead of overriding it
27732
27733
27734Changes to existing built-in functions and methods
27735--------------------------------------------------
27736
27737List objects now support an optional argument to their sort() method,
27738which is a comparison function similar to qsort(3) in C
27739
27740File objects now have a method fileno(), used by the new select module
27741(see below)
27742
27743
27744New built-in function
27745---------------------
27746
27747coerce(x, y): take two numbers and return a tuple containing them
27748both converted to a common type
27749
27750
27751Changes to built-in modules
27752---------------------------
27753
27754sys: fixed core dumps in settrace() and setprofile()
27755
27756socket: added socket methods setsockopt() and getsockopt(); and
27757fileno(), used by the new select module (see below)
27758
27759stdwin: added fileno() == connectionnumber(), in support of new module
27760select (see below)
27761
27762posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
27763
27764gl: added qgetfd()
27765
27766fl: added several new functions, fixed several obscure bugs, adapted
27767to FORMS 2.1
27768
27769
27770Changes to standard modules
27771---------------------------
27772
27773posixpath: changed implementation of ismount()
27774
27775string: atoi() no longer mistakes leading zero for octal number
27776
27777...
27778
27779
27780New built-in modules
27781--------------------
27782
27783Modules marked "dynamic only" are not configured at compile time but
27784can be loaded dynamically. You need to turn on the DL or DLD option in
27785the Makefile for support dynamic loading of modules (this requires
27786external code).
27787
27788select: interfaces to the BSD select() system call
27789
27790dbm: interfaces to the (new) dbm library (dynamic only)
27791
27792nis: interfaces to some NIS functions (aka yellow pages)
27793
27794thread: limited form of multiple threads (sgi only)
27795
27796audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
27797coding (dynamic only)
27798
27799cd: interface to Indigo SCSI CDROM player audio library (sgi only)
27800
27801jpeg: read files in JPEG format (dynamic only, sgi only; needs
27802external code)
27803
27804imgfile: read SGI image files (dynamic only, sgi only)
27805
27806sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
27807
27808sv: interface to Indigo video library (sgi only)
27809
27810pc: a minimal set of MS-DOS interfaces (MS-DOS only)
27811
27812rotor: encryption, by Lance Ellinghouse (dynamic only)
27813
27814
27815New standard modules
27816--------------------
27817
27818Not all these modules are documented. Read the source:
27819lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
27820additional documentation.
27821
27822imghdr: recognizes image file headers
27823
27824sndhdr: recognizes sound file headers
27825
27826profile: print run-time statistics of Python code
27827
27828readcd, cdplayer: companion modules for built-in module cd (sgi only)
27829
27830emacs: interface to Emacs using py-connect.el (see below).
27831
27832SOCKET: symbolic constant definitions for socket options
27833
27834SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
27835
27836SV: symbolic constat definitions for sv (sgi only)
27837
27838CD: symbolic constat definitions for cd (sgi only)
27839
27840
27841New demos
27842---------
27843
27844scripts/pp.py: execute Python as a filter with a Perl-like command
27845line interface
27846
27847classes/: examples using the new class features
27848
27849threads/: examples using the new thread module
27850
27851sgi/cd/: examples using the new cd module
27852
27853
27854Changes to the documentation
27855----------------------------
27856
27857The last-minute syntax changes of release 0.9.6 are now reflected
27858everywhere in the manuals
27859
27860The reference manual has a new section (3.2) on implementing new kinds
27861of numbers, sequences or mappings with user classes
27862
27863Classes are now treated extensively in the tutorial (chapter 9)
27864
27865Slightly restructured the system-dependent chapters of the library
27866manual
27867
27868The file misc/EXTENDING incorporates documentation for mkvalue() and
27869a new section on error handling
27870
27871The files misc/CLASSES and misc/ERRORS are no longer necessary
27872
27873The doc/Makefile now creates PostScript files automatically
27874
27875
27876Miscellaneous changes
27877---------------------
27878
27879Incorporated Tim Peters' changes to python-mode.el, it's now version
278801.06
27881
27882A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
27883program running in an Emacs buffer execute Emacs lisp code. The
27884necessary Python code is in lib/emacs.py. The Emacs code is
27885misc/py-connect.el (it needs some external Emacs lisp code)
27886
27887
27888Changes to the source code that affect C extension writers
27889----------------------------------------------------------
27890
27891New service function mkvalue() to construct a Python object from C
27892values according to a "format" string a la getargs()
27893
27894Most functions from pythonmain.c moved to new pythonrun.c which is
27895in libpython.a. This should make embedded versions of Python easier
27896
27897ceval.h is split in eval.h (which needs compile.h and only declares
27898eval_code) and ceval.h (which doesn't need compile.hand declares the
27899rest)
27900
27901ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
27902improve the parallellism of multi-threaded programs by letting other
27903Python code run when a blocking system call or something similar is
27904made)
27905
27906In structmember.[ch], new member types BYTE, CHAR and unsigned
27907variants have been added
27908
27909New file xxmodule.c is a template for new extension modules.
27910
Guido van Rossumaa253861994-10-06 17:18:57 +000027911
Guido van Rossuma7925f11994-01-26 10:20:16 +000027912==================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027913==> Release 0.9.6 (6 Apr 1992) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027914==================================
27915
27916Misc news in 0.9.6:
27917- Restructured the misc subdirectory
27918- Reference manual completed, library manual much extended (with indexes!)
27919- the GNU Readline library is now distributed standard with Python
27920- the script "../demo/scripts/classfix.py" fixes Python modules using old
27921 class syntax
27922- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
27923- Because of the GNU copyleft business I am not using the GNU regular
27924 expression implementation but a free re-implementation by Tatu Ylonen
27925 that recently appeared in comp.sources.misc (Bravo, Tatu!)
27926
27927New features in 0.9.6:
27928- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
27929- New module 'os' supplants modules 'mac' and 'posix' for most cases;
27930 module 'path' is replaced by 'os.path'
27931- os.path.split() return value differs from that of old path.split()
27932- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
27933 currently being handled
27934- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
27935 exception
27936- New function string.expandtabs() expands tabs in a string
27937- Added times() interface to posix (user & sys time of process & children)
27938- Added uname() interface to posix (returns OS type, hostname, etc.)
27939- New built-in function execfile() is like exec() but from a file
27940- Functions exec() and eval() are less picky about whitespace/newlines
27941- New built-in functions getattr() and setattr() access arbitrary attributes
27942- More generic argument handling in built-in functions (see "./EXTENDING")
27943- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
27944- Division and modulo for long and plain integers with negative operands
27945 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
27946 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
27947 (a/b, a%b) for integers. For floats, % is also changed, but of course
27948 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
27949- A function with explicit variable-length argument list can be declared
27950 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
27951- Code tracing and profiling features have been added, and two source
27952 code debuggers are provided in the library (pdb.py, tty-oriented,
27953 and wdb, window-oriented); you can now step through Python programs!
27954 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
27955- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
27956 a script that fixes old Python modules
27957- Plain integer right shift now uses sign extension
27958- Long integer shift/mask operations now simulate 2's complement
27959 to give more useful results for negative operands
27960- Changed/added range checks for long/plain integer shifts
27961- Options found after "-c command" are now passed to the command in sys.argv
Martin Panter46f50722016-05-26 05:35:26 +000027962 (note subtle incompatibility with "python -c command -- -options"!)
Guido van Rossuma7925f11994-01-26 10:20:16 +000027963- Module stdwin is better protected against touching objects after they've
27964 been closed; menus can now also be closed explicitly
27965- Stdwin now uses its own exception (stdwin.error)
27966
27967New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
27968- dictionary objects can now be compared properly; e.g., {}=={} is true
27969- new exception SystemExit causes termination if not caught;
27970 it is raised by sys.exit() so that 'finally' clauses can clean up,
27971 and it may even be caught. It does work interactively!
27972- new module "regex" implements GNU Emacs style regular expressions;
27973 module "regexp" is rewritten in Python for backward compatibility
27974- formal parameter lists may contain trailing commas
27975
27976Bugs fixed in 0.9.6:
27977- assigning to or deleting a list item with a negative index dumped core
27978- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
27979
27980Bugs fixed in 0.9.5:
27981- masking operations involving negative long integers gave wrong results
27982
27983
27984===================================
Guido van Rossumf2eac992000-09-04 17:24:24 +000027985==> Release 0.9.4 (24 Dec 1991) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +000027986===================================
27987
27988- new function argument handling (see below)
27989- built-in apply(func, args) means func(args[0], args[1], ...)
27990- new, more refined exceptions
27991- new exception string values (NameError = 'NameError' etc.)
27992- better checking for math exceptions
27993- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
27994- fixed list assignment bug: "a[1:1] = a" now works correctly
27995- new class syntax, without extraneous parentheses
27996- new 'global' statement to assign global variables from within a function
27997
27998
27999New class syntax
28000----------------
28001
28002You can now declare a base class as follows:
28003
28004 class B: # Was: class B():
28005 def some_method(self): ...
28006 ...
28007
28008and a derived class thusly:
28009
28010 class D(B): # Was: class D() = B():
28011 def another_method(self, arg): ...
28012
28013Multiple inheritance looks like this:
28014
28015 class M(B, D): # Was: class M() = B(), D():
28016 def this_or_that_method(self, arg): ...
28017
28018The old syntax is still accepted by Python 0.9.4, but will disappear
28019in Python 1.0 (to be posted to comp.sources).
28020
28021
28022New 'global' statement
28023----------------------
28024
28025Every now and then you have a global variable in a module that you
28026want to change from within a function in that module -- say, a count
28027of calls to a function, or an option flag, etc. Until now this was
28028not directly possible. While several kludges are known that
28029circumvent the problem, and often the need for a global variable can
28030be avoided by rewriting the module as a class, this does not always
28031lead to clearer code.
28032
28033The 'global' statement solves this dilemma. Its occurrence in a
28034function body means that, for the duration of that function, the
28035names listed there refer to global variables. For instance:
28036
28037 total = 0.0
28038 count = 0
28039
28040 def add_to_total(amount):
28041 global total, count
28042 total = total + amount
28043 count = count + 1
28044
28045'global' must be repeated in each function where it is needed. The
28046names listed in a 'global' statement must not be used in the function
28047before the statement is reached.
28048
28049Remember that you don't need to use 'global' if you only want to *use*
28050a global variable in a function; nor do you need ot for assignments to
28051parts of global variables (e.g., list or dictionary items or
28052attributes of class instances). This has not changed; in fact
28053assignment to part of a global variable was the standard workaround.
28054
28055
28056New exceptions
28057--------------
28058
28059Several new exceptions have been defined, to distinguish more clearly
28060between different types of errors.
28061
28062name meaning was
28063
28064AttributeError reference to non-existing attribute NameError
28065IOError unexpected I/O error RuntimeError
28066ImportError import of non-existing module or name NameError
28067IndexError invalid string, tuple or list index RuntimeError
28068KeyError key not in dictionary RuntimeError
28069OverflowError numeric overflow RuntimeError
28070SyntaxError invalid syntax RuntimeError
28071ValueError invalid argument value RuntimeError
28072ZeroDivisionError division by zero RuntimeError
28073
28074The string value of each exception is now its name -- this makes it
28075easier to experimentally find out which operations raise which
28076exceptions; e.g.:
28077
28078 >>> KeyboardInterrupt
28079 'KeyboardInterrupt'
28080 >>>
28081
28082
28083New argument passing semantics
28084------------------------------
28085
28086Off-line discussions with Steve Majewski and Daniel LaLiberte have
28087convinced me that Python's parameter mechanism could be changed in a
28088way that made both of them happy (I hope), kept me happy, fixed a
28089number of outstanding problems, and, given some backward compatibility
28090provisions, would only break a very small amount of existing code --
28091probably all mine anyway. In fact I suspect that most Python users
28092will hardly notice the difference. And yet it has cost me at least
28093one sleepless night to decide to make the change...
28094
28095Philosophically, the change is quite radical (to me, anyway): a
28096function is no longer called with either zero or one argument, which
28097is a tuple if there appear to be more arguments. Every function now
28098has an argument list containing 0, 1 or more arguments. This list is
28099always implemented as a tuple, and it is a (run-time) error if a
28100function is called with a different number of arguments than expected.
28101
28102What's the difference? you may ask. The answer is, very little unless
28103you want to write variadic functions -- functions that may be called
28104with a variable number of arguments. Formerly, you could write a
28105function that accepted one or more arguments with little trouble, but
28106writing a function that could be called with either 0 or 1 argument
28107(or more) was next to impossible. This is now a piece of cake: you
28108can simply declare an argument that receives the entire argument
28109tuple, and check its length -- it will be of size 0 if there are no
28110arguments.
28111
28112Another anomaly of the old system was the way multi-argument methods
28113(in classes) had to be declared, e.g.:
28114
28115 class Point():
28116 def init(self, (x, y, color)): ...
28117 def setcolor(self, color): ...
28118 dev moveto(self, (x, y)): ...
28119 def draw(self): ...
28120
28121Using the new scheme there is no need to enclose the method arguments
28122in an extra set of parentheses, so the above class could become:
28123
28124 class Point:
28125 def init(self, x, y, color): ...
28126 def setcolor(self, color): ...
28127 dev moveto(self, x, y): ...
28128 def draw(self): ...
28129
28130That is, the equivalence rule between methods and functions has
28131changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
28132while formerly it was equivalent to Point.moveto(p,(x,y)).
28133
28134A special backward compatibility rule makes that the old version also
28135still works: whenever a function with exactly two arguments (at the top
28136level) is called with more than two arguments, the second and further
28137arguments are packed into a tuple and passed as the second argument.
28138This rule is invoked independently of whether the function is actually a
28139method, so there is a slight chance that some erroneous calls of
28140functions expecting two arguments with more than that number of
28141arguments go undetected at first -- when the function tries to use the
28142second argument it may find it is a tuple instead of what was expected.
28143Note that this rule will be removed from future versions of the
28144language; it is a backward compatibility provision *only*.
28145
28146Two other rules and a new built-in function handle conversion between
28147tuples and argument lists:
28148
28149Rule (a): when a function with more than one argument is called with a
28150single argument that is a tuple of the right size, the tuple's items
28151are used as arguments.
28152
28153Rule (b): when a function with exactly one argument receives no
28154arguments or more than one, that one argument will receive a tuple
28155containing the arguments (the tuple will be empty if there were no
28156arguments).
28157
28158
28159A new built-in function, apply(), was added to support functions that
28160need to call other functions with a constructed argument list. The call
28161
28162 apply(function, tuple)
28163
28164is equivalent to
28165
28166 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
28167
28168
28169While no new argument syntax was added in this phase, it would now be
28170quite sensible to add explicit syntax to Python for default argument
28171values (as in C++ or Modula-3), or a "rest" argument to receive the
28172remaining arguments of a variable-length argument list.
28173
28174
28175========================================================
28176==> Release 0.9.3 (never made available outside CWI) <==
28177========================================================
28178
28179- string sys.version shows current version (also printed on interactive entry)
28180- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
28181- 'global' statement to declare module-global variables assigned in functions.
28182- new class declaration syntax: class C(Base1, Base2, ...): suite
28183 (the old syntax is still accepted -- be sure to convert your classes now!)
28184- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
28185- C comparison operators: == != (the old = and <> remain valid).
28186- floating point numbers may now start with a period (e.g., .14).
28187- definition of integer division tightened (always truncates towards zero).
28188- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
28189- new list method l.count(x) returns the number of occurrences of x in l.
28190- new SGI module: al (Indigo and 4D/35 audio library).
28191- the FORMS interface (modules fl and FL) now uses FORMS 2.0
28192- module gl: added lrect{read,write}, rectzoom and pixmode;
28193 added (non-GL) functions (un)packrect.
28194- new socket method: s.allowbroadcast(flag).
28195- many objects support __dict__, __methods__ or __members__.
28196- dir() lists anything that has __dict__.
28197- class attributes are no longer read-only.
28198- classes support __bases__, instances support __class__ (and __dict__).
28199- divmod() now also works for floats.
28200- fixed obscure bug in eval('1 ').
28201
28202
28203===================================
28204==> Release 0.9.2 (Autumn 1991) <==
28205===================================
28206
28207Highlights
28208----------
28209
28210- tutorial now (almost) complete; library reference reorganized
28211- new syntax: continue statement; semicolons; dictionary constructors;
28212 restrictions on blank lines in source files removed
28213- dramatically improved module load time through precompiled modules
28214- arbitrary precision integers: compute 2 to the power 1000 and more...
28215- arithmetic operators now accept mixed type operands, e.g., 3.14/4
28216- more operations on list: remove, index, reverse; repetition
28217- improved/new file operations: readlines, seek, tell, flush, ...
28218- process management added to the posix module: fork/exec/wait/kill etc.
28219- BSD socket operations (with example servers and clients!)
28220- many new STDWIN features (color, fonts, polygons, ...)
28221- new SGI modules: font manager and FORMS library interface
28222
28223
28224Extended list of changes in 0.9.2
28225---------------------------------
28226
28227Here is a summary of the most important user-visible changes in 0.9.2,
28228in somewhat arbitrary order. Changes in later versions are listed in
28229the "highlights" section above.
28230
28231
282321. Changes to the interpreter proper
28233
28234- Simple statements can now be separated by semicolons.
28235 If you write "if t: s1; s2", both s1 and s2 are executed
28236 conditionally.
28237- The 'continue' statement was added, with semantics as in C.
28238- Dictionary displays are now allowed on input: {key: value, ...}.
28239- Blank lines and lines bearing only a comment no longer need to
28240 be indented properly. (A completely empty line still ends a multi-
28241 line statement interactively.)
28242- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
28243- Option "-c command" to execute statements from the command line
28244- Compiled versions of modules are cached in ".pyc" files, giving a
28245 dramatic improvement of start-up time
28246- Other, smaller speed improvements, e.g., extracting characters from
28247 strings, looking up single-character keys, and looking up global
28248 variables
28249- Interrupting a print operation raises KeyboardInterrupt instead of
28250 only cancelling the print operation
28251- Fixed various portability problems (it now passes gcc with only
28252 warnings -- more Standard C compatibility will be provided in later
28253 versions)
28254- Source is prepared for porting to MS-DOS
28255- Numeric constants are now checked for overflow (this requires
28256 standard-conforming strtol() and strtod() functions; a correct
28257 strtol() implementation is provided, but the strtod() provided
28258 relies on atof() for everything, including error checking
28259
28260
282612. Changes to the built-in types, functions and modules
28262
28263- New module socket: interface to BSD socket primitives
28264- New modules pwd and grp: access the UNIX password and group databases
28265- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
28266- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
28267- New numeric type: long integer, for unlimited precision
28268 - integer constants suffixed with 'L' or 'l' are long integers
28269 - new built-in function long(x) converts int or float to long
28270 - int() and float() now also convert from long integers
28271- New built-in function:
28272 - pow(x, y) returns x to the power y
28273- New operation and methods for lists:
28274 - l*n returns a new list consisting of n concatenated copies of l
28275 - l.remove(x) removes the first occurrence of the value x from l
28276 - l.index(x) returns the index of the first occurrence of x in l
28277 - l.reverse() reverses l in place
28278- New operation for tuples:
28279 - t*n returns a tuple consisting of n concatenated copies of t
28280- Improved file handling:
28281 - f.readline() no longer restricts the line length, is faster,
28282 and isn't confused by null bytes; same for raw_input()
28283 - f.read() without arguments reads the entire (rest of the) file
28284 - mixing of print and sys.stdout.write() has different effect
28285- New methods for files:
28286 - f.readlines() returns a list containing the lines of the file,
28287 as read with f.readline()
28288 - f.flush(), f.tell(), f.seek() call their stdio counterparts
28289 - f.isatty() tests for "tty-ness"
28290- New posix functions:
28291 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
28292 - popen() returns a file object connected to a pipe
28293 - utime() replaces utimes() (the latter is not a POSIX name)
28294- New stdwin features, including:
28295 - font handling
28296 - color drawing
28297 - scroll bars made optional
28298 - polygons
28299 - filled and xor shapes
28300 - text editing objects now have a 'settext' method
28301
28302
283033. Changes to the standard library
28304
28305- Name change: the functions path.cat and macpath.cat are now called
28306 path.join and macpath.join
28307- Added new modules: formatter, mutex, persist, sched, mainloop
28308- Added some modules and functionality to the "widget set" (which is
28309 still under development, so please bear with me):
28310 DirList, FormSplit, TextEdit, WindowSched
28311- Fixed module testall to work non-interactively
28312- Module string:
28313 - added functions join() and joinfields()
28314 - fixed center() to work correct and make it "transitive"
28315- Obsolete modules were removed: util, minmax
28316- Some modules were moved to the demo directory
28317
28318
283194. Changes to the demonstration programs
28320
28321- Added new useful scipts: byteyears, eptags, fact, from, lfact,
28322 objgraph, pdeps, pi, primes, ptags, which
28323- Added a bunch of socket demos
28324- Doubled the speed of ptags
28325- Added new stdwin demos: microedit, miniedit
28326- Added a windowing interface to the Python interpreter: python (most
28327 useful on the Mac)
28328- Added a browser for Emacs info files: demo/stdwin/ibrowse
28329 (yes, I plan to put all STDWIN and Python documentation in texinfo
28330 form in the future)
28331
28332
283335. Other changes to the distribution
28334
28335- An Emacs Lisp file "python.el" is provided to facilitate editing
28336 Python programs in GNU Emacs (slightly improved since posted to
28337 gnu.emacs.sources)
28338- Some info on writing an extension in C is provided
28339- Some info on building Python on non-UNIX platforms is provided
28340
28341
28342=====================================
28343==> Release 0.9.1 (February 1991) <==
28344=====================================
28345
28346- Micro changes only
28347- Added file "patchlevel.h"
28348
28349
28350=====================================
28351==> Release 0.9.0 (February 1991) <==
28352=====================================
28353
28354Original posting to alt.sources.