blob: 93547ebb4cfc295ebd1b100c58608755f7e920bd [file] [log] [blame]
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001What's new in this release?
Guido van Rossum61000331997-08-15 04:39:58 +00002===========================
3
Guido van Rossumc45cf021998-04-10 20:06:21 +00004Below is a list of all relevant changes since release 1.4. The
5sections are now in a more useful order: the most recent changes are
6listed first.
Guido van Rossum61000331997-08-15 04:39:58 +00007
Guido van Rossum1f83cce1997-10-06 21:04:35 +00008A note on attributions: while I have sprinkled some names throughout
Guido van Rossum7ea639b1997-11-26 16:36:28 +00009here, I'm grateful to many more people who remain unnamed. You may
Guido van Rossum1f83cce1997-10-06 21:04:35 +000010find your name in the ACKS file. If you believe you deserve more
11credit, let me know and I'll add you to the list!
12
13
Guido van Rossum7ea639b1997-11-26 16:36:28 +000014======================================================================
15
Guido van Rossumc45cf021998-04-10 20:06:21 +000016
Guido van Rossumf5475c91998-08-06 17:55:46 +000017From 1.5.1 to 1.5.2a1
18=====================
19
Guido van Rossumab9d6f01998-08-10 22:01:13 +000020General
21-------
22
23- When searching for the library, a landmark that is a compiled module
24(string.pyc or string.pyo) is also accepted.
25
26- When following symbolic links to the python executable, use a loop
27so that a symlink to a symlink can work.
28
29- Added a hack so that when you type 'quit' or 'exit' at the
30interpreter, you get a friendly explanation of how to press Ctrl-D (or
31Ctrl-Z) to exit.
32
33- New and improved Misc/python-mode.el (Python mode for Emacs).
34
Guido van Rossum27b3bc31998-08-11 18:42:26 +000035- Revert a new feature in Unix dynamic loading: for one or two
36revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
37out to be a bad idea.
38
Guido van Rossumab9d6f01998-08-10 22:01:13 +000039Miscellaneous fixed bugs
40------------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +000041
42- All patches on the patch page have been integrated. (But much more
43has been done!)
44
45- Several memory leaks plugged (e.g. the one for classes with a
46__getattr__ method).
47
Guido van Rossumf5475c91998-08-06 17:55:46 +000048- Removed the only use of calloc(). This triggered an obscure bug on
49multiprocessor Sparc Solaris 2.6.
50
Guido van Rossum27b3bc31998-08-11 18:42:26 +000051- Fix a peculiar bug that would allow "import sys.time" to succeed
52(believing the built-in time module to be a part of the sys package).
53
54- Fix a bug in the overflow checking when converting a Python long to
55a C long (failed to convert -2147483648L, and some other cases).
56
Guido van Rossumf5475c91998-08-06 17:55:46 +000057Documentation
58-------------
59
Guido van Rossum27b3bc31998-08-11 18:42:26 +000060- Doc strings have been added to many extension modules: __builtin__,
61errno, select, signal, socket, sys, thread, time. Also to methods of
62list objects (try [].append.__doc__). A doc string on a type will now
63automatically be propagated to an instance if the instance has methods
64that are accessed in the usual way.
65
Guido van Rossumf5475c91998-08-06 17:55:46 +000066- The documentation has been expanded and the formatting improved.
67(Remember that the documentation is now unbundled and has its own
68release cycle though; see http://www.python.org/doc/.)
69
Guido van Rossumab9d6f01998-08-10 22:01:13 +000070- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
71
72Ports and build procedure
73-------------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +000074
75- The BeOS port is now integrated. Courtesy Chris Herborth.
76
77- Symbol files for FreeBSD 2.x and 3.x have been contributed
78(Lib/plat-freebsd[23]/*).
79
Guido van Rossumab9d6f01998-08-10 22:01:13 +000080- Support HPUX 10.20 DCE threads.
Guido van Rossumf5475c91998-08-06 17:55:46 +000081
Guido van Rossumab9d6f01998-08-10 22:01:13 +000082- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
83works, it won't also use -Olimit 1500 (which gives a warning for every
84file). Also support the SGI_ABI environment variable better.
Guido van Rossumf5475c91998-08-06 17:55:46 +000085
Guido van Rossumab9d6f01998-08-10 22:01:13 +000086- The makesetup script now understands absolute pathnames ending in .o
87in the module -- it assumes it's a file for which we have no source.
Guido van Rossumf5475c91998-08-06 17:55:46 +000088
Guido van Rossum27b3bc31998-08-11 18:42:26 +000089- Other miscellaneous improvements to the configure script and
90Makefiles.
91
Guido van Rossumab9d6f01998-08-10 22:01:13 +000092- The test suite now uses a different sound sample.
Guido van Rossumf5475c91998-08-06 17:55:46 +000093
Guido van Rossum27b3bc31998-08-11 18:42:26 +000094Built-in functions
95------------------
Guido van Rossumab9d6f01998-08-10 22:01:13 +000096
97- Better checks for invalid input to int(), long(), string.atoi(),
98string.atol(). (Formerly, a sign without digits would be accepted as
99a legal ways to spell zero.)
100
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000101- Changes to map() and filter() to use the length of a sequence only
102as a hint -- if an IndexError happens earlier, take that. (Formerly,
103this was considered an error.)
104
105- Experimental feature in getattr(): a third argument can specify a
106default (instead of raising AttributeError).
107
108- Implement round() slightly different, so that for negative ndigits
109no additional errors happen in the last step.
110
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000111- The open() function now adds the filename to the exception when it
112fails.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000113
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000114Built-in exceptions
115-------------------
116
117- New standard exceptions EnvironmentError and PosixError.
118EnvironmentError is the base class for IOError and PosixError;
119PosixError is the same as os.error. All this so that either exception
120class can be instantiated with a third argument indicating a filename.
121The built-in function open() and most os/posix functions that take a
122filename argument now use this.
123
124Built-in types
125--------------
126
127- List objects now have an experimental pop() method; l.pop() returns
128and removes the last item; l.pop(i) returns and removes the item at
129i. Also, the sort() method is faster again. Sorting is now also
130safer: it is impossible for the sorting function to modify the list
131while the sort is going on (which could cause core dumps).
132
133- Changes to comparisons: numbers are now smaller than any other type.
134This is done to prevent the circularity where [] < 0L < 1 < [] is
135true. As a side effect, cmp(None, 0) is now positive instead of
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000136negative. This *shouldn't* affect any working code, but I've found
137that the change caused several "sleeping" bugs to become active, so
138beware!
139
140- Instance methods may now have other callable objects than just
141Python functions as their im_func. Use new.instancemethod() or write
142your own C code to create them; new.instancemethod() may be called
143with None for the instance to create an unbound method.
144
145- Assignment to __name__, __dict__ or __bases__ of a class object is
146now allowed (with stringent type checks); also allow assignment to
147__getattr__ etc. The cached values for __getattr__ etc. are
148recomputed after such assignments (but not for derived classes :-( ).
149
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000150- Allow assignment to some attributes of function objects: func_code,
151func_defaults and func_doc / __doc__. (With type checks except for
152__doc__ / func_doc .)
153
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000154Python services
Guido van Rossumf5475c91998-08-06 17:55:46 +0000155---------------
156
157- New tests (in Lib/test): reperf.py (regular expression benchmark),
158sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
159for the MimeWriter module).
160
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000161- Generalized test/regrtest.py so that it is useful for testing other
162packages.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000163
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000164- The ihooks.py module now understands package imports.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000165
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000166- In code.py, add a class that subsumes Fredrik Lundh's
167PythonInterpreter class. The interact() function now uses this.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000168
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000169- In rlcompleter.py, in completer(), return None instead of raising an
170IndexError when there are no more completions left.
171
172- Fixed the marshal module to test for certain common kinds of invalid
173input. (It's still not foolproof!)
174
175- In the operator module, add an alias (now the preferred name)
176"contains" for "sequenceincludes".
177
178String Services
179---------------
180
181- In the string and strop modules, in the replace() function, treat an
182empty pattern as an error (since it's not clear what was meant!).
183
184- Some speedups to re.py, especially the string substitution and split
185functions. Also added new function/method findall(), to find all
186occurrences of a given substring.
187
188- In cStringIO, add better argument type checking and support the
189readonly 'closed' attribute (like regular files).
190
191- In the struct module, unsigned 1-2 byte sized formats no longer
192result in long integer values.
193
194Miscellaneous services
195----------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +0000196
197- In whrandom.py, added new method and function randrange(), same as
198choice(range(start, stop, step)) but faster. This addresses the
199problem that randint() was accidentally defined as taking an inclusive
200range. Also, randint(a, b) is now redefined as randrange(a, b+1),
201adding extra range and type checking to its arguments!
202
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000203- Add some semi-thread-safety to random.gauss() (it used to be able to
204crash when invoked from separate threads; now the worst it can do is
205give a duplicate result occasionally).
206
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000207- Some restructuring and generalization done to cmd.py.
208
209- Major upgrade to ConfigParser.py; converted to using 're', added new
210exceptions, support underscore in section header and option name. No
211longer add 'name' option to every section; instead, add '__name__'.
212
Guido van Rossumf5475c91998-08-06 17:55:46 +0000213- In getpass.py, don't use raw_input() to ask for the password -- we
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000214don't want it to show up in the readline history! Also don't catch
215interrupts (the try-finally already does all necessary cleanup).
Guido van Rossumf5475c91998-08-06 17:55:46 +0000216
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000217Generic OS Services
218-------------------
219
220- New functions in os.py: makedirs(), removedirs(), renames(). New
221variable: linesep (the line separator as found in binary files,
222i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
223this with files opened in (default) text mode; the line separator used
224will always be '\n'!
225
226- Changes to the 'os.path' submodule of os.py: added getsize(),
227getmtime(), getatime() -- these fetch the most popular items from the
228stat return tuple.
229
230- In the time module, add strptime(), if it exists. (This parses a
231time according to a format -- the inverse of strftime().) Also,
232remove the call to mktime() from strftime() -- it messed up the
233formatting of some non-local times.
234
235- In the socket module, added a new function gethostbyname_ex().
236Also, don't use #ifdef to test for some symbols that are enums on some
237platforms (and should exist everywhere).
238
239Optional OS Services
240--------------------
241
242- Some fixes to gzip.py. In particular, the readlines() method now
243returns the lines *with* trailing newline characters, like readlines()
244of regular file objects. Also, it didn't work together with cPickle;
245fixed that.
246
247- In whichdb.py, support byte-swapped dbhash (bsddb) files.
248
249- In anydbm.py, look at the type of an existing database to determine
250which module to use to open it. (The anydbm.error exception is now a
251tuple.)
252
253Unix Services
254-------------
255
256- In the termios module, in tcsetattr(), initialize the structure vy
257calling tcgetattr().
258
259- Added some of the "wait status inspection" macros as functions to
260the posix module (and thus to the os module): WEXITSTATUS(),
261WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
262
263- In the syslog module, make the default facility more intuitive
264(matching the docs).
265
266Debugger
267--------
268
269- In pdb.py, support for setting breaks on files/modules that haven't
270been loaded yet.
271
272Internet Protocols and Support
273------------------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +0000274
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000275- Changes in urllib.py; sped up unquote() and quote(). Fixed an
276obscure bug in quote_plus(). Added urlencode(dict) -- convenience
277function for sending a POST request with urlopen(). Use the getpass
278module to ask for a password. Rewrote the (test) main program so that
279when used as a script, it can retrieve one or more URLs to stdout.
280Use -t to run the self-test. Made the proxy code work again.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000281
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000282- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
283fail when someone asks for their HEAD. Also, for POST, set the
284default content-type to application/x-www-form-urlencoded. Also, in
285FieldStorage.__init__(), when method='GET', always get the query
286string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
287explicitly passed in fp.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000288
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000289- The smtplib.py module now supports ESMTP and has improved standard
290compliance, for picky servers.
291
Guido van Rossumf5475c91998-08-06 17:55:46 +0000292- Improved imaplib.py.
293
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000294- Fixed UDP support in SocketServer.py (it never worked).
Guido van Rossumf5475c91998-08-06 17:55:46 +0000295
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000296- Fixed a small bug in CGIHTTPServer.py.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000297
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000298Internet Data handling
299----------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +0000300
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000301- In rfc822.py, add a new class AddressList. Also support a new
302overridable method, isheader(). Also add a get() method similar to
303dictionaries (and make getheader() an alias for it). Also, be smarter
304about seekable (test whether fp.tell() works) and test for presence of
305unread() method before trying seeks.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000306
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000307- In sgmllib.py, restore the call to report_unbalanced() that was lost
308long ago. Also some other improvements: handle <? processing
309instructions >, allow . and - in entity names, and allow \r\n as line
310separator.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000311
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000312- Some restructuring and generalization done to multifile.py; support
313a 'seekable' flag.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000314
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000315Restricted Execution
316--------------------
Guido van Rossumf5475c91998-08-06 17:55:46 +0000317
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000318- Improvements to rexec.py: package support; support a (minimal)
319sys.exc_info(). Also made the (test) main program a bit fancier (you
320can now use it to run arbitrary Python scripts in restricted mode).
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000321
322Tkinter
323-------
324
325- On Unix, Tkinter can now safely be used from a multi-threaded
326application. (Formerly, no threads would make progress while
327Tkinter's mainloop() was active, because it didn't release the Python
328interpreter lock.) Unfortunately, on Windows, threads other than the
329main thread should not call update() or update_idletasks() because
330this will deadlock the application.
331
332- An interactive interpreter that uses readline and Tkinter no longer
333uses up all available CPU time.
334
335- Even if readline is not used, Tk windows created in an interactive
336interpreter now get continuously updated. (This even works in Windows
337as long as you don't hit a key.)
338
339- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
340
341- No longer register Tcl_finalize() as a low-level exit handler. It
342may call back into Python, and that's a bad idea.
343
344- Allow binding of Tcl commands (given as a string).
345
346- Some minor speedups; replace explicitly coded getint() with int() in
347most places.
348
349- In FileDialog.py, remember the directory of the selected file, if
350given.
351
352- Change the names of all methods in the Wm class: they are now
353wm_title(), etc. The old names (title() etc.) are still defined as
354aliases.
355
356- Add a new method of interpreter objects, interpaddr(). This returns
357the address of the Tcl interpreter object, as an integer. Not very
358useful for the Python programmer, but this can be called by another C
359extension that needs to make calls into the Tcl/Tk C API and needs to
360get the address of the Tcl interpreter object. A simple cast of the
361return value to (Tcl_Interp *) will do the trick.
362
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000363Windows General
364---------------
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000365
366- Don't insist on proper case for module source files if the filename
367is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
368doesn't). This should address problems with this feature on
369oldfashioned filesystems (Novell servers?).
370
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000371Windows Library
372---------------
373
374- os.environ is now all uppercase, but accesses are case insensitive,
375and the putenv() calls made as a side effect of changing os.environ
376are case preserving.
377
378- Removed samefile(), sameopenfile(), samestat() from os.path (aka
379ntpath.py) -- these cannot be made to work reliably (at least I
380wouldn't know how).
381
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000382- Fixed os.pipe() so that it returns file descriptors acceptable to
383os.read() and os.write() (like it does on Unix), rather than Windows
384file handles.
385
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000386- Added a table of WSA error codes to socket.py.
387
388- In the select module, put the (huge) file descriptor arrays on the
389heap.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000390
391- The getpass module now raises KeyboardInterrupt when it sees ^C.
392
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000393- In mailbox.py, fix tell/seek when using files opened in text mode.
394
395- In rfc822.py, fix tell/seek when using files opened in text mode.
396
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000397- In the msvcrt extension module, release the interpreter lock for
398calls that may block: _locking(), _getch(), _getche(). Also fix a
399bogus error return when open_osfhandle() doesn't have the right
400argument list.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000401
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000402Windows Installer
403-----------------
404
405- The registry key used is now "1.5" instead of "1.5.x" -- so future
406versions of 1.5 and Mark Hammond's win32all installer don't need to be
407resynchronized.
408
409Windows Tools
410-------------
411
412- Several improvements to freeze specifically for Windows.
413
414Windows Build Procedure
415-----------------------
416
417- The VC++ project files and the WISE installer have been moved to the
418PCbuild subdirectory, so they are distributed in the same subdirectory
419where they must be used. This avoids confusion.
420
421- New project files for Windows 3.1 port by Jim Ahlstrom.
422
423- Got rid of the obsolete subdirectory PC/setup_nt/.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000424
425- The projects now use distinct filenames for the .exe, .dll, .lib and
426.pyd files built in debug mode (by appending "_d" to the base name,
427before the extension). This makes it easier to switch between the two
428and get the right versions. There's a pragma in config.h that directs
429the linker to include the appropriate .lib file (so python15.lib no
430longer needs to be explicit in your project).
431
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000432- The installer now installs more files (e.g. config.h). The idea is
433that you shouldn't need the source distribution if you want build your
434own extensions in C or C++.
435
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000436Tools and Demos
Guido van Rossumf5475c91998-08-06 17:55:46 +0000437---------------
438
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000439- New script nm2def.py by Marc-Andre Lemburg, to construct
440PC/python_nt.def automatically (some hand editing still required).
Guido van Rossumf5475c91998-08-06 17:55:46 +0000441
442- New tool ndiff.py: Tim Peters' text diffing tool.
443
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000444- Various and sundry improvements to the freeze script.
445
Guido van Rossumf5475c91998-08-06 17:55:46 +0000446- The script texi2html.py (which was part of the Doc tree but is no
447longer used there) has been moved to the Tools/scripts subdirectory.
448
449- Some generalizations in the webchecker code. There's now a
450primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
451
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000452- The ftpmirror.py script now handles symbolic links properly, and
453also files with multiple spaces in their names.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000454
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000455- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
456last line is both indented and lacks a newline. This is now fixed.
Guido van Rossumf5475c91998-08-06 17:55:46 +0000457
458Python/C API
459------------
460
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000461- Added missing prototypes for PyEval_CallFunction() and
462PyEval_CallMethod().
463
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000464- New macro PyList_SET_ITEM().
Guido van Rossumf5475c91998-08-06 17:55:46 +0000465
466- New macros to access object members for PyFunction, PyCFunction
467objects.
468
469- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
470dynamically add one or many entries to the table of built-in modules.
471
472- New macro Py_InitModule3(name, methods, doc) which calls
473Py_InitModule4() with appropriate arguments. (The -4 variant requires
474you to pass an obscure version number constant which is always the same.)
475
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000476- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
477sys.stdout or sys.stderr using a printf-like interface. (Used in
478_tkinter.c, for example.)
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000479
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000480- New APIs for conversion between Python longs and C 'long long' if
481your compiler supports it.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000482
483- PySequence_In() is now called PySequence_Contains().
484(PySequence_In() is still supported for b/w compatibility; it is
485declared obsolete because its argument order is confusing.)
486
487- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
488*never* raise an exception -- (even if the hash() fails, simply clear
489the error). This was necessary because there is lots of code out
490there that already assumes this.
491
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000492- Changes to PySequence_Tuple() and PySequence_List() to use the
493length of a sequence only as a hint -- if an IndexError happens
494earlier, take that. (Formerly, this was considered an error.)
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000495
Guido van Rossum27b3bc31998-08-11 18:42:26 +0000496- Reformatted abstract.c to give it a more familiar "look" and fixed
497many error checking bugs.
498
499- Add NULL pointer checks to all calls of a C function through a type
500object and extensions (e.g. nb_add).
501
502- The code that initializes sys.path now calls Py_GetPythonHome()
503instead of getenv("PYTHONHOME"). This, together with the new API
504Py_SetPythonHome(), makes it easier for embedding applications to
505change the notion of Python's "home" directory (where the libraries
506etc. are sought).
507
508- Fixed a very old bug in the parsing of "O?" format specifiers.
Guido van Rossumab9d6f01998-08-10 22:01:13 +0000509
510
511======================================================================
512
513
Guido van Rossumc45cf021998-04-10 20:06:21 +0000514From 1.5 to 1.5.1
515=================
516
517General
518-------
519
520- The documentation is now unbundled. It has also been extensively
521modified (mostly to implement a new and more uniform formatting
522style). We figure that most people will prefer to download one of the
523preformatted documentation sets (HTML, PostScript or PDF) and that
524only a minority have a need for the LaTeX or FrameMaker sources. Of
525course, the unbundled documentation sources still released -- just not
526in the same archive file, and perhaps not on the same date.
527
528- All bugs noted on the errors page (and many unnoted) are fixed. All
529new bugs take their places.
530
Guido van Rossum974f2951998-04-13 21:00:54 +0000531- No longer a core dump when attempting to print (or repr(), or str())
532a list or dictionary that contains an instance of itself; instead, the
533recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
534Py_ReprLeave() below. Comparisons of such objects still go beserk,
535since this requires a different kind of fix; fortunately, this is a
536less common scenario in practice.
537
Guido van Rossumc45cf021998-04-10 20:06:21 +0000538Syntax change
539-------------
540
541- The raise statement can now be used without arguments, to re-raise
542a previously set exception. This should be used after catching an
543exception with an except clause only, either in the except clause or
544later in the same function.
545
546Import and module handling
547--------------------------
548
549- The implementation of import has changed to use a mutex (when
550threading is supported). This means that when two threads
551simultaneously import the same module, the import statements are
552serialized. Recursive imports are not affected.
553
554- Rewrote the finalization code almost completely, to be much more
555careful with the order in which modules are destroyed. Destructors
Guido van Rossumfc8f5d11998-08-04 22:58:51 +0000556will now generally be able to reference built-in names such as None
Guido van Rossumc45cf021998-04-10 20:06:21 +0000557without trouble.
558
Guido van Rossum974f2951998-04-13 21:00:54 +0000559- Case-insensitive platforms such as Mac and Windows require the case
560of a module's filename to match the case of the module name as
561specified in the import statement (see below).
Guido van Rossumc45cf021998-04-10 20:06:21 +0000562
563- The code for figuring out the default path now distinguishes between
564files, modules, executable files, and directories. When expecting a
565module, we also look for the .pyc or .pyo file.
566
567Parser/tokenizer changes
568------------------------
569
570- The tokenizer can now warn you when your source code mixes tabs and
Guido van Rossum974f2951998-04-13 21:00:54 +0000571spaces for indentation in a manner that depends on how much a tab is
572worth in spaces. Use "python -t" or "python -v" to enable this
573option. Use "python -tt" to turn the warnings into errors. (See also
574tabnanny.py and tabpolice.py below.)
Guido van Rossumc45cf021998-04-10 20:06:21 +0000575
576- Return unsigned characters from tok_nextc(), so '\377' isn't
577mistaken for an EOF character.
578
579- Fixed two pernicious bugs in the tokenizer that only affected AIX.
580One was actually a general bug that was triggered by AIX's smaller I/O
581buffer size. The other was a bug in the AIX optimizer's loop
582unrolling code; swapping two statements made the problem go away.
583
584Tools, demos and miscellaneous files
585------------------------------------
586
587- There's a new version of Misc/python-mode.el (the Emacs mode for
588Python) which is much smarter about guessing the indentation style
589used in a particular file. Lots of other cool features too!
590
591- There are two new tools in Tools/scripts: tabnanny.py and
592tabpolice.py, implementing two different ways of checking whether a
593file uses indentation in a way that is sensitive to the interpretation
594of a tab. The preferred module is tabnanny.py (by Tim Peters).
595
596- Some new demo programs:
597
598 Demo/tkinter/guido/paint.py -- Dave Mitchell
599 Demo/sockets/unixserver.py -- Piet van Oostrum
600
601
602- Much better freeze support. The freeze script can now freeze
603hierarchical module names (with a corresponding change to import.c),
604and has a few extra options (e.g. to suppress freezing specific
605modules). It also does much more on Windows NT.
606
607- Version 1.0 of the faq wizard is included (only very small changes
608since version 0.9.0).
609
610- New feature for the ftpmirror script: when removing local files
611(i.e., only when -r is used), do a recursive delete.
612
613Configuring and building Python
614-------------------------------
615
616- Get rid of the check for -linet -- recent Sequent Dynix systems don't
617need this any more and apparently it screws up their configuration.
618
619- Some changes because gcc on SGI doesn't support '-all'.
620
621- Changed the build rules to use $(LIBRARY) instead of
622 -L.. -lpython$(VERSION)
623since the latter trips up the SunOS 4.1.x linker (sigh).
624
625- Fix the bug where the '# dgux is broken' comment in the Makefile
626tripped over Make on some platforms.
627
628- Changes for AIX: install the python.exp file; properly use
629$(srcdir); the makexp_aix script now removes C++ entries of the form
630Class::method.
631
632- Deleted some Makefile targets only used by the (long obsolete)
633gMakefile hacks.
634
635Extension modules
636-----------------
637
638- Performance and threading improvements to the socket and bsddb
639modules, by Christopher Lindblad of Infoseek.
640
641- Added operator.__not__ and operator.not_.
642
643- In the thread module, when a thread exits due to an unhandled
644exception, don't store the exception information in sys.last_*; it
645prevents proper calling of destructors of local variables.
646
647- Fixed a number of small bugs in the cPickle module.
648
649- Changed find() and rfind() in the strop module so that
650find("x","",2) returns -1, matching the implementation in string.py.
651
652- In the time module, be more careful with the result of ctime(), and
653test for HAVE_MKTIME before usinmg mktime().
654
655- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
656modules.
657
658- Added the LOG_SYSLOG constant to the syslog module, if defined.
659
660Standard library modules
661------------------------
662
663- All standard library modules have been converted to an indentation
664style using either only tabs or only spaces -- never a mixture -- if
Guido van Rossum974f2951998-04-13 21:00:54 +0000665they weren't already consistent according to tabnanny. This means
666that the new -t option (see above) won't complain about standard
667library modules.
Guido van Rossumc45cf021998-04-10 20:06:21 +0000668
669- New standard library modules:
670
671 threading -- GvR and the thread-sig
672 Java style thread objects -- USE THIS!!!
673
674 getpass -- Piers Lauder
675 simple utilities to prompt for a password and to
676 retrieve the current username
677
678 imaplib -- Piers Lauder
679 interface for the IMAP4 protocol
680
681 poplib -- David Ascher, Piers Lauder
682 interface for the POP3 protocol
683
684 smtplib -- Dragon De Monsyne
685 interface for the SMTP protocol
686
687- Some obsolete modules moved to a separate directory (Lib/lib-old)
688which is *not* in the default module search path:
689
690 Para
691 addpack
692 codehack
693 fmt
694 lockfile
695 newdir
696 ni
697 rand
698 tb
699
700- New version of the PCRE code (Perl Compatible Regular Expressions --
701the re module and the supporting pcre extension) by Andrew Kuchling.
702Incompatible new feature in re.sub(): the handling of escapes in the
703replacement string has changed.
704
Guido van Rossum974f2951998-04-13 21:00:54 +0000705- Interface change in the copy module: a __deepcopy__ method is now
706called with the memo dictionary as an argument.
Guido van Rossumc45cf021998-04-10 20:06:21 +0000707
708- Feature change in the tokenize module: differentiate between NEWLINE
709token (an official newline) and NL token (a newline that the grammar
710ignores).
711
712- Several bugfixes to the urllib module. It is now truly thread-safe,
713and several bugs and a portability problem have been fixed. New
714features, all due to Sjoerd Mullender: When creating a temporary file,
715it gives it an appropriate suffix. Support the "data:" URL scheme.
716The open() method uses the tempcache.
717
718- New version of the xmllib module (this time with a test suite!) by
719Sjoerd Mullender.
720
721- Added debugging code to the telnetlib module, to be able to trace
722the actual traffic.
723
724- In the rfc822 module, added support for deleting a header (still no
725support for adding headers, though). Also fixed a bug where an
726illegal address would cause a crash in getrouteaddr(), fixed a
727sign reversal in mktime_tz(), and use the local timezone by default
728(the latter two due to Bill van Melle).
729
730- The normpath() function in the dospath and ntpath modules no longer
731does case normalization -- for that, use the separate function
732normcase() (which always existed); normcase() has been sped up and
733fixed (it was the cause of a crash in Mark Hammond's installer in
734certain locales).
735
736- New command supported by the ftplib module: rmd(); also fixed some
737minor bugs.
738
739- The profile module now uses a different timer function by default --
740time.clock() is generally better than os.times(). This makes it work
741better on Windows NT, too.
742
743- The tempfile module now recovers when os.getcwd() raises an
744exception.
745
746- Fixed some bugs in the random module; gauss() was subtly wrong, and
747vonmisesvariate() should return a full circle. Courtesy Mike Miller,
748Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
749
750- Better default seed in the whrandom module, courtesy Andrew Kuchling.
751
752- Fix slow close() in shelve module.
753
754- The Unix mailbox class in the mailbox module is now more robust when
755a line begins with the string "From " but is definitely not the start
756of a new message. The pattern used can be changed by overriding a
757method or class variable.
758
759- Added a rmtree() function to the copy module.
760
761- Fixed several typos in the pickle module. Also fixed problems when
762unpickling in restricted execution environments.
763
764- Added docstrings and fixed a typo in the py_compile and compileall
765modules. At Mark Hammond's repeated request, py_compile now append a
766newline to the source if it needs one. Both modules support an extra
767parameter to specify the purported source filename (to be used in
768error messages).
769
770- Some performance tweaks by Jeremy Hylton to the gzip module.
771
772- Fixed a bug in the merge order of dictionaries in the ConfigParser
773module. Courtesy Barry Warsaw.
774
775- In the multifile module, support the optional second parameter to
776seek() when possible.
777
778- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
779urlparse now correctly handles Gopher URLs with query strings.
780
781- Fixed a tiny bug in format_exception() in the traceback module.
782Also rewrite tb_lineno() to be compatible with JPython (and not
783disturb the current exception!); by Jim Hugunin.
784
785- The httplib module is more robust when servers send a short response
786-- courtesy Tim O'Malley.
787
788Tkinter and friends
789-------------------
790
791- Various typos and bugs fixed.
792
793- New module Tkdnd implements a drag-and-drop protocol (within one
794application only).
795
796- The event_*() widget methods have been restructured slightly -- they
797no longer use the default root.
798
799- The interfaces for the bind*() and unbind() widget methods have been
800redesigned; the bind*() methods now return the name of the Tcl command
801created for the callback, and this can be passed as a optional
802argument to unbind() in order to delete the command (normally, such
803commands are automatically unbound when the widget is destroyed, but
804for some applications this isn't enough).
805
806- Variable objects now have trace methods to interface to Tcl's
807variable tracing facilities.
808
809- Image objects now have an optional keyword argument, 'master', to
810specify a widget (tree) to which they belong. The image_names() and
811image_types() calls are now also widget methods.
812
813- There's a new global call, Tkinter.NoDefaultRoot(), which disables
814all use of the default root by the Tkinter library. This is useful to
815debug applications that are in the process of being converted from
816relying on the default root to explicit specification of the root
817widget.
818
819- The 'exit' command is deleted from the Tcl interpreter, since it
820provided a loophole by which one could (accidentally) exit the Python
821interpreter without invoking any cleanup code.
822
823- Tcl_Finalize() is now registered as a Python low-level exit handle,
824so Tcl will be finalized when Python exits.
825
826The Python/C API
827----------------
828
Guido van Rossum974f2951998-04-13 21:00:54 +0000829- New function PyThreadState_GetDict() returns a per-thread dictionary
830intended for storing thread-local global variables.
831
832- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
833dictionary to allow recursive container types to detect recursion in
834their repr(), str() and print implementations.
835
Guido van Rossumc45cf021998-04-10 20:06:21 +0000836- New function PyObject_Not(x) calculates (not x) according to Python's
837standard rules (basically, it negates the outcome PyObject_IsTrue(x).
838
839- New function _PyModule_Clear(), which clears a module's dictionary
840carefully without removing the __builtins__ entry. This is implied
841when a module object is deallocated (this used to clear the dictionary
842completely).
843
844- New function PyImport_ExecCodeModuleEx(), which extends
845PyImport_ExecCodeModule() by adding an extra parameter to pass it the
846true file.
847
848- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
849allow embedded applications to force a different value for PYTHONHOME.
850
851- New global flag Py_FrozenFlag is set when this is a "frozen" Python
852binary; it suppresses warnings about not being able to find the
853standard library directories.
854
855- New global flag Py_TabcheckFlag is incremented by the -t option and
856causes the tokenizer to issue warnings or errors about inconsistent
857mixing of tabs and spaces for indentation.
858
859Miscellaneous minor changes and bug fixes
860-----------------------------------------
861
862- Improved the error message when an attribute of an attribute-less
863object is requested -- include the name of the attribute and the type
864of the object in the message.
865
866- Sped up int(), long(), float() a bit.
867
868- Fixed a bug in list.sort() that would occasionally dump core.
869
870- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
871when taken tothe real power.
872
873- Fixed a number of bugs in the file reading code, at least one of
874which could cause a core dump on NT, and one of which would
875occasionally cause file.read() to return less than the full contents
876of the file.
877
878- Performance hack by Vladimir Marangozov for stack frame creation.
879
880- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
881
Guido van Rossum974f2951998-04-13 21:00:54 +0000882Windows 95/NT
883-------------
884
885- The .lib files are now part of the distribution; they are collected
886in the subdirectory "libs" of the installation directory.
887
888- The extension modules (.pyd files) are now collected in a separate
889subdirectory of the installation directory named "DLLs".
890
891- The case of a module's filename must now match the case of the
892module name as specified in the import statement. This is an
893experimental feature -- if it turns out to break in too many
894situations, it will be removed (or disabled by default) in the future.
895It can be disabled on a per-case basis by setting the environment
896variable PYTHONCASEOK (to any value).
897
898
Guido van Rossumc45cf021998-04-10 20:06:21 +0000899======================================================================
900
901
902From 1.5b2 to 1.5
903=================
904
905- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
906
907- Added doc strings to string.py, stropmodule.c, structmodule.c,
908thanks to Charles Waldman.
909
910- Many nits fixed in the manuals, thanks to Fred Drake and many others
911(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
912HTML markup instead of inline GIF images for tables; only two images
913are left (for obsure bits of math). The index of the HTML version has
914also been much improved. Finally, it is once again possible to
915generate an Emacs info file from the library manual (but I don't
916commit to supporting this in future versions).
917
918- New module: telnetlib.py (a simple telnet client library).
919
920- New tool: Tools/versioncheck/, by Jack Jansen.
921
922- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
923DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
924extension modules.
925
926- Many small changes again to Tkinter.py -- mostly bugfixes and adding
927missing routines. Thanks to Greg McFarlane for reporting a bunch of
928problems and proofreading my fixes.
929
930- The re module and its documentation are up to date with the latest
931version released to the string-sig (Dec. 22).
932
933- Stop test_grp.py from failing when the /etc/group file is empty
934(yes, this happens!).
935
936- Fix bug in integer conversion (mystrtoul.c) that caused
9374294967296==0 to be true!
938
939- The VC++ 4.2 project file should be complete again.
940
941- In tempfile.py, use a better template on NT, and add a new optional
942argument "suffix" with default "" to specify a specific extension for
943the temporary filename (needed sometimes on NT but perhaps also handy
944elsewhere).
945
946- Fixed some bugs in the FAQ wizard, and converted it to use re
947instead of regex.
948
949- Fixed a mysteriously undetected error in dlmodule.c (it was using a
950totally bogus routine name to raise an exception).
951
952- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
953
954- Hopefully harmless changes to the build process to support shared
955libraries on DG/UX. This adds a target to create
956libpython$(VERSION).so; however this target is *only* for DG/UX.
957
958- Fixed a bug in the new format string error checking in getargs.c.
959
960- A simple fix for infinite recursion when printing __builtins__:
961reset '_' to None before printing and set it to the printed variable
962*after* printing (and only when printing is successful).
963
964- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
965parent window is not (Skip Montanaro).
966
967- Fixed the two most annoying problems with ftp URLs in
968urllib.urlopen(); an empty file now correctly raises an error, and it
969is no longer required to explicitly close the returned "file" object
970before opening another ftp URL to the same host and directory.
971
972
973======================================================================
974
975
976From 1.5b1 to 1.5b2
977===================
978
979- Fixed a bug in cPickle.c that caused it to crash right away because
980the version string had a different format.
981
982- Changes in pickle.py and cPickle.c: when unpickling an instance of a
983class that doesn't define the __getinitargs__() method, the __init__()
984constructor is no longer called. This makes a much larger group of
985classes picklable by default, but may occasionally change semantics.
986To force calling __init__() on unpickling, define a __getinitargs__()
987method. Other changes too, in particular cPickle now handles classes
988defined in packages correctly. The same change applies to copying
989instances with copy.py. The cPickle.c changes and some pickle.py
990changes are courtesy Jim Fulton.
991
992- Locale support in he "re" (Perl regular expressions) module. Use
993the flag re.L (or re.LOCALE) to enable locale-specific matching
994rules for \w and \b. The in-line syntax for this flag is (?L).
995
996- The built-in function isinstance(x, y) now also succeeds when y is
997a type object and type(x) is y.
998
999- repr() and str() of class and instance objects now reflect the
1000package/module in which the class is defined.
1001
1002- Module "ni" has been removed. (If you really need it, it's been
1003renamed to "ni1". Let me know if this causes any problems for you.
1004Package authors are encouraged to write __init__.py files that
1005support both ni and 1.5 package support, so the same version can be
1006used with Python 1.4 as well as 1.5.)
1007
1008- The thread module is now automatically included when threads are
1009configured. (You must remove it from your existing Setup file,
1010since it is now in its own Setup.thread file.)
1011
1012- New command line option "-x" to skip the first line of the script;
1013handy to make executable scripts on non-Unix platforms.
1014
1015- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
1016haven't checked how this affects things, but it should make symbols
1017in one shared library available to the next one.
1018
1019- The Windows installer now installs in the "Program Files" folder on
1020the proper volume by default.
1021
1022- The Windows configuration adds a new main program, "pythonw", and
1023registers a new extension, ".pyw" that invokes this. This is a
1024pstandard Python interpreter that does not pop up a console window;
1025handy for pure Tkinter applications. All output to the original
1026stdout and stderr is lost; reading from the original stdin yields
1027EOF. Also, both python.exe and pythonw.exe now have a pretty icon
1028(a green snake in a box, courtesy Mark Hammond).
1029
1030- Lots of improvements to emacs-mode.el again. See Barry's web page:
1031http://www.python.org/ftp/emacs/pmdetails.html.
1032
1033- Lots of improvements and additions to the library reference manual;
1034many by Fred Drake.
1035
1036- Doc strings for the following modules: rfc822.py, posixpath.py,
1037ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
1038
1039- Some more regression testing.
1040
1041- An optional 4th (maxsplit) argument to strop.replace().
1042
1043- Fixed handling of maxsplit in string.splitfields().
1044
1045- Tweaked os.environ so it can be pickled and copied.
1046
1047- The portability problems caused by indented preprocessor commands
1048and C++ style comments should be gone now.
1049
1050- In random.py, added Pareto and Weibull distributions.
1051
1052- The crypt module is now disabled in Modules/Setup.in by default; it
1053is rarely needed and causes errors on some systems where users often
1054don't know how to deal with those.
1055
1056- Some improvements to the _tkinter build line suggested by Case Roole.
1057
1058- A full suite of platform specific files for NetBSD 1.x, submitted by
1059Anders Andersen.
1060
1061- New Solaris specific header STROPTS.py.
1062
1063- Moved a confusing occurrence of *shared* from the comments in
1064Modules/Setup.in (people would enable this one instead of the real
1065one, and get disappointing results).
1066
1067- Changed the default mode for directories to be group-writable when
1068the installation process creates them.
1069
1070- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
1071shared libraries for both.
1072
1073- Support FreeBSD and NetBSD in posixfile.py.
1074
1075- Support for the "event" command, new in Tk 4.2. By Case Roole.
1076
1077- Add Tix_SafeInit() support to tkappinit.c.
1078
1079- Various bugs fixed in "re.py" and "pcre.c".
1080
1081- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
1082
1083- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
1084is set.
1085
1086- Provide default blocksize for retrbinary in ftplib.py (Skip
1087Montanaro).
1088
1089- In NT, pick the username up from different places in user.py (Jeff
1090Bauer).
1091
1092- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
1093
1094- Many small improvements to Jeff Rush' OS/2 support.
1095
1096- ospath.py is gone; it's been obsolete for so many years now...
1097
1098- The reference manual is now set up to prepare better HTML (still
1099using webmaker, alas).
1100
1101- Add special handling to /Tools/freeze for Python modules that are
1102imported implicitly by the Python runtime: 'site' and 'exceptions'.
1103
1104- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
1105inside <PRE>, by "Scott".
1106
1107- Added ConfigParser.py, a generic parser for sectioned configuration
1108files.
1109
1110- In _localemodule.c, LC_MESSAGES is not always defined; put it
1111between #ifdefs.
1112
1113- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
1114
1115- Demo/scripts/newslist.py: Fix the way the version number is gotten
1116out of the RCS revision.
1117
1118- PyArg_Parse[Tuple] now explicitly check for bad characters at the
1119end of the format string.
1120
1121- Revamped PC/example_nt to support VC++ 5.x.
1122
1123- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
1124after studying the GNU libg++ quicksort. This should be much faster
1125if there are lots of duplicates, and otherwise at least as good.
1126
1127- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
1128uudecode bug where it complaints about trailing garbage is still there
1129:-( ).
1130
1131- pickle.py requires integers in text mode to be in decimal notation
1132(it used to accept octal and hex, even though it would only generate
1133decimal numbers).
1134
1135- In string.atof(), don't fail when the "re" module is unavailable.
1136Plug the ensueing security leak by supplying an empty __builtins__
1137directory to eval().
1138
1139- A bunch of small fixes and improvements to Tkinter.py.
1140
1141- Fixed a buffer overrun in PC/getpathp.c.
1142
1143
1144======================================================================
1145
1146
1147From 1.5a4 to 1.5b1
1148===================
1149
1150- The Windows NT/95 installer now includes full HTML of all manuals.
1151It also has a checkbox that lets you decide whether to install the
1152interpreter and library. The WISE installer script for the installer
1153is included in the source tree as PC/python15.wse, and so are the
1154icons used for Python files. The config.c file for the Windows build
1155is now complete with the pcre module.
1156
1157- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
1158evaluated for the prompt.
1159
1160- The reference manual is brought up to date (more or less -- it still
1161needs work, e.g. in the area of package import).
1162
1163- The icons used by latex2html are now included in the Doc
1164subdirectory (mostly so that tarring up the HTML files can be fully
1165automated). A simple index.html is also added to Doc (it only works
1166after you have successfully run latex2html).
1167
1168- For all you would-be proselytizers out there: a new version of
1169Misc/BLURB describes Python more concisely, and Misc/comparisons
1170compares Python to several other languages. Misc/BLURB.WINDOWS
1171contains a blurb specifically aimed at Windows programmers (by Mark
1172Hammond).
1173
1174- A new version of the Python mode for Emacs is included as
1175Misc/python-mode.el. There are too many new features to list here.
1176See http://www.python.org/ftp/emacs/pmdetails.html for more info.
1177
1178- New module fileinput makes iterating over the lines of a list of
1179files easier. (This still needs some more thinking to make it more
1180extensible.)
1181
1182- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
1183version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
1184Age C++ compiler. I expect that Jeff will also provide a binary
1185release for this platform.
1186
1187- On Linux, the configure script now uses '-Xlinker -export-dynamic'
1188instead of '-rdynamic' to link the main program so that it exports its
1189symbols to shared libraries it loads dynamically. I hope this doesn't
1190break on older Linux versions; it is needed for mklinux and appears to
1191work on Linux 2.0.30.
1192
1193- Some Tkinter resstructuring: the geometry methods that apply to a
1194master are now properly usable on toplevel master widgets. There's a
1195new (internal) widget class, BaseWidget. New, longer "official" names
1196for the geometry manager methods have been added,
1197e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
1198shorter names still work, and where there's ambiguity, pack wins over
1199place wins over grid. Also, the bind_class method now returns its
1200value.
1201
1202- New, RFC-822 conformant parsing of email addresses and address lists
1203in the rfc822 module, courtesy Ben Escoto.
1204
1205- New, revamped tkappinit.c with support for popular packages (PIL,
1206TIX, BLT, TOGL). For the last three, you need to execute the Tcl
1207command "load {} Tix" (or Blt, or Togl) to gain access to them.
1208The Modules/Setup line for the _tkinter module has been rewritten
1209using the cool line-breaking feature of most Bourne shells.
1210
1211- New socket method connect_ex() returns the error code from connect()
1212instead of raising an exception on errors; this makes the logic
1213required for asynchronous connects simpler and more efficient.
1214
1215- New "locale" module with (still experimental) interface to the
1216standard C library locale interface, courtesy Martin von Loewis. This
1217does not repeat my mistake in 1.5a4 of always calling
1218setlocale(LC_ALL, ""). In fact, we've pretty much decided that
1219Python's standard numerical formatting operations should always use
1220the conventions for the C locale; the locale module contains utility
1221functions to format numbers according to the user specified locale.
1222(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
1223"C") after locale-changing calls.) See the library manual. (Alas, the
1224promised changes to the "re" module for locale support have not been
1225materialized yet. If you care, volunteer!)
1226
1227- Memory leak plugged in Py_BuildValue when building a dictionary.
1228
1229- Shared modules can now live inside packages (hierarchical module
1230namespaces). No changes to the shared module itself are needed.
1231
1232- Improved policy for __builtins__: this is a module in __main__ and a
1233dictionary everywhere else.
1234
1235- Python no longer catches SIGHUP and SIGTERM by default. This was
1236impossible to get right in the light of thread contexts. If you want
1237your program to clean up when a signal happens, use the signal module
1238to set up your own signal handler.
1239
1240- New Python/C API PyNumber_CoerceEx() does not return an exception
1241when no coercion is possible. This is used to fix a problem where
1242comparing incompatible numbers for equality would raise an exception
1243rather than return false as in Python 1.4 -- it once again will return
1244false.
1245
1246- The errno module is changed again -- the table of error messages
1247(errorstr) is removed. Instead, you can use os.strerror(). This
1248removes redundance and a potential locale dependency.
1249
1250- New module xmllib, to parse XML files. By Sjoerd Mullender.
1251
1252- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
1253It resets the signal module's notion of what the current process ID
1254and thread are, so that signal handlers will work after (and across)
1255calls to os.fork().
1256
1257- Fixed most occurrences of fatal errors due to missing thread state.
1258
1259- For vgrind (a flexible source pretty printer) fans, there's a simple
1260Python definition in Misc/vgrindefs, courtesy Neale Pickett.
1261
1262- Fixed memory leak in exec statement.
1263
1264- The test.pystone module has a new function, pystones(loops=LOOPS),
1265which returns a (benchtime, stones) tuple. The main() function now
1266calls this and prints the report.
1267
1268- Package directories now *require* the presence of an __init__.py (or
1269__init__.pyc) file before they are considered as packages. This is
1270done to prevent accidental subdirectories with common names from
1271overriding modules with the same name.
1272
1273- Fixed some strange exceptions in __del__ methods in library modules
1274(e.g. urllib). This happens because the builtin names are already
1275deleted by the time __del__ is called. The solution (a hack, but it
1276works) is to set some instance variables to 0 instead of None.
1277
1278- The table of built-in module initializers is replaced by a pointer
1279variable. This makes it possible to switch to a different table at
1280run time, e.g. when a collection of modules is loaded from a shared
1281library. (No example code of how to do this is given, but it is
1282possible.) The table is still there of course, its name prefixed with
1283an underscore and used to initialize the pointer.
1284
1285- The warning about a thread still having a frame now only happens in
1286verbose mode.
1287
1288- Change the signal finialization so that it also resets the signal
1289handlers. After this has been called, our signal handlers are no
1290longer active!
1291
1292- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
1293literals. There's now also a test fort this module.
1294
1295- The copy module now also uses __dict__.update(state) instead of
1296going through individual attribute assignments, for class instances
1297without a __setstate__ method.
1298
1299- New module reconvert translates old-style (regex module) regular
1300expressions to new-style (re module, Perl-style) regular expressions.
1301
1302- Most modules that used to use the regex module now use the re
1303module. The grep module has a new pgrep() function which uses
1304Perl-style regular expressions.
1305
1306- The (very old, backwards compatibility) regexp.py module has been
1307deleted.
1308
1309- Restricted execution (rexec): added the pcre module (support for the
1310re module) to the list of trusted extension modules.
1311
1312- New version of Jim Fulton's CObject object type, adds
1313PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
1314
1315- Some patches to Lee Busby's fpectl mods that accidentally didn't
1316make it into 1.5a4.
1317
1318- In the string module, add an optional 4th argument to count(),
1319matching find() etc.
1320
1321- Patch for the nntplib module by Charles Waldman to add optional user
1322and password arguments to NNTP.__init__(), for nntp servers that need
1323them.
1324
1325- The str() function for class objects now returns
1326"modulename.classname" instead of returning the same as repr().
1327
1328- The parsing of \xXX escapes no longer relies on sscanf().
1329
1330- The "sharedmodules" subdirectory of the installation is renamed to
1331"lib-dynload". (You may have to edit your Modules/Setup file to fix
1332this in an existing installation!)
1333
1334- Fixed Don Beaudry's mess-up with the OPT test in the configure
1335script. Certain SGI platforms will still issue a warning for each
1336compile; there's not much I can do about this since the compiler's
1337exit status doesn't indicate that I was using an obsolete option.
1338
1339- Fixed Barry's mess-up with {}.get(), and added test cases for it.
1340
1341- Shared libraries didn't quite work under AIX because of the change
1342in status of the GNU readline interface. Fix due to by Vladimir
1343Marangozov.
1344
1345
1346======================================================================
1347
1348
1349From 1.5a3 to 1.5a4
1350===================
1351
1352- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
1353feature; better install instructions; removed faqmain.py (which was an
1354older version).
1355
1356- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
1357about the treatment of lines starting with '.'. Added a minimal test
1358function.
1359
1360- struct module: ignore most whitespace in format strings.
1361
1362- urllib.py: close the socket and temp file in URLopener.retrieve() so
1363that multiple retrievals using the same connection work.
1364
1365- All standard exceptions are now classes by default; use -X to make
1366them strings (for backward compatibility only).
1367
1368- There's a new standard exception hierarchy, defined in the standard
1369library module exceptions.py (which you never need to import
1370explicitly). See
1371http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
1372more info.
1373
1374- Three new C API functions:
1375
1376 - int PyErr_GivenExceptionMatches(obj1, obj2)
1377
1378 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
1379 instance of type obj2, or of a class derived from obj2
1380
1381 - int PyErr_ExceptionMatches(obj)
1382
1383 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
1384 PyErr_Occurred() as obj1. This will be the more commonly called
1385 function.
1386
1387 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
1388
1389 Normalizes exceptions, and places the normalized values in the
1390 arguments. If type is not a class, this does nothing. If type is a
1391 class, then it makes sure that value is an instance of the class by:
1392
1393 1. if instance is of the type, or a class derived from type, it does
1394 nothing.
1395
1396 2. otherwise it instantiates the class, using the value as an
1397 argument. If value is None, it uses an empty arg tuple, and if
1398 the value is a tuple, it uses just that.
1399
1400- Another new C API function: PyErr_NewException() creates a new
1401exception class derived from Exception; when -X is given, it creates a
1402new string exception.
1403
1404- core interpreter: remove the distinction between tuple and list
1405unpacking; allow an arbitrary sequence on the right hand side of any
1406unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
1407thing, which should really be called UNPACK_SEQUENCE.)
1408
1409- classes: Allow assignments to an instance's __dict__ or __class__,
1410so you can change ivars (including shared ivars -- shock horror) and
1411change classes dynamically. Also make the check on read-only
1412attributes of classes less draconic -- only the specials names
1413__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
1414assigned.
1415
1416- Two new built-in functions: issubclass() and isinstance(). Both
1417take classes as their second arguments. The former takes a class as
1418the first argument and returns true iff first is second, or is a
1419subclass of second. The latter takes any object as the first argument
1420and returns true iff first is an instance of the second, or any
1421subclass of second.
1422
1423- configure: Added configuration tests for presence of alarm(),
1424pause(), and getpwent().
1425
1426- Doc/Makefile: changed latex2html targets.
1427
1428- classes: Reverse the search order for the Don Beaudry hook so that
1429the first class with an applicable hook wins. Makes more sense.
1430
1431- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
1432now legal to call these more than once. The first call to
1433Py_Initialize() initializes, the first call to Py_Finalize()
1434finalizes. There's also a new API, Py_IsInitalized() which checks
1435whether we are already initialized (in case you want to leave things
1436as they were).
1437
1438- Completely disable the declarations for malloc(), realloc() and
1439free(). Any 90's C compiler has these in header files, and the tests
1440to decide whether to suppress the declarations kept failing on some
1441platforms.
1442
1443- *Before* (instead of after) signalmodule.o is added, remove both
1444intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
1445ld on various systems.
1446
1447- Added reop to PC/config.c
1448
1449- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
1450Removed outdated HP-UX comments from README. Added Cray T3E comments.
1451
1452- Various renames of statically defined functions that had name
1453conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
1454roundup (sys/types.h).
1455
1456- urllib.py: Interpret three slashes in file: URL as local file (for
1457Netscape on Windows/Mac).
1458
1459- copy.py: Make sure the objects returned by __getinitargs__() are
1460kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
1461easily reproducable because it requires a later call to
1462__getinitargs__() to return a tuple that happens to be allocated at
1463the same address.)
1464
1465- Added definition of AR to toplevel Makefile. Renamed @buildno temp
1466file to buildno1.
1467
1468- Moved Include/assert.h to Parser/assert.h, which seems to be the
1469only place where it's needed.
1470
1471- Tweaked the dictionary lookup code again for some more speed
1472(Vladimir Marangozov).
1473
1474- NT build: Changed the way python15.lib is included in the other
1475projects. Per Mark Hammond's suggestion, add it to the extra libs in
1476Settings instead of to the project's source files.
1477
1478- regrtest.py: Change default verbosity so that there are only three
1479levels left: -q, default and -v. In default mode, the name of each
1480test is now printed. -v is the same as the old -vv. -q is more quiet
1481than the old default mode.
1482
1483- Removed the old FAQ from the distribution. You now have to get it
1484from the web!
1485
1486- Removed the PC/make_nt.in file from the distribution; it is no
1487longer needed.
1488
1489- Changed the build sequence so that shared modules are built last.
1490This fixes things for AIX and doesn't hurt elsewhere.
1491
1492- Improved test for GNU MP v1 in mpzmodule.c
1493
1494- fileobject.c: ftell() on Linux discards all buffered data; changed
1495read() code to use lseek() instead to get the same effect
1496
1497- configure.in, configure, importdl.c: NeXT sharedlib fixes
1498
1499- tupleobject.c: PyTuple_SetItem asserts refcnt==1
1500
1501- resource.c: Different strategy regarding whether to declare
1502getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
1503conflicting decls in its headers. Choice: only declare the return
1504type, not the argument prototype, and not on Linux.
1505
1506- importdl.c, configure*: set sharedlib extensions properly for NeXT
1507
1508- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
1509fixed; moved addition of PURIFY to LINKCC to configure
1510
1511- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
1512added to shup up various compilers.
1513
1514- _tkinter.c: removed buggy mac #ifndef
1515
1516- Doc: various Mac documentation changes, added docs for 'ic' module
1517
1518- PC/make_nt.in: deleted
1519
1520- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
1521"")
1522
1523- test_rotor.py: print b -> print `b`
1524
1525- Tkinter.py: (tagOrId) -> (tagOrId,)
1526
1527- Tkinter.py: the Tk class now also has a configure() method and
1528friends (they have been moved to the Misc class to accomplish this).
1529
1530- dict.get(key[, default]) returns dict[key] if it exists, or default
1531if it doesn't. The default defaults to None. This is quicker for
1532some applications than using either has_key() or try:...except
1533KeyError:....
1534
1535- Tools/webchecker/: some small changes to webchecker.py; added
1536websucker.py (a simple web site mirroring script).
1537
1538- Dictionary objects now have a get() method (also in UserDict.py).
1539dict.get(key, default) returns dict[key] if it exists and default
1540otherwise; default defaults to None.
1541
1542- Tools/scripts/logmerge.py: print the author, too.
1543
1544- Changes to import: support for "import a.b.c" is now built in. See
1545http://grail.cnri.reston.va.us/python/essays/packages.html
1546for more info. Most important deviations from "ni.py": __init__.py is
1547executed in the package's namespace instead of as a submodule; and
1548there's no support for "__" or "__domain__". Note that "ni.py" is not
1549changed to match this -- it is simply declared obsolete (while at the
1550same time, it is documented...:-( ).
1551Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1552for an example implementation of hierarchical module import written in
1553Python).
1554
1555- More changes to import: the site.py module is now imported by
1556default when Python is initialized; use -S to disable it. The site.py
1557module extends the path with several more directories: site-packages
1558inside the lib/python1.5/ directory, site-python in the lib/
1559directory, and pathnames mentioned in *.pth files found in either of
1560those directories. See
1561http://grail.cnri.reston.va.us/python/essays/packages.html
1562for more info.
1563
1564- Changes to standard library subdirectory names: those subdirectories
1565that are not packages have been renamed with a hypen in their name,
1566e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1567The test suite is now a package -- to run a test, you must now use
1568"import test.test_foo".
1569
1570- A completely new re.py module is provided (thanks to Andrew
1571Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
1572"pcre" re compiler and engine. For a while, the "old" re.py (which
1573was new in 1.5a3!) will be kept around as re1.py. The "old" regex
1574module and underlying parser and engine are still present -- while
1575regex is now officially obsolete, it will probably take several major
1576release cycles before it can be removed.
1577
1578- The posix module now has a strerror() function which translates an
1579error code to a string.
1580
1581- The emacs.py module (which was long obsolete) has been removed.
1582
1583- The universal makefile Misc/Makefile.pre.in now features an
1584"install" target. By default, installed shared libraries go into
1585$exec_prefix/lib/python$VERSION/site-packages/.
1586
1587- The install-sh script is installed with the other configuration
1588specific files (in the config/ subdirectory).
1589
1590- It turns out whatsound.py and sndhdr.py were identical modules.
1591Since there's also an imghdr.py file, I propose to make sndhdr.py the
1592official one. For compatibility, whatsound.py imports * from
1593sndhdr.py.
1594
1595- Class objects have a new attribute, __module__, giving the name of
1596the module in which they were declared. This is useful for pickle and
1597for printing the full name of a class exception.
1598
1599- Many extension modules no longer issue a fatal error when their
1600initialization fails; the importing code now checks whether an error
1601occurred during module initialization, and correctly propagates the
1602exception to the import statement.
1603
1604- Most extension modules now raise class-based exceptions (except when
1605-X is used).
1606
1607- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1608thread state -- just don't manipulate the lock if it isn't there.
1609
1610- Fixed a bug in Python/getopt.c that made it do the wrong thing when
1611an option was a single '-'. Thanks to Andrew Kuchling.
1612
1613- New module mimetypes.py will guess a MIME type from a filename's
1614extension.
1615
1616- Windows: the DLL version is now settable via a resource rather than
1617being hardcoded. This can be used for "branding" a binary Python
1618distribution.
1619
1620- urllib.py is now threadsafe -- it now uses re instead of regex, and
1621sys.exc_info() instead of sys.exc_{type,value}.
1622
1623- Many other library modules that used to use
1624sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1625using sys.exc_info().
1626
1627- The functions in popen2 have an optional buffer size parameter.
1628Also, the command argument can now be either a string (passed to the
1629shell) or a list of arguments (passed directly to execv).
1630
Guido van Rossumc45cf021998-04-10 20:06:21 +00001631- Alas, the thread support for _tkinter released with 1.5a3 didn't
1632work. It's been rewritten. The bad news is that it now requires a
1633modified version of a file in the standard Tcl distribution, which you
1634must compile with a -I option pointing to the standard Tcl source
1635tree. For this reason, the thread support is disabled by default.
1636
1637- The errno extension module adds two tables: errorcode maps errno
1638numbers to errno names (e.g. EINTR), and errorstr maps them to
1639message strings. (The latter is redundant because the new call
1640posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1641
1642- The readline extension module now provides some interfaces to
1643internal readline routines that make it possible to write a completer
1644in Python. An example completer, rlcompleter.py, is provided.
1645
1646 When completing a simple identifier, it completes keywords,
1647 built-ins and globals in __main__; when completing
1648 NAME.NAME..., it evaluates (!) the expression up to the last
1649 dot and completes its attributes.
1650
1651 It's very cool to do "import string" type "string.", hit the
1652 completion key (twice), and see the list of names defined by
1653 the string module!
1654
1655 Tip: to use the tab key as the completion key, call
1656
1657 readline.parse_and_bind("tab: complete")
1658
1659- The traceback.py module has a new function tb_lineno() by Marc-Andre
1660Lemburg which extracts the line number from the linenumber table in
1661the code object. Apparently the traceback object doesn't contains the
1662right linenumber when -O is used. Rather than guessing whether -O is
1663on or off, the module itself uses tb_lineno() unconditionally.
1664
1665- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1666to tag_bind() so it works again.
1667
1668- The pystone script is now a standard library module. Example use:
1669"import test.pystone; test.pystone.main()".
1670
1671- The import of the readline module in interactive mode is now also
1672attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1673Lemburg, who asked for this. :-)
1674
1675- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1676Mullender, to be closer to the standard. This fixes the getaddr()
1677method. Unfortunately, getaddrlist() is as broken as ever, since it
1678splits on commas without regard for RFC 822 quoting conventions.
1679
1680- pprint.py: correctly emit trailing "," in singleton tuples.
1681
1682- _tkinter.c: export names for its type objects, TkappType and
1683TkttType.
1684
1685- pickle.py: use __module__ when defined; fix a particularly hard to
1686reproduce bug that confuses the memo when temporary objects are
1687returned by custom pickling interfaces; and a semantic change: when
1688unpickling the instance variables of an instance, use
1689inst.__dict__.update(value) instead of a for loop with setattr() over
1690the value.keys(). This is more consistent (the pickling doesn't use
1691getattr() either but pickles inst.__dict__) and avoids problems with
1692instances that have a __setattr__ hook. But it *is* a semantic change
1693(because the setattr hook is no longer used). So beware!
1694
1695- config.h is now installed (at last) in
1696$exec_prefix/include/python1.5/. For most sites, this means that it
1697is actually in $prefix/include/python1.5/, with all the other Python
1698include files, since $prefix and $exec_prefix are the same by
1699default.
1700
1701- The imp module now supports parts of the functionality to implement
1702import of hierarchical module names. It now supports find_module()
1703and load_module() for all types of modules. Docstrings have been
1704added for those functions in the built-in imp module that are still
1705relevant (some old interfaces are obsolete). For a sample
1706implementation of hierarchical module import in Python, see the new
1707library module knee.py.
1708
1709- The % operator on string objects now allows arbitrary nested parens
1710in a %(...)X style format. (Brad Howes)
1711
1712- Reverse the order in which Setup and Setup.local are passed to the
1713makesetup script. This allows variable definitions in Setup.local to
1714override definitions in Setup. (But you'll still have to edit Setup
1715if you want to disable modules that are enabled by default, or if such
1716modules need non-standard options.)
1717
1718- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1719is like PyImport_ImporModule(name) but receives the globals and locals
1720dict and the fromlist arguments as well. (The name is a char*; the
1721others are PyObject*s).
1722
1723- The 'p' format in the struct extension module alloded to above is
1724new in 1.5a4.
1725
1726- The types.py module now uses try-except in a few places to make it
1727more likely that it can be imported in restricted mode. Some type
1728names are undefined in that case, e.g. CodeType (inaccessible),
1729FileType (not always accessible), and TracebackType and FrameType
1730(inaccessible).
1731
1732- In urllib.py: added separate administration of temporary files
1733created y URLopener.retrieve() so cleanup() can properly remove them.
1734The old code removed everything in tempcache which was a bad idea if
1735the user had passed a non-temp file into it. Also, in basejoin(),
1736interpret relative paths starting in "../". This is necessary if the
1737server uses symbolic links.
1738
1739- The Windows build procedure and project files are now based on
1740Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1741directory. It is much more robust, and properly builds separate Debug
1742and Release versions. (The installer will be added shortly.)
1743
1744- Added casts and changed some return types in regexpr.c to avoid
1745compiler warnings or errors on some platforms.
1746
1747- The AIX build tools for shared libraries now supports VPATH. (Donn
1748Cave)
1749
1750- By default, disable the "portable" multimedia modules audioop,
1751imageop, and rgbimg, since they don't work on 64-bit platforms.
1752
1753- Fixed a nasty bug in cStringIO.c when code was actually using the
1754close() method (the destructors would try to free certain fields a
1755second time).
1756
1757- For those who think they need it, there's a "user.py" module. This
1758is *not* imported by default, but can be imported to run user-specific
1759setup commands, ~/.pythonrc.py.
1760
1761- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1762Vladimir Marangozov, and others.
1763
1764- Added os.altsep; this is '/' on DOS/Windows, and None on systems
1765with a sane filename syntax.
1766
1767- os.py: Write out the dynamic OS choice, to avoid exec statements.
1768Adding support for a new OS is now a bit more work, but I bet that
1769'dos' or 'nt' will cover most situations...
1770
1771- The obsolete exception AccessError is now really gone.
1772
1773- Tools/faqwiz/: New installation instructions show how to maintain
1774multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
1775Added instructions to bootstrap script, too. Version bumped to 0.8.1.
1776Added <html>...</html> feature suggested by Skip Montanaro. Added
1777leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1778default SRCDIR.
1779
1780- Documentation for the relatively new modules "keyword" and "symbol"
1781has been added (to the end of the section on the parser extension
1782module).
1783
1784- In module bisect.py, but functions have two optional argument 'lo'
1785and 'hi' which allow you to specify a subsequence of the array to
1786operate on.
1787
1788- In ftplib.py, changed most methods to return their status (even when
1789it is always "200 OK") rather than swallowing it.
1790
1791- main() now calls setlocale(LC_ALL, ""), if setlocale() and
1792<locale.h> are defined.
1793
1794- Changes to configure.in, the configure script, and both
1795Makefile.pre.in files, to support SGI's SGI_ABI platform selection
1796environment variable.
1797
1798
1799======================================================================
1800
1801
Guido van Rossum7ea639b1997-11-26 16:36:28 +00001802From 1.4 to 1.5a3
1803=================
1804
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001805Security
1806--------
1807
1808- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
1809please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +00001810
1811Miscellaneous
1812-------------
1813
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001814- Because of various (small) incompatible changes in the Python
1815bytecode interpreter, the magic number for .pyc files has changed
1816again.
1817
Guido van Rossum2da391f1997-08-18 21:17:32 +00001818- The default module search path is now much saner. Both on Unix and
1819Windows, it is essentially derived from the path to the executable
1820(which can be overridden by setting the environment variable
1821$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
1822front of the default path, like in Unix (instead of overriding the
1823default path). On Windows, the directory containing the executable is
1824added to the end of the path.
1825
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001826- A new version of python-mode.el for Emacs has been included. Also,
1827a new file ccpy-style.el has been added to configure Emacs cc-mode for
1828the preferred style in Python C sources.
1829
Guido van Rossum2da391f1997-08-18 21:17:32 +00001830- On Unix, when using sys.argv[0] to insert the script directory in
1831front of sys.path, expand a symbolic link. You can now install a
1832program in a private directory and have a symbolic link to it in a
1833public bin directory, and it will put the private directory in the
1834module search path. Note that the symlink is expanded in sys.path[0]
1835but not in sys.argv[0], so you can still tell the name by which you
1836were invoked.
1837
1838- It is now recommended to use ``#!/usr/bin/env python'' instead of
1839``#!/usr/local/bin/python'' at the start of executable scripts, except
1840for CGI scripts. It has been determined that the use of /usr/bin/env
1841is more portable than that of /usr/local/bin/python -- scripts almost
1842never have to be edited when the Python interpreter lives in a
1843non-standard place. Note that this doesn't work for CGI scripts since
1844the python executable often doesn't live in the HTTP server's default
1845search path.
Guido van Rossum61000331997-08-15 04:39:58 +00001846
1847- The silly -s command line option and the corresponding
1848PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
1849flag in the Python/C API) are gone.
1850
1851- Most problems on 64-bit platforms should now be fixed. Andrew
1852Kuchling helped. Some uncommon extension modules are still not
1853clean (image and audio ops?).
1854
1855- Fixed a bug where multiple anonymous tuple arguments would be mixed up
1856when using the debugger or profiler (reported by Just van Rossum).
1857The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
1858would print the wrong value when run under the debugger or profiler.
1859
Guido van Rossum2da391f1997-08-18 21:17:32 +00001860- The hacks that the dictionary implementation used to speed up
1861repeated lookups of the same C string were removed; these were a
1862source of subtle problems and don't seem to serve much of a purpose
1863any longer.
1864
1865- All traces of support for the long dead access statement have been
1866removed from the sources.
1867
Guido van Rossum61000331997-08-15 04:39:58 +00001868- Plugged the two-byte memory leak in the tokenizer when reading an
1869interactive EOF.
1870
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001871- There's a -O option to the interpreter that removes SET_LINENO
1872instructions and assert statements (see below); it uses and produces
1873.pyo files instead of .pyc files. The speedup is only a few percent
1874in most cases. The line numbers are still available in the .pyo file,
1875as a separate table (which is also available in .pyc files). However,
1876the removal of the SET_LINENO instructions means that the debugger
1877(pdb) can't set breakpoints on lines in -O mode. The traceback module
1878contains a function to extract a line number from the code object
1879referenced in a traceback object. In the future it should be possible
1880to write external bytecode optimizers that create better optimized
1881.pyo files, and there should be more control over optimization;
1882consider the -O option a "teaser". Without -O, the assert statement
1883actually generates code that first checks __debug__; if this variable
1884is false, the assertion is not checked. __debug__ is a built-in
1885variable whose value is initialized to track the -O flag (it's true
1886iff -O is not specified). With -O, no code is generated for assert
1887statements, nor for code of the form ``if __debug__: <something>''.
1888Sorry, no further constant folding happens.
1889
Guido van Rossum61000331997-08-15 04:39:58 +00001890
1891Performance
1892-----------
1893
Guido van Rossum2da391f1997-08-18 21:17:32 +00001894- It's much faster (almost twice for pystone.py -- see
1895Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +00001896
1897- Some speedup by using separate free lists for method objects (both
1898the C and the Python variety) and for floating point numbers.
1899
1900- Big speedup by allocating frame objects with a single malloc() call.
1901The Python/C API for frames is changed (you shouldn't be using this
1902anyway).
1903
1904- Significant speedup by inlining some common opcodes for common operand
1905types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
1906
1907- Small speedup by reordering the method tables of some common
1908objects (e.g. list.append is now first).
1909
Guido van Rossum2da391f1997-08-18 21:17:32 +00001910- Big optimization to the read() method of file objects. A read()
1911without arguments now attempts to use fstat to allocate a buffer of
1912the right size; for pipes and sockets, it will fall back to doubling
1913the buffer size. While that the improvement is real on all systems,
1914it is most dramatic on Windows.
1915
Guido van Rossum61000331997-08-15 04:39:58 +00001916
1917Documentation
1918-------------
1919
1920- Many new pieces of library documentation were contributed, mostly by
1921Andrew Kuchling. Even cmath is now documented! There's also a
1922chapter of the library manual, "libundoc.tex", which provides a
1923listing of all undocumented modules, plus their status (e.g. internal,
1924obsolete, or in need of documentation). Also contributions by Sue
1925Williams, Skip Montanaro, and some module authors who succumbed to
1926pressure to document their own contributed modules :-). Note that
1927printing the documentation now kills fewer trees -- the margins have
1928been reduced.
1929
1930- I have started documenting the Python/C API. Unfortunately this project
1931hasn't been completed yet. It will be complete before the final release of
1932Python 1.5, though. At the moment, it's better to read the LaTeX source
1933than to attempt to run it through LaTeX and print the resulting dvi file.
1934
1935- The posix module (and hence os.py) now has doc strings! Thanks to Neil
1936Schemenauer. I received a few other contributions of doc strings. In most
1937other places, doc strings are still wishful thinking...
1938
1939
1940Language changes
1941----------------
1942
1943- Private variables with leading double underscore are now a permanent
1944feature of the language. (These were experimental in release 1.4. I have
1945favorable experience using them; I can't label them "experimental"
1946forever.)
1947
1948- There's new string literal syntax for "raw strings". Prefixing a string
1949literal with the letter r (or R) disables all escape processing in the
1950string; for example, r'\n' is a two-character string consisting of a
1951backslash followed by the letter n. This combines with all forms of string
1952quotes; it is actually useful for triple quoted doc strings which might
1953contain references to \n or \t. An embedded quote prefixed with a
1954backslash does not terminate the string, but the backslash is still
1955included in the string; for example, r'\'' is a two-character string
1956consisting of a backslash and a quote. (Raw strings are also
1957affectionately known as Robin strings, after their inventor, Robin
1958Friedrich.)
1959
Guido van Rossum2da391f1997-08-18 21:17:32 +00001960- There's a simple assert statement, and a new exception
1961AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
1962not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001963condition is not available; it would be too complicated to generate
1964code for this (since the code is generated from a parse tree).
1965However, the text is displayed as part of the traceback!
1966
1967- The raise statement has a new feature: when using "raise SomeClass,
1968somevalue" where somevalue is not an instance of SomeClass, it
1969instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
1970instance of a *derived* class of SomeClass, the exception class raised
1971is set to somevalue.__class__, and SomeClass is ignored after that.
1972
1973- Duplicate keyword arguments are now detected at compile time;
1974f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +00001975
1976
1977Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001978---------------------------
1979
Guido van Rossum2da391f1997-08-18 21:17:32 +00001980- There's a new exception FloatingPointError (used only by Lee Busby's
1981patches to catch floating point exceptions, at the moment).
1982
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001983- The obsolete exception ConflictError (presumably used by the long
1984obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001985
Guido van Rossum61000331997-08-15 04:39:58 +00001986- There's a new function sys.exc_info() which returns the tuple
1987(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001988
Guido van Rossum61000331997-08-15 04:39:58 +00001989- There's a new variable sys.executable, pointing to the executable file
1990for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001991
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001992- The sort() methods for lists no longer uses the C library qsort(); I
1993wrote my own quicksort implementation, with lots of help (in the form
1994of a kind of competition) from Tim Peters. This solves a bug in
1995dictionary comparisons on some Solaris versions when Python is built
1996with threads, and makes sorting lists even faster.
1997
1998- The semantics of comparing two dictionaries have changed, to make
1999comparison of unequal dictionaries faster. A shorter dictionary is
2000always considered smaller than a larger dictionary. For dictionaries
2001of the same size, the smallest differing element determines the
2002outcome (which yields the same results as before in this case, without
2003explicit sorting). Thanks to Aaron Watters for suggesting something
2004like this.
2005
Guido van Rossum61000331997-08-15 04:39:58 +00002006- The semantics of try-except have changed subtly so that calling a
2007function in an exception handler that itself raises and catches an
2008exception no longer overwrites the sys.exc_* variables. This also
2009alleviates the problem that objects referenced in a stack frame that
2010caught an exception are kept alive until another exception is caught
2011-- the sys.exc_* variables are restored to their previous value when
2012returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00002013
Guido van Rossum61000331997-08-15 04:39:58 +00002014- There's a new "buffer" interface. Certain objects (e.g. strings and
2015arrays) now support the "buffer" protocol. Buffer objects are acceptable
2016whenever formerly a string was required for a write operation; mutable
2017buffer objects can be the target of a read operation using the call
2018f.readinto(buffer). A cool feature is that regular expression matching now
2019also work on array objects. Contribution by Jack Jansen. (Needs
2020documentation.)
2021
2022- String interning: dictionary lookups are faster when the lookup
2023string object is the same object as the key in the dictionary, not
2024just a string with the same value. This is done by having a pool of
2025"interned" strings. Most names generated by the interpreter are now
2026automatically interned, and there's a new built-in function intern(s)
2027that returns the interned version of a string. Interned strings are
2028not a different object type, and interning is totally optional, but by
2029interning most keys a speedup of about 15% was obtained for the
2030pystone benchmark.
2031
2032- Dictionary objects have several new methods; clear() and copy() have
2033the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002034dictionary d into this one, overriding existing keys. The dictionary
2035implementation file is now called dictobject.c rather than the
2036confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +00002037
Guido van Rossum61000331997-08-15 04:39:58 +00002038- The intrinsic function dir() is much smarter; it looks in __dict__,
2039__members__ and __methods__.
2040
Guido van Rossum2da391f1997-08-18 21:17:32 +00002041- The intrinsic functions int(), long() and float() can now take a
2042string argument and then do the same thing as string.atoi(),
2043string.atol(), and string.atof(). No second 'base' argument is
2044allowed, and complex() does not take a string (nobody cared enough).
2045
Guido van Rossum61000331997-08-15 04:39:58 +00002046- When a module is deleted, its globals are now deleted in two phases.
2047In the first phase, all variables whose name begins with exactly one
2048underscore are replaced by None; in the second phase, all variables
2049are deleted. This makes it possible to have global objects whose
2050destructors depend on other globals. The deletion order within each
2051phase is still random.
2052
2053- It is no longer an error for a function to be called without a
2054global variable __builtins__ -- an empty directory will be provided
2055by default.
2056
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002057- Guido's corollary to the "Don Beaudry hook": it is now possible to
2058do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +00002059faint of heart; and undocumented as yet, but basically if a base class
2060is an instance, its class will be instantiated to create the new
2061class. Jim Fulton will love it -- it also works with instances of his
2062"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002063__class__ attribute on the purported base class. See
2064Demo/metaclasses/index.html for an explanation and see that directory
2065for examples.
2066
2067- Another change is that the Don Beaudry hook is now invoked when
2068*any* base class is special. (Up to 1.5a3, the *last* special base
2069class is used; in 1.5a4, the more rational choice of the *first*
2070special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +00002071
Guido van Rossum2da391f1997-08-18 21:17:32 +00002072- New optional parameter to the readlines() method of file objects.
2073This indicates the number of bytes to read (the actual number of bytes
2074read will be somewhat larger due to buffering reading until the end of
2075the line). Some optimizations have also been made to speed it up (but
2076not as much as read()).
2077
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002078- Complex numbers no longer have the ".conj" pseudo attribute; use
2079z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
2080now *do* support the __members__ and __methods__ special attributes.
2081
2082- The complex() function now looks for a __complex__() method on class
2083instances before giving up.
2084
2085- Long integers now support arbitrary shift counts, so you can now
2086write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
2087shift count for this.)
2088
2089- The hex() and oct() functions have been changed so that for regular
2090integers, they never emit a minus sign. For example, on a 32-bit
2091machine, oct(-1) now returns '037777777777' and hex(-1) returns
2092'0xffffffff'. While this may seem inconsistent, it is much more
2093useful. (For long integers, a minus sign is used as before, to fit
2094the result in memory :-)
2095
2096- The hash() function computes better hashes for several data types,
2097including strings, floating point numbers, and complex numbers.
2098
Guido van Rossum61000331997-08-15 04:39:58 +00002099
2100New extension modules
2101---------------------
2102
2103- New extension modules cStringIO.c and cPickle.c, written by Jim
2104Fulton and other folks at Digital Creations. These are much more
2105efficient than their Python counterparts StringIO.py and pickle.py,
2106but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +00002107faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002108still significant.
Guido van Rossum61000331997-08-15 04:39:58 +00002109
2110- New extension module zlibmodule.c, interfacing to the free zlib
2111library (gzip compatible compression). There's also a module gzip.py
2112which provides a higher level interface. Written by Andrew Kuchling
2113and Jeremy Hylton.
2114
2115- New module readline; see the "miscellaneous" section above.
2116
2117- New Unix extension module resource.c, by Jeremy Hylton, provides
2118access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
2119related symbolic constants.
2120
2121- New extension puremodule.c, by Barry Warsaw, which interfaces to the
2122Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
2123possible to enable Purify by simply setting the PURIFY Makefile
2124variable in the Modules/Setup file.
2125
2126
2127Changes in extension modules
2128----------------------------
2129
2130- The struct extension module has several new features to control byte
2131order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002132on platforms where this is not the native format. It uses uppercase
2133format codes for unsigned integers of various sizes (always using
2134Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
2135and 'p' for "Pascal strings" (with a leading length byte, included in
Guido van Rossum92664b81997-10-07 00:12:43 +00002136the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
2137big-endian data and '<' forces little-endian data; these also select
2138standard data sizes and disable automatic alignment (use pad bytes as
2139needed).
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002140
2141- The array module supports uppercase format codes for unsigned data
2142formats (like the struct module).
Guido van Rossum61000331997-08-15 04:39:58 +00002143
2144- The fcntl extension module now exports the needed symbolic
2145constants. (Formerly these were in FCNTL.py which was not available
2146or correct for all platforms.)
2147
2148- The extension modules dbm, gdbm and bsddb now check that the
2149database is still open before making any new calls.
2150
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002151- The dbhash module is no more. Use bsddb instead. (There's a third
2152party interface for the BSD 2.x code somewhere on the web; support for
2153bsddb will be deprecated.)
2154
2155- The gdbm module now supports a sync() method.
2156
2157- The socket module now has some new functions: getprotobyname(), and
2158the set {ntoh,hton}{s,l}().
2159
Guido van Rossum61000331997-08-15 04:39:58 +00002160- Various modules now export their type object: socket.SocketType,
2161array.ArrayType.
2162
Guido van Rossum2da391f1997-08-18 21:17:32 +00002163- The socket module's accept() method now returns unknown addresses as
2164a tuple rather than raising an exception. (This can happen in
2165promiscuous mode.) Theres' also a new function getprotobyname().
2166
Guido van Rossum61000331997-08-15 04:39:58 +00002167- The pthread support for the thread module now works on most platforms.
2168
2169- STDWIN is now officially obsolete. Support for it will eventually
2170be removed from the distribution.
2171
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002172- The binascii extension module is now hopefully fully debugged.
2173(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
2174received.)
Guido van Rossum61000331997-08-15 04:39:58 +00002175
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002176- audioop.c: added a ratecv() function; better handling of overflow in
2177add().
Guido van Rossum2da391f1997-08-18 21:17:32 +00002178
2179- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
2180Windows, also O_TEXT and O_BINARY. The 'error' variable (the
2181exception is raises) is renamed -- its string value is now "os.error",
2182so newbies don't believe they have to import posix (or nt) to catch
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002183it when they see os.error reported as posix.error. The execve()
2184function now accepts any mapping object for the environment.
Guido van Rossum2da391f1997-08-18 21:17:32 +00002185
2186- A new version of the al (audio library) module for SGI was
2187contributed by Sjoerd Mullender.
2188
2189- The regex module has a new function get_syntax() which retrieves the
2190syntax setting set by set_syntax(). The code was also sanitized,
2191removing worries about unclean error handling. See also below for its
2192successor, re.py.
2193
2194- The "new" module (which creates new objects of various types) once
2195again has a fully functioning new.function() method. Dangerous as
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002196ever! Also, new.code() has several new arguments.
2197
2198- A problem has been fixed in the rotor module: on systems with signed
2199characters, rotor-encoded data was not portable when the key contained
22008-bit characters. Also, setkey() now requires its argument rather
2201than having broken code to default it.
2202
2203- The sys.builtin_module_names variable is now a tuple. Another new
2204variables in sys is sys.executable (the full path to the Python
2205binary, if known).
2206
2207- The specs for time.strftime() have undergone some revisions. It
2208appears that not all format characters are supported in the same way
2209on all platforms. Rather than reimplement it, we note these
2210differences in the documentation, and emphasize the shared set of
2211features. There's also a thorough test set (that occasionally finds
2212problems in the C library implementation, e.g. on some Linuxes),
2213thanks to Skip Montanaro.
2214
2215- The nis module seems broken when used with NIS+; unfortunately
2216nobody knows how to fix it. It should still work with old NIS.
Guido van Rossum2da391f1997-08-18 21:17:32 +00002217
Guido van Rossum61000331997-08-15 04:39:58 +00002218
2219New library modules
2220-------------------
2221
2222- New (still experimental) Perl-style regular expression module,
2223re.py, which uses a new interface for matching as well as a new
2224syntax; the new interface avoids the thread-unsafety of the regex
2225interface. This comes with a helper extension reopmodule.c and vastly
2226rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
2227Peters, and Andrew Kuchling. See the documentation libre.tex. In
22281.5, the old regex module is still fully supported; in the future, it
2229will become obsolete.
2230
2231- New module gzip.py; see zlib above.
2232
2233- New module keyword.py exports knowledge about Python's built-in
2234keywords. (New version by Ka-Ping Yee.)
2235
2236- New module pprint.py (with documentation) which supports
2237pretty-printing of lists, tuples, & dictionaries recursively. By Fred
2238Drake.
2239
2240- New module code.py. The function code.compile_command() can
2241determine whether an interactively entered command is complete or not,
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002242distinguishing incomplete from invalid input. (XXX Unfortunately,
2243this seems broken at this moment, and I don't have the time to fix
2244it. It's probably better to add an explicit interface to the parser
2245for this.)
Guido van Rossum61000331997-08-15 04:39:58 +00002246
Guido van Rossum522578e1997-08-28 03:43:21 +00002247- There is now a library module xdrlib.py which can read and write the
Guido van Rossum61000331997-08-15 04:39:58 +00002248XDR data format as used by Sun RPC, for example. It uses the struct
2249module.
2250
2251
2252Changes in library modules
2253--------------------------
2254
2255- Module codehack.py is now completely obsolete.
2256
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002257- The pickle.py module has been updated to make it compatible with the
2258new binary format that cPickle.c produces. By default it produces the
2259old all-ASCII format compatible with the old pickle.py, still much
2260faster than pickle.py; it will read both formats automatically. A few
2261other updates have been made.
2262
2263- A new helper module, copy_reg.py, is provided to register extensions
2264to the pickling code.
2265
Guido van Rossum61000331997-08-15 04:39:58 +00002266- Revamped module tokenize.py is much more accurate and has an
2267interface that makes it a breeze to write code to colorize Python
2268source code. Contributed by Ka-Ping Yee.
2269
2270- In ihooks.py, ModuleLoader.load_module() now closes the file under
2271all circumstances.
2272
2273- The tempfile.py module has a new class, TemporaryFile, which creates
2274an open temporary file that will be deleted automatically when
2275closed. This works on Windows and MacOS as well as on Unix. (Jim
2276Fulton.)
2277
2278- Changes to the cgi.py module: Most imports are now done at the
2279top of the module, which provides a speedup when using ni (Jim
2280Fulton). The problem with file upload to a Windows platform is solved
2281by using the new tempfile.TemporaryFile class; temporary files are now
2282always opened in binary mode (Jim Fulton). The cgi.escape() function
2283now takes an optional flag argument that quotes '"' to '&quot;'. It
2284is now possible to invoke cgi.py from a command line script, to test
2285cgi scripts more easily outside an http server. There's an optional
2286limit to the size of uploads to POST (Skip Montanaro). Added a
2287'strict_parsing' option to all parsing functions (Jim Fulton). The
2288function parse_qs() now uses urllib.unquote() on the name as well as
Guido van Rossum2da391f1997-08-18 21:17:32 +00002289the value of fields (Clarence Gardner). The FieldStorage class now
2290has a __len__() method.
Guido van Rossum61000331997-08-15 04:39:58 +00002291
2292- httplib.py: the socket object is no longer closed; all HTTP/1.*
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002293responses are now accepted; and it is now thread-safe (by not using
2294the regex module).
Guido van Rossum61000331997-08-15 04:39:58 +00002295
2296- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
2297
2298- The popen2.py module is now rewritten using a class, which makes
2299access to the standard error stream and the process id of the
2300subprocess possible.
2301
Guido van Rossum2da391f1997-08-18 21:17:32 +00002302- Added timezone support to the rfc822.py module, in the form of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002303getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
2304Also added recognition of some non-standard date formats, by Lars
2305Wirzenius, and RFC 850 dates (Chris Lawrence).
Guido van Rossum61000331997-08-15 04:39:58 +00002306
2307- mhlib.py: various enhancements, including almost compatible parsing
2308of message sequence specifiers without invoking a subprocess. Also
2309added a createmessage() method by Lars Wirzenius.
2310
2311- The StringIO.StringIO class now supports readline(nbytes). (Lars
2312Wirzenius.) (Of course, you should be using cStringIO for performance.)
2313
2314- UserDict.py supports the new dictionary methods as well.
2315
2316- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
2317speed it up, and replace 0 seed values by 1 to avoid degeneration.
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002318A bug was fixed in the test for invalid arguments.
Guido van Rossum61000331997-08-15 04:39:58 +00002319
Guido van Rossum2da391f1997-08-18 21:17:32 +00002320- Module ftplib.py: added support for parsing a .netrc file (Fred
2321Drake). Also added an ntransfercmd() method to the FTP class, which
2322allows access to the expected size of a transfer when available, and a
2323parse150() function to the module which parses the corresponding 150
2324response.
Guido van Rossum61000331997-08-15 04:39:58 +00002325
2326- urllib.py: the ftp cache is now limited to 10 entries. Added
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002327quote_plus() and unquote_plus() functions which are like quote() and
2328unquote() but also replace spaces with '+' or vice versa, for
2329encoding/decoding CGI form arguments. Catch all errors from the ftp
2330module. HTTP requests now add the Host: header line. The proxy
Guido van Rossum2da391f1997-08-18 21:17:32 +00002331variable names are now mapped to lower case, for Windows. The
2332spliturl() function no longer erroneously throws away all data past
2333the first newline. The basejoin() function now intereprets "../"
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002334correctly. I *believe* that the problems with "exception raised in
2335__del__" under certain circumstances have been fixed (mostly by
2336changes elsewher in the interpreter).
2337
2338- In urlparse.py, there is a cache for results in urlparse.urlparse();
2339its size limit is set to 20. Also, new URL schemes shttp, https, and
2340snews are "supported".
Guido van Rossum61000331997-08-15 04:39:58 +00002341
Guido van Rossum2da391f1997-08-18 21:17:32 +00002342- shelve.py: use cPickle and cStringIO when available. Also added
2343a sync() method, which calls the database's sync() method if there is
2344one.
Guido van Rossum61000331997-08-15 04:39:58 +00002345
2346- The mimetools.py module now uses the available Python modules for
2347decoding quoted-printable, uuencode and base64 formats, rather than
2348creating a subprocess.
2349
2350- The python debugger (pdb.py, and its base class bdb.py) now support
2351conditional breakpoints. See the docs.
2352
2353- The modules base64.py, uu.py and quopri.py can now be used as simple
2354command line utilities.
2355
2356- Various small fixes to the nntplib.py module that I can't bother to
2357document in detail.
2358
Guido van Rossum61000331997-08-15 04:39:58 +00002359- Sjoerd Mullender's mimify.py module now supports base64 encoding and
2360includes functions to handle the funny encoding you sometimes see in mail
2361headers. It is now documented.
2362
Guido van Rossum2da391f1997-08-18 21:17:32 +00002363- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
2364gotten from the environment.
2365
2366- Many more modules now correctly open files in binary mode when this
2367is necessary on non-Unix platforms.
2368
2369- The copying functions in the undocumented module shutil.py are
2370smarter.
2371
2372- The Writer classes in the formatter.py module now have a flush()
2373method.
2374
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002375- The sgmllib.py module accepts hyphens and periods in the middle of
2376attribute names. While this is against the SGML standard, there is
2377some HTML out there that uses this...
2378
2379- The interface for the Python bytecode disassembler module, dis.py,
2380has been enhanced quite a bit. There's now one main function,
2381dis.dis(), which takes almost any kind of object (function, module,
2382class, instance, method, code object) and disassembles it; without
2383arguments it disassembles the last frame of the last traceback. The
2384other functions have changed slightly, too.
Guido van Rossum2da391f1997-08-18 21:17:32 +00002385
2386- The imghdr.py module recognizes new image types: BMP, PNG.
2387
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002388- The string.py module has a new function replace(str, old, new,
Guido van Rossum2da391f1997-08-18 21:17:32 +00002389[maxsplit]) which does substring replacements. It is actually
2390implemented in C in the strop module. The functions [r]find() an
2391[r]index() have an optional 4th argument indicating the end of the
2392substring to search, alsoo implemented by their strop counterparts.
2393(Remember, never import strop -- import string uses strop when
2394available with zero overhead.)
2395
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002396- The string.join() function now accepts any sequence argument, not
2397just lists and tuples.
2398
2399- The string.maketrans() requires its first two arguments to be
2400present. The old version didn't require them, but there's not much
2401point without them, and the documentation suggests that they are
2402required, so we fixed the code to match the documentation.
2403
2404- The regsub.py module has a function clear_cache(), which clears its
2405internal cache of compiled regular expressions. Also, the cache now
2406takes the current syntax setting into account. (However, this module
2407is now obsolete -- use the sub() or subn() functions or methods in the
2408re module.)
2409
2410- The undocumented module Complex.py has been removed, now that Python
2411has built-in complex numbers. A similar module remains as
2412Demo/classes/Complex.py, as an example.
2413
Guido van Rossum61000331997-08-15 04:39:58 +00002414
2415Changes to the build process
2416----------------------------
2417
2418- The way GNU readline is configured is totally different. The
2419--with-readline configure option is gone. It is now an extension
2420module, which may be loaded dynamically. You must enable it (and
2421specify the correct linraries to link with) in the Modules/Setup file.
2422Importing the module installs some hooks which enable command line
2423editing. When the interpreter shell is invoked interactively, it
2424attempts to import the readline module; when this fails, the default
2425input mechanism is used. The hook variables are PyOS_InputHook and
2426PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
2427ideas from William Magro.)
2428
2429- New build procedure: a single library, libpython1.5.a, is now built,
2430which contains absolutely everything except for a one-line main()
2431program (which calls Py_Main(argc, argv) to start the interpreter
2432shell). This makes life much simpler for applications that need to
2433embed Python. The serial number of the build is now included in the
2434version string (sys.version).
2435
2436- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
2437emits a single warning any more when compiling Python.
2438
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002439- A number of new Makefile variables have been added for special
2440situations, e.g. LDLAST is appended to the link command. These are
2441used by editing the Makefile or passing them on the make command
2442line.
2443
Guido van Rossum61000331997-08-15 04:39:58 +00002444- A set of patches from Lee Busby has been integrated that make it
2445possible to catch floating point exceptions. Use the configure option
2446--with-fpectl to enable the patches; the extension modules fpectl and
2447fpetest provide control to enable/disable and test the feature,
2448respectively.
2449
2450- The support for shared libraries under AIX is now simpler and more
2451robust. Thanks to Vladimir Marangozov for revamping his own patches!
2452
2453- The Modules/makesetup script now reads a file Setup.local as well as
2454a file Setup. Most changes to the Setup script can be done by editing
2455Setup.local instead, which makes it easier to carry a particular setup
2456over from one release to the next.
2457
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002458- The Modules/makesetup script now copies any "include" lines it
2459encounters verbatim into the output Makefile. It also recognizes .cxx
2460and .cpp as C++ source files.
2461
Guido van Rossum61000331997-08-15 04:39:58 +00002462- The configure script is smarter about C compiler options; e.g. with
2463gcc it uses -O2 and -g when possible, and on some other platforms it
2464uses -Olimit 1500 to avoid a warning from the optimizer about the main
2465loop in ceval.c (which has more than 1000 basic blocks).
2466
2467- The configure script now detects whether malloc(0) returns a NULL
2468pointer or a valid block (of length zero). This avoids the nonsense
2469of always adding one byte to all malloc() arguments on most platforms.
2470
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002471- The configure script has a new option, --with-dec-threads, to enable
2472DEC threads on DEC Alpha platforms. Also, --with-threads is now an
2473alias for --with-thread (this was the Most Common Typo in configure
2474arguments).
2475
2476- Many changes in Doc/Makefile; amongst others, latex2html is now used
2477to generate HTML from all latex documents.
2478
Guido van Rossum61000331997-08-15 04:39:58 +00002479
2480Change to the Python/C API
2481--------------------------
2482
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002483- Because some interfaces have changed, the PYTHON_API macro has been
2484bumped. Most extensions built for the old API version will still run,
2485but I can't guarantee this. Python prints a warning message on
2486version mismatches; it dumps core when the version mismatch causes a
2487serious problem :-)
2488
Guido van Rossum2da391f1997-08-18 21:17:32 +00002489- I've completed the Grand Renaming, with the help of Roger Masse and
2490Barry Warsaw. This makes reading or debugging the code much easier.
2491Many other unrelated code reorganizations have also been carried out.
2492The allobjects.h header file is gone; instead, you would have to
2493include Python.h followed by rename2.h. But you're better off running
2494Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
2495the rename2.h; it will disappear in the next release.
2496
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002497- Various and sundry small bugs in the "abstract" interfaces have been
2498fixed. Thanks to all the (involuntary) testers of the Python 1.4
2499version! Some new functions have been added, e.g. PySequence_List(o),
2500equivalent to list(o) in Python.
2501
2502- New API functions PyLong_FromUnsignedLong() and
2503PyLong_AsUnsignedLong().
2504
Guido van Rossum2da391f1997-08-18 21:17:32 +00002505- The API functions in the file cgensupport.c are no longer
2506supported. This file has been moved to Modules and is only ever
2507compiled when the SGI specific 'gl' module is built.
Guido van Rossum61000331997-08-15 04:39:58 +00002508
2509- PyObject_Compare() can now raise an exception. Check with
2510PyErr_Occurred(). The comparison function in an object type may also
2511raise an exception.
2512
2513- The slice interface uses an upper bound of INT_MAX when no explicit
2514upper bound is given (e.x. for a[1:]). It used to ask the object for
2515its length and do the calculations.
2516
2517- Support for multiple independent interpreters. See Doc/api.tex,
2518functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
2519documentation is incomplete, also see the new Demo/pysvr example
2520(which shows how to use these in a threaded application) and the
2521source code.
2522
2523- There is now a Py_Finalize() function which "de-initializes"
2524Python. It is possible to completely restart the interpreter
2525repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
2526change of functionality in Py_Initialize() means that it is now a
2527fatal error to call it while the interpreter is already initialized.
2528The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
2529is deprecated (it is nothing more than Py_Finalize() followed by
2530exit()).
2531
Guido van Rossum2da391f1997-08-18 21:17:32 +00002532- There are no known memory leaks left. While Py_Finalize() doesn't
2533free *all* allocated memory (some of it is hard to track down),
2534repeated calls to Py_Finalize() and Py_Initialize() do not create
2535unaccessible heap blocks.
Guido van Rossum61000331997-08-15 04:39:58 +00002536
2537- There is now explicit per-thread state. (Inspired by, but not the
2538same as, Greg Stein's free threading patches.)
2539
2540- There is now better support for threading C applications. There are
2541now explicit APIs to manipulate the interpreter lock. Read the source
2542or the Demo/pysvr example; the new functions are
2543PyEval_{Acquire,Release}{Lock,Thread}().
2544
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002545- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
2546with other libraries' DEBUG macros. Likewise for any other test
2547macros that didn't yet start with Py_.
2548
Guido van Rossum61000331997-08-15 04:39:58 +00002549- New wrappers around malloc() and friends: Py_Malloc() etc. call
2550malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
2551just malloc(). Use of these wrappers could be essential if multiple
2552memory allocators exist (e.g. when using certain DLL setups under
2553Windows). (Idea by Jim Fulton.)
2554
2555- New C API PyImport_Import() which uses whatever __import__() hook
2556that is installed for the current execution environment. By Jim
2557Fulton.
2558
2559- It is now possible for an extension module's init function to fail
2560non-fatally, by calling one of the PyErr_* functions and returning.
2561
2562- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
2563argument to the proper type, like the similar PyString macros already
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002564did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
2565and PyList_GET_ITEM.
Guido van Rossum61000331997-08-15 04:39:58 +00002566
2567- Some of the Py_Get* function, like Py_GetVersion() (but not yet
2568Py_GetPath()) are now declared as returning a const char *. (More
2569should follow.)
2570
2571- Changed the run-time library to check for exceptions after object
2572comparisons. PyObject_Compare() can now return an exception; use
2573PyErr_Occurred() to check (there is *no* special return value).
2574
2575- PyFile_WriteString() and Py_Flushline() now return error indicators
2576instead of clearing exceptions. This fixes an obscure bug where using
2577these would clear a pending exception, discovered by Just van Rossum.
2578
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002579- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
2580an argument list including keyword arguments. Contributed by Geoff
2581Philbrick.
2582
Guido van Rossum2da391f1997-08-18 21:17:32 +00002583- PyArg_GetInt() is gone.
2584
2585- It's no longer necessary to include graminit.h when calling one of
2586the extended parser API functions. The three public grammar start
2587symbols are now in Python.h as Py_single_input, Py_file_input, and
2588Py_eval_input.
2589
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002590- The CObject interface has a new function,
2591PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
2592on the object referenced by "module.name".
2593
Guido van Rossum61000331997-08-15 04:39:58 +00002594
2595Tkinter
2596-------
2597
Guido van Rossum2da391f1997-08-18 21:17:32 +00002598- On popular demand, _tkinter once again installs a hook for readline
2599that processes certain Tk events while waiting for the user to type
2600(using PyOS_InputHook).
2601
2602- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
2603caused by command definitions referencing widget objects beyond their
2604lifetime.
2605
2606- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
2607tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002608with the new Tk dialog scripts, and provide more "native platform"
2609style file selection dialog boxes on some platforms. Contributed by
2610Fredrik Lundh.
Guido van Rossum61000331997-08-15 04:39:58 +00002611
2612- Tkinter.py: when the first Tk object is destroyed, it sets the
2613hiddel global _default_root to None, so that when another Tk object is
2614created it becomes the new default root. Other miscellaneous
2615changes and fixes.
2616
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002617- The Image class now has a configure method.
2618
2619- Added a bunch of new winfo options to Tkinter.py; we should now be
2620up to date with Tk 4.2. The new winfo options supported are:
2621mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
2622visualsavailable.
2623
2624- The broken bind() method on Canvas objects defined in the Canvas.py
2625module has been fixed. The CanvasItem and Group classes now also have
2626an unbind() method.
2627
2628- The problem with Tkinter.py falling back to trying to import
2629"tkinter" when "_tkinter" is not found has been fixed -- it no longer
2630tries "tkinter", ever. This makes diagnosing the problem "_tkinter
2631not configured" much easier and will hopefully reduce the newsgroup
2632traffic on this topic.
2633
2634- The ScrolledText module once again supports the 'cnf' parameter, to
2635be compatible with the examples in Mark Lutz' book (I know, I know,
2636too late...)
2637
Guido van Rossum61000331997-08-15 04:39:58 +00002638- The _tkinter.c extension module has been revamped. It now support
2639Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
2640works well under Windows and Mac (with the latest Tk ports to those
2641platforms). It also supports threading -- it is safe for one
2642(Python-created) thread to be blocked in _tkinter.mainloop() while
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002643other threads modify widgets. To make the changes visible, those
2644threads must use update_idletasks()method. (The patch for threading
2645in 1.5a3 was broken; in 1.5a4, it is back in a different version,
2646which requires access to the Tcl sources to get it to work -- hence it
2647is disabled by default.)
2648
2649- A bug in _tkinter.c has been fixed, where Split() with a string
2650containing an unmatched '"' could cause an exception or core dump.
2651
2652- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
2653CreateFileHandler, so _tkinter.createfilehandler is not available on
2654those platforms when using Tk 8.0 or later. I will have to rethink
2655how to interface with Tcl's lower-level event mechanism, or with its
2656channels (which are like Python's file-like objects). Jack Jansen has
2657provided a fix for the Mac, so createfilehandler *is* actually
2658supported there; maybe I can adapt his fix for Windows.
Guido van Rossum61000331997-08-15 04:39:58 +00002659
2660
2661Tools and Demos
2662---------------
2663
2664- A new regression test suite is provided, which tests most of the
2665standard and built-in modules. The regression test is run by invoking
2666the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
2667he and Roger Masse contributed most of the new tests.
2668
2669- New tool: faqwiz -- the CGI script that is used to maintain the
2670Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
2671Tools/faqwiz.
2672
2673- New tool: webchecker -- a simple extensible web robot that, when
2674aimed at a web server, checks that server for dead links. Available
2675are a command line utility as well as a Tkinter based GUI version. In
2676Tools/webchecker. A simplified version of this program is dissected
2677in my article in O'Reilly's WWW Journal, the issue on Scripting
2678Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
2679Includes a parser for robots.txt files by Skip Montanaro.
2680
2681- New small tools: cvsfiles.py (prints a list of all files under CVS
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002682n a particular directory tree), treesync.py (a rather Guido-specific
Guido van Rossum61000331997-08-15 04:39:58 +00002683script to synchronize two source trees, one on Windows NT, the other
2684one on Unix under CVS but accessible from the NT box), and logmerge.py
2685(sort a collection of RCS or CVS logs by date). In Tools/scripts.
2686
2687- The freeze script now also works under Windows (NT). Another
2688feature allows the -p option to be pointed at the Python source tree
2689instead of the installation prefix. This was loosely based on part of
2690xfreeze by Sam Rushing and Bill Tutt.
2691
2692- New examples (Demo/extend) that show how to use the generic
2693extension makefile (Misc/Makefile.pre.in).
2694
2695- Tools/scripts/h2py.py now supports C++ comments.
2696
Guido van Rossum2da391f1997-08-18 21:17:32 +00002697- Tools/scripts/pystone.py script is upgraded to version 1.1; there
2698was a bug in version 1.0 (distributed with Python 1.4) that leaked
2699memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
2700
2701- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Guido van Rossum61000331997-08-15 04:39:58 +00002702
2703
2704Windows (NT and 95)
2705-------------------
2706
2707- New project files for Developer Studio (Visual C++) 5.0 for Windows
2708NT (the old VC++ 4.2 Makefile is also still supported, but will
2709eventually be withdrawn due to its bulkiness).
2710
2711- See the note on the new module search path in the "Miscellaneous" section
2712above.
2713
2714- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
2715basically withdrawn. If it still works for you, you're lucky.
2716
2717- There's a new extension module, msvcrt.c, which provides various
2718low-level operations defined in the Microsoft Visual C++ Runtime Library.
2719These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
2720console I/O functions like kbhit(), getch() and putch().
2721
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002722- The -u option not only sets the standard I/O streams to unbuffered
2723status, but also sets them in binary mode. (This can also be done
2724using msvcrt.setmode(), by the way.)
Guido van Rossum61000331997-08-15 04:39:58 +00002725
2726- The, sys.prefix and sys.exec_prefix variables point to the directory
2727where Python is installed, or to the top of the source tree, if it was run
2728from there.
2729
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002730- The various os.path modules (posixpath, ntpath, macpath) now support
2731passing more than two arguments to the join() function, so
2732os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
2733c)).
2734
Guido van Rossum61000331997-08-15 04:39:58 +00002735- The ntpath module (normally used as os.path) supports ~ to $HOME
2736expansion in expanduser().
2737
2738- The freeze tool now works on Windows.
2739
Guido van Rossum2da391f1997-08-18 21:17:32 +00002740- See also the Tkinter category for a sad note on
2741_tkinter.createfilehandler().
2742
2743- The truncate() method for file objects now works on Windows.
2744
2745- Py_Initialize() is no longer called when the DLL is loaded. You
Guido van Rossumb68b77f1997-10-07 19:12:50 +00002746must call it yourself.
Guido van Rossum61000331997-08-15 04:39:58 +00002747
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002748- The time module's clock() function now has good precision through
2749the use of the Win32 API QueryPerformanceCounter().
2750
2751- Mark Hammond will release Python 1.5 versions of PythonWin and his
2752other Windows specific code: the win32api extensions, COM/ActiveX
2753support, and the MFC interface.
2754
Guido van Rossum61000331997-08-15 04:39:58 +00002755
2756Mac
2757---
2758
Guido van Rossum2da391f1997-08-18 21:17:32 +00002759- As always, the Macintosh port will be done by Jack Jansen. He will
2760make a separate announcement for the Mac specific source code and the
2761binary distribution(s) when these are ready.
Guido van Rossum61000331997-08-15 04:39:58 +00002762
2763
Guido van Rossum92664b81997-10-07 00:12:43 +00002764======================================================================