blob: f35e35678dec30bfa26cb8c8b4ed87fbc099299a [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
17From 1.5 to 1.5.1
18=================
19
20General
21-------
22
23- The documentation is now unbundled. It has also been extensively
24modified (mostly to implement a new and more uniform formatting
25style). We figure that most people will prefer to download one of the
26preformatted documentation sets (HTML, PostScript or PDF) and that
27only a minority have a need for the LaTeX or FrameMaker sources. Of
28course, the unbundled documentation sources still released -- just not
29in the same archive file, and perhaps not on the same date.
30
31- All bugs noted on the errors page (and many unnoted) are fixed. All
32new bugs take their places.
33
34Syntax change
35-------------
36
37- The raise statement can now be used without arguments, to re-raise
38a previously set exception. This should be used after catching an
39exception with an except clause only, either in the except clause or
40later in the same function.
41
42Import and module handling
43--------------------------
44
45- The implementation of import has changed to use a mutex (when
46threading is supported). This means that when two threads
47simultaneously import the same module, the import statements are
48serialized. Recursive imports are not affected.
49
50- Rewrote the finalization code almost completely, to be much more
51careful with the order in which modules are destroyed. Destructors
52pwill now generally be able to reference built-in names such as None
53without trouble.
54
55- On case-insensitive platforms such as Mac and Windows, require the
56case of a module's filename, e.g. "SocketServer.py", to match the case
57of the module name as specified in the import statement. This is an
58experimental feature -- if it turns out to break in too many
59situations, it will be removed (or disabled by default) in the future.
60On Windows, it can be disabled on a per-case basis by setting the
61environment variable PYTHONCASEOK (to any value).
62
63- The code for figuring out the default path now distinguishes between
64files, modules, executable files, and directories. When expecting a
65module, we also look for the .pyc or .pyo file.
66
67Parser/tokenizer changes
68------------------------
69
70- The tokenizer can now warn you when your source code mixes tabs and
71spaces for indentation in a manner that depends on the worth of a tab
72in spaces. Use "python -t" or "python -v" to enable this option. Use
73"python -tt" to turn the warnings into errors.
74
75- Return unsigned characters from tok_nextc(), so '\377' isn't
76mistaken for an EOF character.
77
78- Fixed two pernicious bugs in the tokenizer that only affected AIX.
79One was actually a general bug that was triggered by AIX's smaller I/O
80buffer size. The other was a bug in the AIX optimizer's loop
81unrolling code; swapping two statements made the problem go away.
82
83Tools, demos and miscellaneous files
84------------------------------------
85
86- There's a new version of Misc/python-mode.el (the Emacs mode for
87Python) which is much smarter about guessing the indentation style
88used in a particular file. Lots of other cool features too!
89
90- There are two new tools in Tools/scripts: tabnanny.py and
91tabpolice.py, implementing two different ways of checking whether a
92file uses indentation in a way that is sensitive to the interpretation
93of a tab. The preferred module is tabnanny.py (by Tim Peters).
94
95- Some new demo programs:
96
97 Demo/tkinter/guido/paint.py -- Dave Mitchell
98 Demo/sockets/unixserver.py -- Piet van Oostrum
99
100
101- Much better freeze support. The freeze script can now freeze
102hierarchical module names (with a corresponding change to import.c),
103and has a few extra options (e.g. to suppress freezing specific
104modules). It also does much more on Windows NT.
105
106- Version 1.0 of the faq wizard is included (only very small changes
107since version 0.9.0).
108
109- New feature for the ftpmirror script: when removing local files
110(i.e., only when -r is used), do a recursive delete.
111
112Configuring and building Python
113-------------------------------
114
115- Get rid of the check for -linet -- recent Sequent Dynix systems don't
116need this any more and apparently it screws up their configuration.
117
118- Some changes because gcc on SGI doesn't support '-all'.
119
120- Changed the build rules to use $(LIBRARY) instead of
121 -L.. -lpython$(VERSION)
122since the latter trips up the SunOS 4.1.x linker (sigh).
123
124- Fix the bug where the '# dgux is broken' comment in the Makefile
125tripped over Make on some platforms.
126
127- Changes for AIX: install the python.exp file; properly use
128$(srcdir); the makexp_aix script now removes C++ entries of the form
129Class::method.
130
131- Deleted some Makefile targets only used by the (long obsolete)
132gMakefile hacks.
133
134Extension modules
135-----------------
136
137- Performance and threading improvements to the socket and bsddb
138modules, by Christopher Lindblad of Infoseek.
139
140- Added operator.__not__ and operator.not_.
141
142- In the thread module, when a thread exits due to an unhandled
143exception, don't store the exception information in sys.last_*; it
144prevents proper calling of destructors of local variables.
145
146- Fixed a number of small bugs in the cPickle module.
147
148- Changed find() and rfind() in the strop module so that
149find("x","",2) returns -1, matching the implementation in string.py.
150
151- In the time module, be more careful with the result of ctime(), and
152test for HAVE_MKTIME before usinmg mktime().
153
154- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
155modules.
156
157- Added the LOG_SYSLOG constant to the syslog module, if defined.
158
159Standard library modules
160------------------------
161
162- All standard library modules have been converted to an indentation
163style using either only tabs or only spaces -- never a mixture -- if
164they weren't already consistent according to tabnanny.
165
166- New standard library modules:
167
168 threading -- GvR and the thread-sig
169 Java style thread objects -- USE THIS!!!
170
171 getpass -- Piers Lauder
172 simple utilities to prompt for a password and to
173 retrieve the current username
174
175 imaplib -- Piers Lauder
176 interface for the IMAP4 protocol
177
178 poplib -- David Ascher, Piers Lauder
179 interface for the POP3 protocol
180
181 smtplib -- Dragon De Monsyne
182 interface for the SMTP protocol
183
184- Some obsolete modules moved to a separate directory (Lib/lib-old)
185which is *not* in the default module search path:
186
187 Para
188 addpack
189 codehack
190 fmt
191 lockfile
192 newdir
193 ni
194 rand
195 tb
196
197- New version of the PCRE code (Perl Compatible Regular Expressions --
198the re module and the supporting pcre extension) by Andrew Kuchling.
199Incompatible new feature in re.sub(): the handling of escapes in the
200replacement string has changed.
201
202- Interface change in copy.py: a __deepcopy__ method is now called
203with the memo dictionary as an argument.
204
205- Feature change in the tokenize module: differentiate between NEWLINE
206token (an official newline) and NL token (a newline that the grammar
207ignores).
208
209- Several bugfixes to the urllib module. It is now truly thread-safe,
210and several bugs and a portability problem have been fixed. New
211features, all due to Sjoerd Mullender: When creating a temporary file,
212it gives it an appropriate suffix. Support the "data:" URL scheme.
213The open() method uses the tempcache.
214
215- New version of the xmllib module (this time with a test suite!) by
216Sjoerd Mullender.
217
218- Added debugging code to the telnetlib module, to be able to trace
219the actual traffic.
220
221- In the rfc822 module, added support for deleting a header (still no
222support for adding headers, though). Also fixed a bug where an
223illegal address would cause a crash in getrouteaddr(), fixed a
224sign reversal in mktime_tz(), and use the local timezone by default
225(the latter two due to Bill van Melle).
226
227- The normpath() function in the dospath and ntpath modules no longer
228does case normalization -- for that, use the separate function
229normcase() (which always existed); normcase() has been sped up and
230fixed (it was the cause of a crash in Mark Hammond's installer in
231certain locales).
232
233- New command supported by the ftplib module: rmd(); also fixed some
234minor bugs.
235
236- The profile module now uses a different timer function by default --
237time.clock() is generally better than os.times(). This makes it work
238better on Windows NT, too.
239
240- The tempfile module now recovers when os.getcwd() raises an
241exception.
242
243- Fixed some bugs in the random module; gauss() was subtly wrong, and
244vonmisesvariate() should return a full circle. Courtesy Mike Miller,
245Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
246
247- Better default seed in the whrandom module, courtesy Andrew Kuchling.
248
249- Fix slow close() in shelve module.
250
251- The Unix mailbox class in the mailbox module is now more robust when
252a line begins with the string "From " but is definitely not the start
253of a new message. The pattern used can be changed by overriding a
254method or class variable.
255
256- Added a rmtree() function to the copy module.
257
258- Fixed several typos in the pickle module. Also fixed problems when
259unpickling in restricted execution environments.
260
261- Added docstrings and fixed a typo in the py_compile and compileall
262modules. At Mark Hammond's repeated request, py_compile now append a
263newline to the source if it needs one. Both modules support an extra
264parameter to specify the purported source filename (to be used in
265error messages).
266
267- Some performance tweaks by Jeremy Hylton to the gzip module.
268
269- Fixed a bug in the merge order of dictionaries in the ConfigParser
270module. Courtesy Barry Warsaw.
271
272- In the multifile module, support the optional second parameter to
273seek() when possible.
274
275- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
276urlparse now correctly handles Gopher URLs with query strings.
277
278- Fixed a tiny bug in format_exception() in the traceback module.
279Also rewrite tb_lineno() to be compatible with JPython (and not
280disturb the current exception!); by Jim Hugunin.
281
282- The httplib module is more robust when servers send a short response
283-- courtesy Tim O'Malley.
284
285Tkinter and friends
286-------------------
287
288- Various typos and bugs fixed.
289
290- New module Tkdnd implements a drag-and-drop protocol (within one
291application only).
292
293- The event_*() widget methods have been restructured slightly -- they
294no longer use the default root.
295
296- The interfaces for the bind*() and unbind() widget methods have been
297redesigned; the bind*() methods now return the name of the Tcl command
298created for the callback, and this can be passed as a optional
299argument to unbind() in order to delete the command (normally, such
300commands are automatically unbound when the widget is destroyed, but
301for some applications this isn't enough).
302
303- Variable objects now have trace methods to interface to Tcl's
304variable tracing facilities.
305
306- Image objects now have an optional keyword argument, 'master', to
307specify a widget (tree) to which they belong. The image_names() and
308image_types() calls are now also widget methods.
309
310- There's a new global call, Tkinter.NoDefaultRoot(), which disables
311all use of the default root by the Tkinter library. This is useful to
312debug applications that are in the process of being converted from
313relying on the default root to explicit specification of the root
314widget.
315
316- The 'exit' command is deleted from the Tcl interpreter, since it
317provided a loophole by which one could (accidentally) exit the Python
318interpreter without invoking any cleanup code.
319
320- Tcl_Finalize() is now registered as a Python low-level exit handle,
321so Tcl will be finalized when Python exits.
322
323The Python/C API
324----------------
325
326- New function PyObject_Not(x) calculates (not x) according to Python's
327standard rules (basically, it negates the outcome PyObject_IsTrue(x).
328
329- New function _PyModule_Clear(), which clears a module's dictionary
330carefully without removing the __builtins__ entry. This is implied
331when a module object is deallocated (this used to clear the dictionary
332completely).
333
334- New function PyImport_ExecCodeModuleEx(), which extends
335PyImport_ExecCodeModule() by adding an extra parameter to pass it the
336true file.
337
338- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
339allow embedded applications to force a different value for PYTHONHOME.
340
341- New global flag Py_FrozenFlag is set when this is a "frozen" Python
342binary; it suppresses warnings about not being able to find the
343standard library directories.
344
345- New global flag Py_TabcheckFlag is incremented by the -t option and
346causes the tokenizer to issue warnings or errors about inconsistent
347mixing of tabs and spaces for indentation.
348
349Miscellaneous minor changes and bug fixes
350-----------------------------------------
351
352- Improved the error message when an attribute of an attribute-less
353object is requested -- include the name of the attribute and the type
354of the object in the message.
355
356- Sped up int(), long(), float() a bit.
357
358- Fixed a bug in list.sort() that would occasionally dump core.
359
360- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
361when taken tothe real power.
362
363- Fixed a number of bugs in the file reading code, at least one of
364which could cause a core dump on NT, and one of which would
365occasionally cause file.read() to return less than the full contents
366of the file.
367
368- Performance hack by Vladimir Marangozov for stack frame creation.
369
370- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
371
372
373======================================================================
374
375
376From 1.5b2 to 1.5
377=================
378
379- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
380
381- Added doc strings to string.py, stropmodule.c, structmodule.c,
382thanks to Charles Waldman.
383
384- Many nits fixed in the manuals, thanks to Fred Drake and many others
385(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
386HTML markup instead of inline GIF images for tables; only two images
387are left (for obsure bits of math). The index of the HTML version has
388also been much improved. Finally, it is once again possible to
389generate an Emacs info file from the library manual (but I don't
390commit to supporting this in future versions).
391
392- New module: telnetlib.py (a simple telnet client library).
393
394- New tool: Tools/versioncheck/, by Jack Jansen.
395
396- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
397DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
398extension modules.
399
400- Many small changes again to Tkinter.py -- mostly bugfixes and adding
401missing routines. Thanks to Greg McFarlane for reporting a bunch of
402problems and proofreading my fixes.
403
404- The re module and its documentation are up to date with the latest
405version released to the string-sig (Dec. 22).
406
407- Stop test_grp.py from failing when the /etc/group file is empty
408(yes, this happens!).
409
410- Fix bug in integer conversion (mystrtoul.c) that caused
4114294967296==0 to be true!
412
413- The VC++ 4.2 project file should be complete again.
414
415- In tempfile.py, use a better template on NT, and add a new optional
416argument "suffix" with default "" to specify a specific extension for
417the temporary filename (needed sometimes on NT but perhaps also handy
418elsewhere).
419
420- Fixed some bugs in the FAQ wizard, and converted it to use re
421instead of regex.
422
423- Fixed a mysteriously undetected error in dlmodule.c (it was using a
424totally bogus routine name to raise an exception).
425
426- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
427
428- Hopefully harmless changes to the build process to support shared
429libraries on DG/UX. This adds a target to create
430libpython$(VERSION).so; however this target is *only* for DG/UX.
431
432- Fixed a bug in the new format string error checking in getargs.c.
433
434- A simple fix for infinite recursion when printing __builtins__:
435reset '_' to None before printing and set it to the printed variable
436*after* printing (and only when printing is successful).
437
438- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
439parent window is not (Skip Montanaro).
440
441- Fixed the two most annoying problems with ftp URLs in
442urllib.urlopen(); an empty file now correctly raises an error, and it
443is no longer required to explicitly close the returned "file" object
444before opening another ftp URL to the same host and directory.
445
446
447======================================================================
448
449
450From 1.5b1 to 1.5b2
451===================
452
453- Fixed a bug in cPickle.c that caused it to crash right away because
454the version string had a different format.
455
456- Changes in pickle.py and cPickle.c: when unpickling an instance of a
457class that doesn't define the __getinitargs__() method, the __init__()
458constructor is no longer called. This makes a much larger group of
459classes picklable by default, but may occasionally change semantics.
460To force calling __init__() on unpickling, define a __getinitargs__()
461method. Other changes too, in particular cPickle now handles classes
462defined in packages correctly. The same change applies to copying
463instances with copy.py. The cPickle.c changes and some pickle.py
464changes are courtesy Jim Fulton.
465
466- Locale support in he "re" (Perl regular expressions) module. Use
467the flag re.L (or re.LOCALE) to enable locale-specific matching
468rules for \w and \b. The in-line syntax for this flag is (?L).
469
470- The built-in function isinstance(x, y) now also succeeds when y is
471a type object and type(x) is y.
472
473- repr() and str() of class and instance objects now reflect the
474package/module in which the class is defined.
475
476- Module "ni" has been removed. (If you really need it, it's been
477renamed to "ni1". Let me know if this causes any problems for you.
478Package authors are encouraged to write __init__.py files that
479support both ni and 1.5 package support, so the same version can be
480used with Python 1.4 as well as 1.5.)
481
482- The thread module is now automatically included when threads are
483configured. (You must remove it from your existing Setup file,
484since it is now in its own Setup.thread file.)
485
486- New command line option "-x" to skip the first line of the script;
487handy to make executable scripts on non-Unix platforms.
488
489- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
490haven't checked how this affects things, but it should make symbols
491in one shared library available to the next one.
492
493- The Windows installer now installs in the "Program Files" folder on
494the proper volume by default.
495
496- The Windows configuration adds a new main program, "pythonw", and
497registers a new extension, ".pyw" that invokes this. This is a
498pstandard Python interpreter that does not pop up a console window;
499handy for pure Tkinter applications. All output to the original
500stdout and stderr is lost; reading from the original stdin yields
501EOF. Also, both python.exe and pythonw.exe now have a pretty icon
502(a green snake in a box, courtesy Mark Hammond).
503
504- Lots of improvements to emacs-mode.el again. See Barry's web page:
505http://www.python.org/ftp/emacs/pmdetails.html.
506
507- Lots of improvements and additions to the library reference manual;
508many by Fred Drake.
509
510- Doc strings for the following modules: rfc822.py, posixpath.py,
511ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
512
513- Some more regression testing.
514
515- An optional 4th (maxsplit) argument to strop.replace().
516
517- Fixed handling of maxsplit in string.splitfields().
518
519- Tweaked os.environ so it can be pickled and copied.
520
521- The portability problems caused by indented preprocessor commands
522and C++ style comments should be gone now.
523
524- In random.py, added Pareto and Weibull distributions.
525
526- The crypt module is now disabled in Modules/Setup.in by default; it
527is rarely needed and causes errors on some systems where users often
528don't know how to deal with those.
529
530- Some improvements to the _tkinter build line suggested by Case Roole.
531
532- A full suite of platform specific files for NetBSD 1.x, submitted by
533Anders Andersen.
534
535- New Solaris specific header STROPTS.py.
536
537- Moved a confusing occurrence of *shared* from the comments in
538Modules/Setup.in (people would enable this one instead of the real
539one, and get disappointing results).
540
541- Changed the default mode for directories to be group-writable when
542the installation process creates them.
543
544- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
545shared libraries for both.
546
547- Support FreeBSD and NetBSD in posixfile.py.
548
549- Support for the "event" command, new in Tk 4.2. By Case Roole.
550
551- Add Tix_SafeInit() support to tkappinit.c.
552
553- Various bugs fixed in "re.py" and "pcre.c".
554
555- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
556
557- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
558is set.
559
560- Provide default blocksize for retrbinary in ftplib.py (Skip
561Montanaro).
562
563- In NT, pick the username up from different places in user.py (Jeff
564Bauer).
565
566- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
567
568- Many small improvements to Jeff Rush' OS/2 support.
569
570- ospath.py is gone; it's been obsolete for so many years now...
571
572- The reference manual is now set up to prepare better HTML (still
573using webmaker, alas).
574
575- Add special handling to /Tools/freeze for Python modules that are
576imported implicitly by the Python runtime: 'site' and 'exceptions'.
577
578- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
579inside <PRE>, by "Scott".
580
581- Added ConfigParser.py, a generic parser for sectioned configuration
582files.
583
584- In _localemodule.c, LC_MESSAGES is not always defined; put it
585between #ifdefs.
586
587- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
588
589- Demo/scripts/newslist.py: Fix the way the version number is gotten
590out of the RCS revision.
591
592- PyArg_Parse[Tuple] now explicitly check for bad characters at the
593end of the format string.
594
595- Revamped PC/example_nt to support VC++ 5.x.
596
597- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
598after studying the GNU libg++ quicksort. This should be much faster
599if there are lots of duplicates, and otherwise at least as good.
600
601- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
602uudecode bug where it complaints about trailing garbage is still there
603:-( ).
604
605- pickle.py requires integers in text mode to be in decimal notation
606(it used to accept octal and hex, even though it would only generate
607decimal numbers).
608
609- In string.atof(), don't fail when the "re" module is unavailable.
610Plug the ensueing security leak by supplying an empty __builtins__
611directory to eval().
612
613- A bunch of small fixes and improvements to Tkinter.py.
614
615- Fixed a buffer overrun in PC/getpathp.c.
616
617
618======================================================================
619
620
621From 1.5a4 to 1.5b1
622===================
623
624- The Windows NT/95 installer now includes full HTML of all manuals.
625It also has a checkbox that lets you decide whether to install the
626interpreter and library. The WISE installer script for the installer
627is included in the source tree as PC/python15.wse, and so are the
628icons used for Python files. The config.c file for the Windows build
629is now complete with the pcre module.
630
631- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
632evaluated for the prompt.
633
634- The reference manual is brought up to date (more or less -- it still
635needs work, e.g. in the area of package import).
636
637- The icons used by latex2html are now included in the Doc
638subdirectory (mostly so that tarring up the HTML files can be fully
639automated). A simple index.html is also added to Doc (it only works
640after you have successfully run latex2html).
641
642- For all you would-be proselytizers out there: a new version of
643Misc/BLURB describes Python more concisely, and Misc/comparisons
644compares Python to several other languages. Misc/BLURB.WINDOWS
645contains a blurb specifically aimed at Windows programmers (by Mark
646Hammond).
647
648- A new version of the Python mode for Emacs is included as
649Misc/python-mode.el. There are too many new features to list here.
650See http://www.python.org/ftp/emacs/pmdetails.html for more info.
651
652- New module fileinput makes iterating over the lines of a list of
653files easier. (This still needs some more thinking to make it more
654extensible.)
655
656- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
657version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
658Age C++ compiler. I expect that Jeff will also provide a binary
659release for this platform.
660
661- On Linux, the configure script now uses '-Xlinker -export-dynamic'
662instead of '-rdynamic' to link the main program so that it exports its
663symbols to shared libraries it loads dynamically. I hope this doesn't
664break on older Linux versions; it is needed for mklinux and appears to
665work on Linux 2.0.30.
666
667- Some Tkinter resstructuring: the geometry methods that apply to a
668master are now properly usable on toplevel master widgets. There's a
669new (internal) widget class, BaseWidget. New, longer "official" names
670for the geometry manager methods have been added,
671e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
672shorter names still work, and where there's ambiguity, pack wins over
673place wins over grid. Also, the bind_class method now returns its
674value.
675
676- New, RFC-822 conformant parsing of email addresses and address lists
677in the rfc822 module, courtesy Ben Escoto.
678
679- New, revamped tkappinit.c with support for popular packages (PIL,
680TIX, BLT, TOGL). For the last three, you need to execute the Tcl
681command "load {} Tix" (or Blt, or Togl) to gain access to them.
682The Modules/Setup line for the _tkinter module has been rewritten
683using the cool line-breaking feature of most Bourne shells.
684
685- New socket method connect_ex() returns the error code from connect()
686instead of raising an exception on errors; this makes the logic
687required for asynchronous connects simpler and more efficient.
688
689- New "locale" module with (still experimental) interface to the
690standard C library locale interface, courtesy Martin von Loewis. This
691does not repeat my mistake in 1.5a4 of always calling
692setlocale(LC_ALL, ""). In fact, we've pretty much decided that
693Python's standard numerical formatting operations should always use
694the conventions for the C locale; the locale module contains utility
695functions to format numbers according to the user specified locale.
696(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
697"C") after locale-changing calls.) See the library manual. (Alas, the
698promised changes to the "re" module for locale support have not been
699materialized yet. If you care, volunteer!)
700
701- Memory leak plugged in Py_BuildValue when building a dictionary.
702
703- Shared modules can now live inside packages (hierarchical module
704namespaces). No changes to the shared module itself are needed.
705
706- Improved policy for __builtins__: this is a module in __main__ and a
707dictionary everywhere else.
708
709- Python no longer catches SIGHUP and SIGTERM by default. This was
710impossible to get right in the light of thread contexts. If you want
711your program to clean up when a signal happens, use the signal module
712to set up your own signal handler.
713
714- New Python/C API PyNumber_CoerceEx() does not return an exception
715when no coercion is possible. This is used to fix a problem where
716comparing incompatible numbers for equality would raise an exception
717rather than return false as in Python 1.4 -- it once again will return
718false.
719
720- The errno module is changed again -- the table of error messages
721(errorstr) is removed. Instead, you can use os.strerror(). This
722removes redundance and a potential locale dependency.
723
724- New module xmllib, to parse XML files. By Sjoerd Mullender.
725
726- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
727It resets the signal module's notion of what the current process ID
728and thread are, so that signal handlers will work after (and across)
729calls to os.fork().
730
731- Fixed most occurrences of fatal errors due to missing thread state.
732
733- For vgrind (a flexible source pretty printer) fans, there's a simple
734Python definition in Misc/vgrindefs, courtesy Neale Pickett.
735
736- Fixed memory leak in exec statement.
737
738- The test.pystone module has a new function, pystones(loops=LOOPS),
739which returns a (benchtime, stones) tuple. The main() function now
740calls this and prints the report.
741
742- Package directories now *require* the presence of an __init__.py (or
743__init__.pyc) file before they are considered as packages. This is
744done to prevent accidental subdirectories with common names from
745overriding modules with the same name.
746
747- Fixed some strange exceptions in __del__ methods in library modules
748(e.g. urllib). This happens because the builtin names are already
749deleted by the time __del__ is called. The solution (a hack, but it
750works) is to set some instance variables to 0 instead of None.
751
752- The table of built-in module initializers is replaced by a pointer
753variable. This makes it possible to switch to a different table at
754run time, e.g. when a collection of modules is loaded from a shared
755library. (No example code of how to do this is given, but it is
756possible.) The table is still there of course, its name prefixed with
757an underscore and used to initialize the pointer.
758
759- The warning about a thread still having a frame now only happens in
760verbose mode.
761
762- Change the signal finialization so that it also resets the signal
763handlers. After this has been called, our signal handlers are no
764longer active!
765
766- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
767literals. There's now also a test fort this module.
768
769- The copy module now also uses __dict__.update(state) instead of
770going through individual attribute assignments, for class instances
771without a __setstate__ method.
772
773- New module reconvert translates old-style (regex module) regular
774expressions to new-style (re module, Perl-style) regular expressions.
775
776- Most modules that used to use the regex module now use the re
777module. The grep module has a new pgrep() function which uses
778Perl-style regular expressions.
779
780- The (very old, backwards compatibility) regexp.py module has been
781deleted.
782
783- Restricted execution (rexec): added the pcre module (support for the
784re module) to the list of trusted extension modules.
785
786- New version of Jim Fulton's CObject object type, adds
787PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
788
789- Some patches to Lee Busby's fpectl mods that accidentally didn't
790make it into 1.5a4.
791
792- In the string module, add an optional 4th argument to count(),
793matching find() etc.
794
795- Patch for the nntplib module by Charles Waldman to add optional user
796and password arguments to NNTP.__init__(), for nntp servers that need
797them.
798
799- The str() function for class objects now returns
800"modulename.classname" instead of returning the same as repr().
801
802- The parsing of \xXX escapes no longer relies on sscanf().
803
804- The "sharedmodules" subdirectory of the installation is renamed to
805"lib-dynload". (You may have to edit your Modules/Setup file to fix
806this in an existing installation!)
807
808- Fixed Don Beaudry's mess-up with the OPT test in the configure
809script. Certain SGI platforms will still issue a warning for each
810compile; there's not much I can do about this since the compiler's
811exit status doesn't indicate that I was using an obsolete option.
812
813- Fixed Barry's mess-up with {}.get(), and added test cases for it.
814
815- Shared libraries didn't quite work under AIX because of the change
816in status of the GNU readline interface. Fix due to by Vladimir
817Marangozov.
818
819
820======================================================================
821
822
823From 1.5a3 to 1.5a4
824===================
825
826- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
827feature; better install instructions; removed faqmain.py (which was an
828older version).
829
830- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
831about the treatment of lines starting with '.'. Added a minimal test
832function.
833
834- struct module: ignore most whitespace in format strings.
835
836- urllib.py: close the socket and temp file in URLopener.retrieve() so
837that multiple retrievals using the same connection work.
838
839- All standard exceptions are now classes by default; use -X to make
840them strings (for backward compatibility only).
841
842- There's a new standard exception hierarchy, defined in the standard
843library module exceptions.py (which you never need to import
844explicitly). See
845http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
846more info.
847
848- Three new C API functions:
849
850 - int PyErr_GivenExceptionMatches(obj1, obj2)
851
852 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
853 instance of type obj2, or of a class derived from obj2
854
855 - int PyErr_ExceptionMatches(obj)
856
857 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
858 PyErr_Occurred() as obj1. This will be the more commonly called
859 function.
860
861 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
862
863 Normalizes exceptions, and places the normalized values in the
864 arguments. If type is not a class, this does nothing. If type is a
865 class, then it makes sure that value is an instance of the class by:
866
867 1. if instance is of the type, or a class derived from type, it does
868 nothing.
869
870 2. otherwise it instantiates the class, using the value as an
871 argument. If value is None, it uses an empty arg tuple, and if
872 the value is a tuple, it uses just that.
873
874- Another new C API function: PyErr_NewException() creates a new
875exception class derived from Exception; when -X is given, it creates a
876new string exception.
877
878- core interpreter: remove the distinction between tuple and list
879unpacking; allow an arbitrary sequence on the right hand side of any
880unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
881thing, which should really be called UNPACK_SEQUENCE.)
882
883- classes: Allow assignments to an instance's __dict__ or __class__,
884so you can change ivars (including shared ivars -- shock horror) and
885change classes dynamically. Also make the check on read-only
886attributes of classes less draconic -- only the specials names
887__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
888assigned.
889
890- Two new built-in functions: issubclass() and isinstance(). Both
891take classes as their second arguments. The former takes a class as
892the first argument and returns true iff first is second, or is a
893subclass of second. The latter takes any object as the first argument
894and returns true iff first is an instance of the second, or any
895subclass of second.
896
897- configure: Added configuration tests for presence of alarm(),
898pause(), and getpwent().
899
900- Doc/Makefile: changed latex2html targets.
901
902- classes: Reverse the search order for the Don Beaudry hook so that
903the first class with an applicable hook wins. Makes more sense.
904
905- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
906now legal to call these more than once. The first call to
907Py_Initialize() initializes, the first call to Py_Finalize()
908finalizes. There's also a new API, Py_IsInitalized() which checks
909whether we are already initialized (in case you want to leave things
910as they were).
911
912- Completely disable the declarations for malloc(), realloc() and
913free(). Any 90's C compiler has these in header files, and the tests
914to decide whether to suppress the declarations kept failing on some
915platforms.
916
917- *Before* (instead of after) signalmodule.o is added, remove both
918intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
919ld on various systems.
920
921- Added reop to PC/config.c
922
923- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
924Removed outdated HP-UX comments from README. Added Cray T3E comments.
925
926- Various renames of statically defined functions that had name
927conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
928roundup (sys/types.h).
929
930- urllib.py: Interpret three slashes in file: URL as local file (for
931Netscape on Windows/Mac).
932
933- copy.py: Make sure the objects returned by __getinitargs__() are
934kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
935easily reproducable because it requires a later call to
936__getinitargs__() to return a tuple that happens to be allocated at
937the same address.)
938
939- Added definition of AR to toplevel Makefile. Renamed @buildno temp
940file to buildno1.
941
942- Moved Include/assert.h to Parser/assert.h, which seems to be the
943only place where it's needed.
944
945- Tweaked the dictionary lookup code again for some more speed
946(Vladimir Marangozov).
947
948- NT build: Changed the way python15.lib is included in the other
949projects. Per Mark Hammond's suggestion, add it to the extra libs in
950Settings instead of to the project's source files.
951
952- regrtest.py: Change default verbosity so that there are only three
953levels left: -q, default and -v. In default mode, the name of each
954test is now printed. -v is the same as the old -vv. -q is more quiet
955than the old default mode.
956
957- Removed the old FAQ from the distribution. You now have to get it
958from the web!
959
960- Removed the PC/make_nt.in file from the distribution; it is no
961longer needed.
962
963- Changed the build sequence so that shared modules are built last.
964This fixes things for AIX and doesn't hurt elsewhere.
965
966- Improved test for GNU MP v1 in mpzmodule.c
967
968- fileobject.c: ftell() on Linux discards all buffered data; changed
969read() code to use lseek() instead to get the same effect
970
971- configure.in, configure, importdl.c: NeXT sharedlib fixes
972
973- tupleobject.c: PyTuple_SetItem asserts refcnt==1
974
975- resource.c: Different strategy regarding whether to declare
976getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
977conflicting decls in its headers. Choice: only declare the return
978type, not the argument prototype, and not on Linux.
979
980- importdl.c, configure*: set sharedlib extensions properly for NeXT
981
982- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
983fixed; moved addition of PURIFY to LINKCC to configure
984
985- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
986added to shup up various compilers.
987
988- _tkinter.c: removed buggy mac #ifndef
989
990- Doc: various Mac documentation changes, added docs for 'ic' module
991
992- PC/make_nt.in: deleted
993
994- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
995"")
996
997- test_rotor.py: print b -> print `b`
998
999- Tkinter.py: (tagOrId) -> (tagOrId,)
1000
1001- Tkinter.py: the Tk class now also has a configure() method and
1002friends (they have been moved to the Misc class to accomplish this).
1003
1004- dict.get(key[, default]) returns dict[key] if it exists, or default
1005if it doesn't. The default defaults to None. This is quicker for
1006some applications than using either has_key() or try:...except
1007KeyError:....
1008
1009- Tools/webchecker/: some small changes to webchecker.py; added
1010websucker.py (a simple web site mirroring script).
1011
1012- Dictionary objects now have a get() method (also in UserDict.py).
1013dict.get(key, default) returns dict[key] if it exists and default
1014otherwise; default defaults to None.
1015
1016- Tools/scripts/logmerge.py: print the author, too.
1017
1018- Changes to import: support for "import a.b.c" is now built in. See
1019http://grail.cnri.reston.va.us/python/essays/packages.html
1020for more info. Most important deviations from "ni.py": __init__.py is
1021executed in the package's namespace instead of as a submodule; and
1022there's no support for "__" or "__domain__". Note that "ni.py" is not
1023changed to match this -- it is simply declared obsolete (while at the
1024same time, it is documented...:-( ).
1025Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1026for an example implementation of hierarchical module import written in
1027Python).
1028
1029- More changes to import: the site.py module is now imported by
1030default when Python is initialized; use -S to disable it. The site.py
1031module extends the path with several more directories: site-packages
1032inside the lib/python1.5/ directory, site-python in the lib/
1033directory, and pathnames mentioned in *.pth files found in either of
1034those directories. See
1035http://grail.cnri.reston.va.us/python/essays/packages.html
1036for more info.
1037
1038- Changes to standard library subdirectory names: those subdirectories
1039that are not packages have been renamed with a hypen in their name,
1040e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1041The test suite is now a package -- to run a test, you must now use
1042"import test.test_foo".
1043
1044- A completely new re.py module is provided (thanks to Andrew
1045Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
1046"pcre" re compiler and engine. For a while, the "old" re.py (which
1047was new in 1.5a3!) will be kept around as re1.py. The "old" regex
1048module and underlying parser and engine are still present -- while
1049regex is now officially obsolete, it will probably take several major
1050release cycles before it can be removed.
1051
1052- The posix module now has a strerror() function which translates an
1053error code to a string.
1054
1055- The emacs.py module (which was long obsolete) has been removed.
1056
1057- The universal makefile Misc/Makefile.pre.in now features an
1058"install" target. By default, installed shared libraries go into
1059$exec_prefix/lib/python$VERSION/site-packages/.
1060
1061- The install-sh script is installed with the other configuration
1062specific files (in the config/ subdirectory).
1063
1064- It turns out whatsound.py and sndhdr.py were identical modules.
1065Since there's also an imghdr.py file, I propose to make sndhdr.py the
1066official one. For compatibility, whatsound.py imports * from
1067sndhdr.py.
1068
1069- Class objects have a new attribute, __module__, giving the name of
1070the module in which they were declared. This is useful for pickle and
1071for printing the full name of a class exception.
1072
1073- Many extension modules no longer issue a fatal error when their
1074initialization fails; the importing code now checks whether an error
1075occurred during module initialization, and correctly propagates the
1076exception to the import statement.
1077
1078- Most extension modules now raise class-based exceptions (except when
1079-X is used).
1080
1081- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1082thread state -- just don't manipulate the lock if it isn't there.
1083
1084- Fixed a bug in Python/getopt.c that made it do the wrong thing when
1085an option was a single '-'. Thanks to Andrew Kuchling.
1086
1087- New module mimetypes.py will guess a MIME type from a filename's
1088extension.
1089
1090- Windows: the DLL version is now settable via a resource rather than
1091being hardcoded. This can be used for "branding" a binary Python
1092distribution.
1093
1094- urllib.py is now threadsafe -- it now uses re instead of regex, and
1095sys.exc_info() instead of sys.exc_{type,value}.
1096
1097- Many other library modules that used to use
1098sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1099using sys.exc_info().
1100
1101- The functions in popen2 have an optional buffer size parameter.
1102Also, the command argument can now be either a string (passed to the
1103shell) or a list of arguments (passed directly to execv).
1104
1105
1106- Alas, the thread support for _tkinter released with 1.5a3 didn't
1107work. It's been rewritten. The bad news is that it now requires a
1108modified version of a file in the standard Tcl distribution, which you
1109must compile with a -I option pointing to the standard Tcl source
1110tree. For this reason, the thread support is disabled by default.
1111
1112- The errno extension module adds two tables: errorcode maps errno
1113numbers to errno names (e.g. EINTR), and errorstr maps them to
1114message strings. (The latter is redundant because the new call
1115posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1116
1117- The readline extension module now provides some interfaces to
1118internal readline routines that make it possible to write a completer
1119in Python. An example completer, rlcompleter.py, is provided.
1120
1121 When completing a simple identifier, it completes keywords,
1122 built-ins and globals in __main__; when completing
1123 NAME.NAME..., it evaluates (!) the expression up to the last
1124 dot and completes its attributes.
1125
1126 It's very cool to do "import string" type "string.", hit the
1127 completion key (twice), and see the list of names defined by
1128 the string module!
1129
1130 Tip: to use the tab key as the completion key, call
1131
1132 readline.parse_and_bind("tab: complete")
1133
1134- The traceback.py module has a new function tb_lineno() by Marc-Andre
1135Lemburg which extracts the line number from the linenumber table in
1136the code object. Apparently the traceback object doesn't contains the
1137right linenumber when -O is used. Rather than guessing whether -O is
1138on or off, the module itself uses tb_lineno() unconditionally.
1139
1140- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1141to tag_bind() so it works again.
1142
1143- The pystone script is now a standard library module. Example use:
1144"import test.pystone; test.pystone.main()".
1145
1146- The import of the readline module in interactive mode is now also
1147attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1148Lemburg, who asked for this. :-)
1149
1150- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1151Mullender, to be closer to the standard. This fixes the getaddr()
1152method. Unfortunately, getaddrlist() is as broken as ever, since it
1153splits on commas without regard for RFC 822 quoting conventions.
1154
1155- pprint.py: correctly emit trailing "," in singleton tuples.
1156
1157- _tkinter.c: export names for its type objects, TkappType and
1158TkttType.
1159
1160- pickle.py: use __module__ when defined; fix a particularly hard to
1161reproduce bug that confuses the memo when temporary objects are
1162returned by custom pickling interfaces; and a semantic change: when
1163unpickling the instance variables of an instance, use
1164inst.__dict__.update(value) instead of a for loop with setattr() over
1165the value.keys(). This is more consistent (the pickling doesn't use
1166getattr() either but pickles inst.__dict__) and avoids problems with
1167instances that have a __setattr__ hook. But it *is* a semantic change
1168(because the setattr hook is no longer used). So beware!
1169
1170- config.h is now installed (at last) in
1171$exec_prefix/include/python1.5/. For most sites, this means that it
1172is actually in $prefix/include/python1.5/, with all the other Python
1173include files, since $prefix and $exec_prefix are the same by
1174default.
1175
1176- The imp module now supports parts of the functionality to implement
1177import of hierarchical module names. It now supports find_module()
1178and load_module() for all types of modules. Docstrings have been
1179added for those functions in the built-in imp module that are still
1180relevant (some old interfaces are obsolete). For a sample
1181implementation of hierarchical module import in Python, see the new
1182library module knee.py.
1183
1184- The % operator on string objects now allows arbitrary nested parens
1185in a %(...)X style format. (Brad Howes)
1186
1187- Reverse the order in which Setup and Setup.local are passed to the
1188makesetup script. This allows variable definitions in Setup.local to
1189override definitions in Setup. (But you'll still have to edit Setup
1190if you want to disable modules that are enabled by default, or if such
1191modules need non-standard options.)
1192
1193- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1194is like PyImport_ImporModule(name) but receives the globals and locals
1195dict and the fromlist arguments as well. (The name is a char*; the
1196others are PyObject*s).
1197
1198- The 'p' format in the struct extension module alloded to above is
1199new in 1.5a4.
1200
1201- The types.py module now uses try-except in a few places to make it
1202more likely that it can be imported in restricted mode. Some type
1203names are undefined in that case, e.g. CodeType (inaccessible),
1204FileType (not always accessible), and TracebackType and FrameType
1205(inaccessible).
1206
1207- In urllib.py: added separate administration of temporary files
1208created y URLopener.retrieve() so cleanup() can properly remove them.
1209The old code removed everything in tempcache which was a bad idea if
1210the user had passed a non-temp file into it. Also, in basejoin(),
1211interpret relative paths starting in "../". This is necessary if the
1212server uses symbolic links.
1213
1214- The Windows build procedure and project files are now based on
1215Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1216directory. It is much more robust, and properly builds separate Debug
1217and Release versions. (The installer will be added shortly.)
1218
1219- Added casts and changed some return types in regexpr.c to avoid
1220compiler warnings or errors on some platforms.
1221
1222- The AIX build tools for shared libraries now supports VPATH. (Donn
1223Cave)
1224
1225- By default, disable the "portable" multimedia modules audioop,
1226imageop, and rgbimg, since they don't work on 64-bit platforms.
1227
1228- Fixed a nasty bug in cStringIO.c when code was actually using the
1229close() method (the destructors would try to free certain fields a
1230second time).
1231
1232- For those who think they need it, there's a "user.py" module. This
1233is *not* imported by default, but can be imported to run user-specific
1234setup commands, ~/.pythonrc.py.
1235
1236- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1237Vladimir Marangozov, and others.
1238
1239- Added os.altsep; this is '/' on DOS/Windows, and None on systems
1240with a sane filename syntax.
1241
1242- os.py: Write out the dynamic OS choice, to avoid exec statements.
1243Adding support for a new OS is now a bit more work, but I bet that
1244'dos' or 'nt' will cover most situations...
1245
1246- The obsolete exception AccessError is now really gone.
1247
1248- Tools/faqwiz/: New installation instructions show how to maintain
1249multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
1250Added instructions to bootstrap script, too. Version bumped to 0.8.1.
1251Added <html>...</html> feature suggested by Skip Montanaro. Added
1252leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1253default SRCDIR.
1254
1255- Documentation for the relatively new modules "keyword" and "symbol"
1256has been added (to the end of the section on the parser extension
1257module).
1258
1259- In module bisect.py, but functions have two optional argument 'lo'
1260and 'hi' which allow you to specify a subsequence of the array to
1261operate on.
1262
1263- In ftplib.py, changed most methods to return their status (even when
1264it is always "200 OK") rather than swallowing it.
1265
1266- main() now calls setlocale(LC_ALL, ""), if setlocale() and
1267<locale.h> are defined.
1268
1269- Changes to configure.in, the configure script, and both
1270Makefile.pre.in files, to support SGI's SGI_ABI platform selection
1271environment variable.
1272
1273
1274======================================================================
1275
1276
Guido van Rossum7ea639b1997-11-26 16:36:28 +00001277From 1.4 to 1.5a3
1278=================
1279
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001280Security
1281--------
1282
1283- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
1284please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +00001285
1286Miscellaneous
1287-------------
1288
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001289- Because of various (small) incompatible changes in the Python
1290bytecode interpreter, the magic number for .pyc files has changed
1291again.
1292
Guido van Rossum2da391f1997-08-18 21:17:32 +00001293- The default module search path is now much saner. Both on Unix and
1294Windows, it is essentially derived from the path to the executable
1295(which can be overridden by setting the environment variable
1296$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
1297front of the default path, like in Unix (instead of overriding the
1298default path). On Windows, the directory containing the executable is
1299added to the end of the path.
1300
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001301- A new version of python-mode.el for Emacs has been included. Also,
1302a new file ccpy-style.el has been added to configure Emacs cc-mode for
1303the preferred style in Python C sources.
1304
Guido van Rossum2da391f1997-08-18 21:17:32 +00001305- On Unix, when using sys.argv[0] to insert the script directory in
1306front of sys.path, expand a symbolic link. You can now install a
1307program in a private directory and have a symbolic link to it in a
1308public bin directory, and it will put the private directory in the
1309module search path. Note that the symlink is expanded in sys.path[0]
1310but not in sys.argv[0], so you can still tell the name by which you
1311were invoked.
1312
1313- It is now recommended to use ``#!/usr/bin/env python'' instead of
1314``#!/usr/local/bin/python'' at the start of executable scripts, except
1315for CGI scripts. It has been determined that the use of /usr/bin/env
1316is more portable than that of /usr/local/bin/python -- scripts almost
1317never have to be edited when the Python interpreter lives in a
1318non-standard place. Note that this doesn't work for CGI scripts since
1319the python executable often doesn't live in the HTTP server's default
1320search path.
Guido van Rossum61000331997-08-15 04:39:58 +00001321
1322- The silly -s command line option and the corresponding
1323PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
1324flag in the Python/C API) are gone.
1325
1326- Most problems on 64-bit platforms should now be fixed. Andrew
1327Kuchling helped. Some uncommon extension modules are still not
1328clean (image and audio ops?).
1329
1330- Fixed a bug where multiple anonymous tuple arguments would be mixed up
1331when using the debugger or profiler (reported by Just van Rossum).
1332The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
1333would print the wrong value when run under the debugger or profiler.
1334
Guido van Rossum2da391f1997-08-18 21:17:32 +00001335- The hacks that the dictionary implementation used to speed up
1336repeated lookups of the same C string were removed; these were a
1337source of subtle problems and don't seem to serve much of a purpose
1338any longer.
1339
1340- All traces of support for the long dead access statement have been
1341removed from the sources.
1342
Guido van Rossum61000331997-08-15 04:39:58 +00001343- Plugged the two-byte memory leak in the tokenizer when reading an
1344interactive EOF.
1345
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001346- There's a -O option to the interpreter that removes SET_LINENO
1347instructions and assert statements (see below); it uses and produces
1348.pyo files instead of .pyc files. The speedup is only a few percent
1349in most cases. The line numbers are still available in the .pyo file,
1350as a separate table (which is also available in .pyc files). However,
1351the removal of the SET_LINENO instructions means that the debugger
1352(pdb) can't set breakpoints on lines in -O mode. The traceback module
1353contains a function to extract a line number from the code object
1354referenced in a traceback object. In the future it should be possible
1355to write external bytecode optimizers that create better optimized
1356.pyo files, and there should be more control over optimization;
1357consider the -O option a "teaser". Without -O, the assert statement
1358actually generates code that first checks __debug__; if this variable
1359is false, the assertion is not checked. __debug__ is a built-in
1360variable whose value is initialized to track the -O flag (it's true
1361iff -O is not specified). With -O, no code is generated for assert
1362statements, nor for code of the form ``if __debug__: <something>''.
1363Sorry, no further constant folding happens.
1364
Guido van Rossum61000331997-08-15 04:39:58 +00001365
1366Performance
1367-----------
1368
Guido van Rossum2da391f1997-08-18 21:17:32 +00001369- It's much faster (almost twice for pystone.py -- see
1370Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +00001371
1372- Some speedup by using separate free lists for method objects (both
1373the C and the Python variety) and for floating point numbers.
1374
1375- Big speedup by allocating frame objects with a single malloc() call.
1376The Python/C API for frames is changed (you shouldn't be using this
1377anyway).
1378
1379- Significant speedup by inlining some common opcodes for common operand
1380types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
1381
1382- Small speedup by reordering the method tables of some common
1383objects (e.g. list.append is now first).
1384
Guido van Rossum2da391f1997-08-18 21:17:32 +00001385- Big optimization to the read() method of file objects. A read()
1386without arguments now attempts to use fstat to allocate a buffer of
1387the right size; for pipes and sockets, it will fall back to doubling
1388the buffer size. While that the improvement is real on all systems,
1389it is most dramatic on Windows.
1390
Guido van Rossum61000331997-08-15 04:39:58 +00001391
1392Documentation
1393-------------
1394
1395- Many new pieces of library documentation were contributed, mostly by
1396Andrew Kuchling. Even cmath is now documented! There's also a
1397chapter of the library manual, "libundoc.tex", which provides a
1398listing of all undocumented modules, plus their status (e.g. internal,
1399obsolete, or in need of documentation). Also contributions by Sue
1400Williams, Skip Montanaro, and some module authors who succumbed to
1401pressure to document their own contributed modules :-). Note that
1402printing the documentation now kills fewer trees -- the margins have
1403been reduced.
1404
1405- I have started documenting the Python/C API. Unfortunately this project
1406hasn't been completed yet. It will be complete before the final release of
1407Python 1.5, though. At the moment, it's better to read the LaTeX source
1408than to attempt to run it through LaTeX and print the resulting dvi file.
1409
1410- The posix module (and hence os.py) now has doc strings! Thanks to Neil
1411Schemenauer. I received a few other contributions of doc strings. In most
1412other places, doc strings are still wishful thinking...
1413
1414
1415Language changes
1416----------------
1417
1418- Private variables with leading double underscore are now a permanent
1419feature of the language. (These were experimental in release 1.4. I have
1420favorable experience using them; I can't label them "experimental"
1421forever.)
1422
1423- There's new string literal syntax for "raw strings". Prefixing a string
1424literal with the letter r (or R) disables all escape processing in the
1425string; for example, r'\n' is a two-character string consisting of a
1426backslash followed by the letter n. This combines with all forms of string
1427quotes; it is actually useful for triple quoted doc strings which might
1428contain references to \n or \t. An embedded quote prefixed with a
1429backslash does not terminate the string, but the backslash is still
1430included in the string; for example, r'\'' is a two-character string
1431consisting of a backslash and a quote. (Raw strings are also
1432affectionately known as Robin strings, after their inventor, Robin
1433Friedrich.)
1434
Guido van Rossum2da391f1997-08-18 21:17:32 +00001435- There's a simple assert statement, and a new exception
1436AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
1437not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001438condition is not available; it would be too complicated to generate
1439code for this (since the code is generated from a parse tree).
1440However, the text is displayed as part of the traceback!
1441
1442- The raise statement has a new feature: when using "raise SomeClass,
1443somevalue" where somevalue is not an instance of SomeClass, it
1444instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
1445instance of a *derived* class of SomeClass, the exception class raised
1446is set to somevalue.__class__, and SomeClass is ignored after that.
1447
1448- Duplicate keyword arguments are now detected at compile time;
1449f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +00001450
1451
1452Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001453---------------------------
1454
Guido van Rossum2da391f1997-08-18 21:17:32 +00001455- There's a new exception FloatingPointError (used only by Lee Busby's
1456patches to catch floating point exceptions, at the moment).
1457
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001458- The obsolete exception ConflictError (presumably used by the long
1459obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001460
Guido van Rossum61000331997-08-15 04:39:58 +00001461- There's a new function sys.exc_info() which returns the tuple
1462(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001463
Guido van Rossum61000331997-08-15 04:39:58 +00001464- There's a new variable sys.executable, pointing to the executable file
1465for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001466
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001467- The sort() methods for lists no longer uses the C library qsort(); I
1468wrote my own quicksort implementation, with lots of help (in the form
1469of a kind of competition) from Tim Peters. This solves a bug in
1470dictionary comparisons on some Solaris versions when Python is built
1471with threads, and makes sorting lists even faster.
1472
1473- The semantics of comparing two dictionaries have changed, to make
1474comparison of unequal dictionaries faster. A shorter dictionary is
1475always considered smaller than a larger dictionary. For dictionaries
1476of the same size, the smallest differing element determines the
1477outcome (which yields the same results as before in this case, without
1478explicit sorting). Thanks to Aaron Watters for suggesting something
1479like this.
1480
Guido van Rossum61000331997-08-15 04:39:58 +00001481- The semantics of try-except have changed subtly so that calling a
1482function in an exception handler that itself raises and catches an
1483exception no longer overwrites the sys.exc_* variables. This also
1484alleviates the problem that objects referenced in a stack frame that
1485caught an exception are kept alive until another exception is caught
1486-- the sys.exc_* variables are restored to their previous value when
1487returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001488
Guido van Rossum61000331997-08-15 04:39:58 +00001489- There's a new "buffer" interface. Certain objects (e.g. strings and
1490arrays) now support the "buffer" protocol. Buffer objects are acceptable
1491whenever formerly a string was required for a write operation; mutable
1492buffer objects can be the target of a read operation using the call
1493f.readinto(buffer). A cool feature is that regular expression matching now
1494also work on array objects. Contribution by Jack Jansen. (Needs
1495documentation.)
1496
1497- String interning: dictionary lookups are faster when the lookup
1498string object is the same object as the key in the dictionary, not
1499just a string with the same value. This is done by having a pool of
1500"interned" strings. Most names generated by the interpreter are now
1501automatically interned, and there's a new built-in function intern(s)
1502that returns the interned version of a string. Interned strings are
1503not a different object type, and interning is totally optional, but by
1504interning most keys a speedup of about 15% was obtained for the
1505pystone benchmark.
1506
1507- Dictionary objects have several new methods; clear() and copy() have
1508the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001509dictionary d into this one, overriding existing keys. The dictionary
1510implementation file is now called dictobject.c rather than the
1511confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +00001512
Guido van Rossum61000331997-08-15 04:39:58 +00001513- The intrinsic function dir() is much smarter; it looks in __dict__,
1514__members__ and __methods__.
1515
Guido van Rossum2da391f1997-08-18 21:17:32 +00001516- The intrinsic functions int(), long() and float() can now take a
1517string argument and then do the same thing as string.atoi(),
1518string.atol(), and string.atof(). No second 'base' argument is
1519allowed, and complex() does not take a string (nobody cared enough).
1520
Guido van Rossum61000331997-08-15 04:39:58 +00001521- When a module is deleted, its globals are now deleted in two phases.
1522In the first phase, all variables whose name begins with exactly one
1523underscore are replaced by None; in the second phase, all variables
1524are deleted. This makes it possible to have global objects whose
1525destructors depend on other globals. The deletion order within each
1526phase is still random.
1527
1528- It is no longer an error for a function to be called without a
1529global variable __builtins__ -- an empty directory will be provided
1530by default.
1531
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001532- Guido's corollary to the "Don Beaudry hook": it is now possible to
1533do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +00001534faint of heart; and undocumented as yet, but basically if a base class
1535is an instance, its class will be instantiated to create the new
1536class. Jim Fulton will love it -- it also works with instances of his
1537"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001538__class__ attribute on the purported base class. See
1539Demo/metaclasses/index.html for an explanation and see that directory
1540for examples.
1541
1542- Another change is that the Don Beaudry hook is now invoked when
1543*any* base class is special. (Up to 1.5a3, the *last* special base
1544class is used; in 1.5a4, the more rational choice of the *first*
1545special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +00001546
Guido van Rossum2da391f1997-08-18 21:17:32 +00001547- New optional parameter to the readlines() method of file objects.
1548This indicates the number of bytes to read (the actual number of bytes
1549read will be somewhat larger due to buffering reading until the end of
1550the line). Some optimizations have also been made to speed it up (but
1551not as much as read()).
1552
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001553- Complex numbers no longer have the ".conj" pseudo attribute; use
1554z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
1555now *do* support the __members__ and __methods__ special attributes.
1556
1557- The complex() function now looks for a __complex__() method on class
1558instances before giving up.
1559
1560- Long integers now support arbitrary shift counts, so you can now
1561write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
1562shift count for this.)
1563
1564- The hex() and oct() functions have been changed so that for regular
1565integers, they never emit a minus sign. For example, on a 32-bit
1566machine, oct(-1) now returns '037777777777' and hex(-1) returns
1567'0xffffffff'. While this may seem inconsistent, it is much more
1568useful. (For long integers, a minus sign is used as before, to fit
1569the result in memory :-)
1570
1571- The hash() function computes better hashes for several data types,
1572including strings, floating point numbers, and complex numbers.
1573
Guido van Rossum61000331997-08-15 04:39:58 +00001574
1575New extension modules
1576---------------------
1577
1578- New extension modules cStringIO.c and cPickle.c, written by Jim
1579Fulton and other folks at Digital Creations. These are much more
1580efficient than their Python counterparts StringIO.py and pickle.py,
1581but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +00001582faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001583still significant.
Guido van Rossum61000331997-08-15 04:39:58 +00001584
1585- New extension module zlibmodule.c, interfacing to the free zlib
1586library (gzip compatible compression). There's also a module gzip.py
1587which provides a higher level interface. Written by Andrew Kuchling
1588and Jeremy Hylton.
1589
1590- New module readline; see the "miscellaneous" section above.
1591
1592- New Unix extension module resource.c, by Jeremy Hylton, provides
1593access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
1594related symbolic constants.
1595
1596- New extension puremodule.c, by Barry Warsaw, which interfaces to the
1597Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
1598possible to enable Purify by simply setting the PURIFY Makefile
1599variable in the Modules/Setup file.
1600
1601
1602Changes in extension modules
1603----------------------------
1604
1605- The struct extension module has several new features to control byte
1606order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001607on platforms where this is not the native format. It uses uppercase
1608format codes for unsigned integers of various sizes (always using
1609Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
1610and 'p' for "Pascal strings" (with a leading length byte, included in
Guido van Rossum92664b81997-10-07 00:12:43 +00001611the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
1612big-endian data and '<' forces little-endian data; these also select
1613standard data sizes and disable automatic alignment (use pad bytes as
1614needed).
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001615
1616- The array module supports uppercase format codes for unsigned data
1617formats (like the struct module).
Guido van Rossum61000331997-08-15 04:39:58 +00001618
1619- The fcntl extension module now exports the needed symbolic
1620constants. (Formerly these were in FCNTL.py which was not available
1621or correct for all platforms.)
1622
1623- The extension modules dbm, gdbm and bsddb now check that the
1624database is still open before making any new calls.
1625
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001626- The dbhash module is no more. Use bsddb instead. (There's a third
1627party interface for the BSD 2.x code somewhere on the web; support for
1628bsddb will be deprecated.)
1629
1630- The gdbm module now supports a sync() method.
1631
1632- The socket module now has some new functions: getprotobyname(), and
1633the set {ntoh,hton}{s,l}().
1634
Guido van Rossum61000331997-08-15 04:39:58 +00001635- Various modules now export their type object: socket.SocketType,
1636array.ArrayType.
1637
Guido van Rossum2da391f1997-08-18 21:17:32 +00001638- The socket module's accept() method now returns unknown addresses as
1639a tuple rather than raising an exception. (This can happen in
1640promiscuous mode.) Theres' also a new function getprotobyname().
1641
Guido van Rossum61000331997-08-15 04:39:58 +00001642- The pthread support for the thread module now works on most platforms.
1643
1644- STDWIN is now officially obsolete. Support for it will eventually
1645be removed from the distribution.
1646
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001647- The binascii extension module is now hopefully fully debugged.
1648(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
1649received.)
Guido van Rossum61000331997-08-15 04:39:58 +00001650
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001651- audioop.c: added a ratecv() function; better handling of overflow in
1652add().
Guido van Rossum2da391f1997-08-18 21:17:32 +00001653
1654- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
1655Windows, also O_TEXT and O_BINARY. The 'error' variable (the
1656exception is raises) is renamed -- its string value is now "os.error",
1657so newbies don't believe they have to import posix (or nt) to catch
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001658it when they see os.error reported as posix.error. The execve()
1659function now accepts any mapping object for the environment.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001660
1661- A new version of the al (audio library) module for SGI was
1662contributed by Sjoerd Mullender.
1663
1664- The regex module has a new function get_syntax() which retrieves the
1665syntax setting set by set_syntax(). The code was also sanitized,
1666removing worries about unclean error handling. See also below for its
1667successor, re.py.
1668
1669- The "new" module (which creates new objects of various types) once
1670again has a fully functioning new.function() method. Dangerous as
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001671ever! Also, new.code() has several new arguments.
1672
1673- A problem has been fixed in the rotor module: on systems with signed
1674characters, rotor-encoded data was not portable when the key contained
16758-bit characters. Also, setkey() now requires its argument rather
1676than having broken code to default it.
1677
1678- The sys.builtin_module_names variable is now a tuple. Another new
1679variables in sys is sys.executable (the full path to the Python
1680binary, if known).
1681
1682- The specs for time.strftime() have undergone some revisions. It
1683appears that not all format characters are supported in the same way
1684on all platforms. Rather than reimplement it, we note these
1685differences in the documentation, and emphasize the shared set of
1686features. There's also a thorough test set (that occasionally finds
1687problems in the C library implementation, e.g. on some Linuxes),
1688thanks to Skip Montanaro.
1689
1690- The nis module seems broken when used with NIS+; unfortunately
1691nobody knows how to fix it. It should still work with old NIS.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001692
Guido van Rossum61000331997-08-15 04:39:58 +00001693
1694New library modules
1695-------------------
1696
1697- New (still experimental) Perl-style regular expression module,
1698re.py, which uses a new interface for matching as well as a new
1699syntax; the new interface avoids the thread-unsafety of the regex
1700interface. This comes with a helper extension reopmodule.c and vastly
1701rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
1702Peters, and Andrew Kuchling. See the documentation libre.tex. In
17031.5, the old regex module is still fully supported; in the future, it
1704will become obsolete.
1705
1706- New module gzip.py; see zlib above.
1707
1708- New module keyword.py exports knowledge about Python's built-in
1709keywords. (New version by Ka-Ping Yee.)
1710
1711- New module pprint.py (with documentation) which supports
1712pretty-printing of lists, tuples, & dictionaries recursively. By Fred
1713Drake.
1714
1715- New module code.py. The function code.compile_command() can
1716determine whether an interactively entered command is complete or not,
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001717distinguishing incomplete from invalid input. (XXX Unfortunately,
1718this seems broken at this moment, and I don't have the time to fix
1719it. It's probably better to add an explicit interface to the parser
1720for this.)
Guido van Rossum61000331997-08-15 04:39:58 +00001721
Guido van Rossum522578e1997-08-28 03:43:21 +00001722- There is now a library module xdrlib.py which can read and write the
Guido van Rossum61000331997-08-15 04:39:58 +00001723XDR data format as used by Sun RPC, for example. It uses the struct
1724module.
1725
1726
1727Changes in library modules
1728--------------------------
1729
1730- Module codehack.py is now completely obsolete.
1731
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001732- The pickle.py module has been updated to make it compatible with the
1733new binary format that cPickle.c produces. By default it produces the
1734old all-ASCII format compatible with the old pickle.py, still much
1735faster than pickle.py; it will read both formats automatically. A few
1736other updates have been made.
1737
1738- A new helper module, copy_reg.py, is provided to register extensions
1739to the pickling code.
1740
Guido van Rossum61000331997-08-15 04:39:58 +00001741- Revamped module tokenize.py is much more accurate and has an
1742interface that makes it a breeze to write code to colorize Python
1743source code. Contributed by Ka-Ping Yee.
1744
1745- In ihooks.py, ModuleLoader.load_module() now closes the file under
1746all circumstances.
1747
1748- The tempfile.py module has a new class, TemporaryFile, which creates
1749an open temporary file that will be deleted automatically when
1750closed. This works on Windows and MacOS as well as on Unix. (Jim
1751Fulton.)
1752
1753- Changes to the cgi.py module: Most imports are now done at the
1754top of the module, which provides a speedup when using ni (Jim
1755Fulton). The problem with file upload to a Windows platform is solved
1756by using the new tempfile.TemporaryFile class; temporary files are now
1757always opened in binary mode (Jim Fulton). The cgi.escape() function
1758now takes an optional flag argument that quotes '"' to '&quot;'. It
1759is now possible to invoke cgi.py from a command line script, to test
1760cgi scripts more easily outside an http server. There's an optional
1761limit to the size of uploads to POST (Skip Montanaro). Added a
1762'strict_parsing' option to all parsing functions (Jim Fulton). The
1763function parse_qs() now uses urllib.unquote() on the name as well as
Guido van Rossum2da391f1997-08-18 21:17:32 +00001764the value of fields (Clarence Gardner). The FieldStorage class now
1765has a __len__() method.
Guido van Rossum61000331997-08-15 04:39:58 +00001766
1767- httplib.py: the socket object is no longer closed; all HTTP/1.*
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001768responses are now accepted; and it is now thread-safe (by not using
1769the regex module).
Guido van Rossum61000331997-08-15 04:39:58 +00001770
1771- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
1772
1773- The popen2.py module is now rewritten using a class, which makes
1774access to the standard error stream and the process id of the
1775subprocess possible.
1776
Guido van Rossum2da391f1997-08-18 21:17:32 +00001777- Added timezone support to the rfc822.py module, in the form of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001778getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
1779Also added recognition of some non-standard date formats, by Lars
1780Wirzenius, and RFC 850 dates (Chris Lawrence).
Guido van Rossum61000331997-08-15 04:39:58 +00001781
1782- mhlib.py: various enhancements, including almost compatible parsing
1783of message sequence specifiers without invoking a subprocess. Also
1784added a createmessage() method by Lars Wirzenius.
1785
1786- The StringIO.StringIO class now supports readline(nbytes). (Lars
1787Wirzenius.) (Of course, you should be using cStringIO for performance.)
1788
1789- UserDict.py supports the new dictionary methods as well.
1790
1791- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
1792speed it up, and replace 0 seed values by 1 to avoid degeneration.
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001793A bug was fixed in the test for invalid arguments.
Guido van Rossum61000331997-08-15 04:39:58 +00001794
Guido van Rossum2da391f1997-08-18 21:17:32 +00001795- Module ftplib.py: added support for parsing a .netrc file (Fred
1796Drake). Also added an ntransfercmd() method to the FTP class, which
1797allows access to the expected size of a transfer when available, and a
1798parse150() function to the module which parses the corresponding 150
1799response.
Guido van Rossum61000331997-08-15 04:39:58 +00001800
1801- urllib.py: the ftp cache is now limited to 10 entries. Added
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001802quote_plus() and unquote_plus() functions which are like quote() and
1803unquote() but also replace spaces with '+' or vice versa, for
1804encoding/decoding CGI form arguments. Catch all errors from the ftp
1805module. HTTP requests now add the Host: header line. The proxy
Guido van Rossum2da391f1997-08-18 21:17:32 +00001806variable names are now mapped to lower case, for Windows. The
1807spliturl() function no longer erroneously throws away all data past
1808the first newline. The basejoin() function now intereprets "../"
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001809correctly. I *believe* that the problems with "exception raised in
1810__del__" under certain circumstances have been fixed (mostly by
1811changes elsewher in the interpreter).
1812
1813- In urlparse.py, there is a cache for results in urlparse.urlparse();
1814its size limit is set to 20. Also, new URL schemes shttp, https, and
1815snews are "supported".
Guido van Rossum61000331997-08-15 04:39:58 +00001816
Guido van Rossum2da391f1997-08-18 21:17:32 +00001817- shelve.py: use cPickle and cStringIO when available. Also added
1818a sync() method, which calls the database's sync() method if there is
1819one.
Guido van Rossum61000331997-08-15 04:39:58 +00001820
1821- The mimetools.py module now uses the available Python modules for
1822decoding quoted-printable, uuencode and base64 formats, rather than
1823creating a subprocess.
1824
1825- The python debugger (pdb.py, and its base class bdb.py) now support
1826conditional breakpoints. See the docs.
1827
1828- The modules base64.py, uu.py and quopri.py can now be used as simple
1829command line utilities.
1830
1831- Various small fixes to the nntplib.py module that I can't bother to
1832document in detail.
1833
Guido van Rossum61000331997-08-15 04:39:58 +00001834- Sjoerd Mullender's mimify.py module now supports base64 encoding and
1835includes functions to handle the funny encoding you sometimes see in mail
1836headers. It is now documented.
1837
Guido van Rossum2da391f1997-08-18 21:17:32 +00001838- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
1839gotten from the environment.
1840
1841- Many more modules now correctly open files in binary mode when this
1842is necessary on non-Unix platforms.
1843
1844- The copying functions in the undocumented module shutil.py are
1845smarter.
1846
1847- The Writer classes in the formatter.py module now have a flush()
1848method.
1849
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001850- The sgmllib.py module accepts hyphens and periods in the middle of
1851attribute names. While this is against the SGML standard, there is
1852some HTML out there that uses this...
1853
1854- The interface for the Python bytecode disassembler module, dis.py,
1855has been enhanced quite a bit. There's now one main function,
1856dis.dis(), which takes almost any kind of object (function, module,
1857class, instance, method, code object) and disassembles it; without
1858arguments it disassembles the last frame of the last traceback. The
1859other functions have changed slightly, too.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001860
1861- The imghdr.py module recognizes new image types: BMP, PNG.
1862
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001863- The string.py module has a new function replace(str, old, new,
Guido van Rossum2da391f1997-08-18 21:17:32 +00001864[maxsplit]) which does substring replacements. It is actually
1865implemented in C in the strop module. The functions [r]find() an
1866[r]index() have an optional 4th argument indicating the end of the
1867substring to search, alsoo implemented by their strop counterparts.
1868(Remember, never import strop -- import string uses strop when
1869available with zero overhead.)
1870
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001871- The string.join() function now accepts any sequence argument, not
1872just lists and tuples.
1873
1874- The string.maketrans() requires its first two arguments to be
1875present. The old version didn't require them, but there's not much
1876point without them, and the documentation suggests that they are
1877required, so we fixed the code to match the documentation.
1878
1879- The regsub.py module has a function clear_cache(), which clears its
1880internal cache of compiled regular expressions. Also, the cache now
1881takes the current syntax setting into account. (However, this module
1882is now obsolete -- use the sub() or subn() functions or methods in the
1883re module.)
1884
1885- The undocumented module Complex.py has been removed, now that Python
1886has built-in complex numbers. A similar module remains as
1887Demo/classes/Complex.py, as an example.
1888
Guido van Rossum61000331997-08-15 04:39:58 +00001889
1890Changes to the build process
1891----------------------------
1892
1893- The way GNU readline is configured is totally different. The
1894--with-readline configure option is gone. It is now an extension
1895module, which may be loaded dynamically. You must enable it (and
1896specify the correct linraries to link with) in the Modules/Setup file.
1897Importing the module installs some hooks which enable command line
1898editing. When the interpreter shell is invoked interactively, it
1899attempts to import the readline module; when this fails, the default
1900input mechanism is used. The hook variables are PyOS_InputHook and
1901PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
1902ideas from William Magro.)
1903
1904- New build procedure: a single library, libpython1.5.a, is now built,
1905which contains absolutely everything except for a one-line main()
1906program (which calls Py_Main(argc, argv) to start the interpreter
1907shell). This makes life much simpler for applications that need to
1908embed Python. The serial number of the build is now included in the
1909version string (sys.version).
1910
1911- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
1912emits a single warning any more when compiling Python.
1913
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001914- A number of new Makefile variables have been added for special
1915situations, e.g. LDLAST is appended to the link command. These are
1916used by editing the Makefile or passing them on the make command
1917line.
1918
Guido van Rossum61000331997-08-15 04:39:58 +00001919- A set of patches from Lee Busby has been integrated that make it
1920possible to catch floating point exceptions. Use the configure option
1921--with-fpectl to enable the patches; the extension modules fpectl and
1922fpetest provide control to enable/disable and test the feature,
1923respectively.
1924
1925- The support for shared libraries under AIX is now simpler and more
1926robust. Thanks to Vladimir Marangozov for revamping his own patches!
1927
1928- The Modules/makesetup script now reads a file Setup.local as well as
1929a file Setup. Most changes to the Setup script can be done by editing
1930Setup.local instead, which makes it easier to carry a particular setup
1931over from one release to the next.
1932
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001933- The Modules/makesetup script now copies any "include" lines it
1934encounters verbatim into the output Makefile. It also recognizes .cxx
1935and .cpp as C++ source files.
1936
Guido van Rossum61000331997-08-15 04:39:58 +00001937- The configure script is smarter about C compiler options; e.g. with
1938gcc it uses -O2 and -g when possible, and on some other platforms it
1939uses -Olimit 1500 to avoid a warning from the optimizer about the main
1940loop in ceval.c (which has more than 1000 basic blocks).
1941
1942- The configure script now detects whether malloc(0) returns a NULL
1943pointer or a valid block (of length zero). This avoids the nonsense
1944of always adding one byte to all malloc() arguments on most platforms.
1945
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001946- The configure script has a new option, --with-dec-threads, to enable
1947DEC threads on DEC Alpha platforms. Also, --with-threads is now an
1948alias for --with-thread (this was the Most Common Typo in configure
1949arguments).
1950
1951- Many changes in Doc/Makefile; amongst others, latex2html is now used
1952to generate HTML from all latex documents.
1953
Guido van Rossum61000331997-08-15 04:39:58 +00001954
1955Change to the Python/C API
1956--------------------------
1957
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001958- Because some interfaces have changed, the PYTHON_API macro has been
1959bumped. Most extensions built for the old API version will still run,
1960but I can't guarantee this. Python prints a warning message on
1961version mismatches; it dumps core when the version mismatch causes a
1962serious problem :-)
1963
Guido van Rossum2da391f1997-08-18 21:17:32 +00001964- I've completed the Grand Renaming, with the help of Roger Masse and
1965Barry Warsaw. This makes reading or debugging the code much easier.
1966Many other unrelated code reorganizations have also been carried out.
1967The allobjects.h header file is gone; instead, you would have to
1968include Python.h followed by rename2.h. But you're better off running
1969Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
1970the rename2.h; it will disappear in the next release.
1971
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001972- Various and sundry small bugs in the "abstract" interfaces have been
1973fixed. Thanks to all the (involuntary) testers of the Python 1.4
1974version! Some new functions have been added, e.g. PySequence_List(o),
1975equivalent to list(o) in Python.
1976
1977- New API functions PyLong_FromUnsignedLong() and
1978PyLong_AsUnsignedLong().
1979
Guido van Rossum2da391f1997-08-18 21:17:32 +00001980- The API functions in the file cgensupport.c are no longer
1981supported. This file has been moved to Modules and is only ever
1982compiled when the SGI specific 'gl' module is built.
Guido van Rossum61000331997-08-15 04:39:58 +00001983
1984- PyObject_Compare() can now raise an exception. Check with
1985PyErr_Occurred(). The comparison function in an object type may also
1986raise an exception.
1987
1988- The slice interface uses an upper bound of INT_MAX when no explicit
1989upper bound is given (e.x. for a[1:]). It used to ask the object for
1990its length and do the calculations.
1991
1992- Support for multiple independent interpreters. See Doc/api.tex,
1993functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
1994documentation is incomplete, also see the new Demo/pysvr example
1995(which shows how to use these in a threaded application) and the
1996source code.
1997
1998- There is now a Py_Finalize() function which "de-initializes"
1999Python. It is possible to completely restart the interpreter
2000repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
2001change of functionality in Py_Initialize() means that it is now a
2002fatal error to call it while the interpreter is already initialized.
2003The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
2004is deprecated (it is nothing more than Py_Finalize() followed by
2005exit()).
2006
Guido van Rossum2da391f1997-08-18 21:17:32 +00002007- There are no known memory leaks left. While Py_Finalize() doesn't
2008free *all* allocated memory (some of it is hard to track down),
2009repeated calls to Py_Finalize() and Py_Initialize() do not create
2010unaccessible heap blocks.
Guido van Rossum61000331997-08-15 04:39:58 +00002011
2012- There is now explicit per-thread state. (Inspired by, but not the
2013same as, Greg Stein's free threading patches.)
2014
2015- There is now better support for threading C applications. There are
2016now explicit APIs to manipulate the interpreter lock. Read the source
2017or the Demo/pysvr example; the new functions are
2018PyEval_{Acquire,Release}{Lock,Thread}().
2019
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002020- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
2021with other libraries' DEBUG macros. Likewise for any other test
2022macros that didn't yet start with Py_.
2023
Guido van Rossum61000331997-08-15 04:39:58 +00002024- New wrappers around malloc() and friends: Py_Malloc() etc. call
2025malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
2026just malloc(). Use of these wrappers could be essential if multiple
2027memory allocators exist (e.g. when using certain DLL setups under
2028Windows). (Idea by Jim Fulton.)
2029
2030- New C API PyImport_Import() which uses whatever __import__() hook
2031that is installed for the current execution environment. By Jim
2032Fulton.
2033
2034- It is now possible for an extension module's init function to fail
2035non-fatally, by calling one of the PyErr_* functions and returning.
2036
2037- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
2038argument to the proper type, like the similar PyString macros already
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002039did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
2040and PyList_GET_ITEM.
Guido van Rossum61000331997-08-15 04:39:58 +00002041
2042- Some of the Py_Get* function, like Py_GetVersion() (but not yet
2043Py_GetPath()) are now declared as returning a const char *. (More
2044should follow.)
2045
2046- Changed the run-time library to check for exceptions after object
2047comparisons. PyObject_Compare() can now return an exception; use
2048PyErr_Occurred() to check (there is *no* special return value).
2049
2050- PyFile_WriteString() and Py_Flushline() now return error indicators
2051instead of clearing exceptions. This fixes an obscure bug where using
2052these would clear a pending exception, discovered by Just van Rossum.
2053
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002054- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
2055an argument list including keyword arguments. Contributed by Geoff
2056Philbrick.
2057
Guido van Rossum2da391f1997-08-18 21:17:32 +00002058- PyArg_GetInt() is gone.
2059
2060- It's no longer necessary to include graminit.h when calling one of
2061the extended parser API functions. The three public grammar start
2062symbols are now in Python.h as Py_single_input, Py_file_input, and
2063Py_eval_input.
2064
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002065- The CObject interface has a new function,
2066PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
2067on the object referenced by "module.name".
2068
Guido van Rossum61000331997-08-15 04:39:58 +00002069
2070Tkinter
2071-------
2072
Guido van Rossum2da391f1997-08-18 21:17:32 +00002073- On popular demand, _tkinter once again installs a hook for readline
2074that processes certain Tk events while waiting for the user to type
2075(using PyOS_InputHook).
2076
2077- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
2078caused by command definitions referencing widget objects beyond their
2079lifetime.
2080
2081- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
2082tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002083with the new Tk dialog scripts, and provide more "native platform"
2084style file selection dialog boxes on some platforms. Contributed by
2085Fredrik Lundh.
Guido van Rossum61000331997-08-15 04:39:58 +00002086
2087- Tkinter.py: when the first Tk object is destroyed, it sets the
2088hiddel global _default_root to None, so that when another Tk object is
2089created it becomes the new default root. Other miscellaneous
2090changes and fixes.
2091
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002092- The Image class now has a configure method.
2093
2094- Added a bunch of new winfo options to Tkinter.py; we should now be
2095up to date with Tk 4.2. The new winfo options supported are:
2096mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
2097visualsavailable.
2098
2099- The broken bind() method on Canvas objects defined in the Canvas.py
2100module has been fixed. The CanvasItem and Group classes now also have
2101an unbind() method.
2102
2103- The problem with Tkinter.py falling back to trying to import
2104"tkinter" when "_tkinter" is not found has been fixed -- it no longer
2105tries "tkinter", ever. This makes diagnosing the problem "_tkinter
2106not configured" much easier and will hopefully reduce the newsgroup
2107traffic on this topic.
2108
2109- The ScrolledText module once again supports the 'cnf' parameter, to
2110be compatible with the examples in Mark Lutz' book (I know, I know,
2111too late...)
2112
Guido van Rossum61000331997-08-15 04:39:58 +00002113- The _tkinter.c extension module has been revamped. It now support
2114Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
2115works well under Windows and Mac (with the latest Tk ports to those
2116platforms). It also supports threading -- it is safe for one
2117(Python-created) thread to be blocked in _tkinter.mainloop() while
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002118other threads modify widgets. To make the changes visible, those
2119threads must use update_idletasks()method. (The patch for threading
2120in 1.5a3 was broken; in 1.5a4, it is back in a different version,
2121which requires access to the Tcl sources to get it to work -- hence it
2122is disabled by default.)
2123
2124- A bug in _tkinter.c has been fixed, where Split() with a string
2125containing an unmatched '"' could cause an exception or core dump.
2126
2127- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
2128CreateFileHandler, so _tkinter.createfilehandler is not available on
2129those platforms when using Tk 8.0 or later. I will have to rethink
2130how to interface with Tcl's lower-level event mechanism, or with its
2131channels (which are like Python's file-like objects). Jack Jansen has
2132provided a fix for the Mac, so createfilehandler *is* actually
2133supported there; maybe I can adapt his fix for Windows.
Guido van Rossum61000331997-08-15 04:39:58 +00002134
2135
2136Tools and Demos
2137---------------
2138
2139- A new regression test suite is provided, which tests most of the
2140standard and built-in modules. The regression test is run by invoking
2141the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
2142he and Roger Masse contributed most of the new tests.
2143
2144- New tool: faqwiz -- the CGI script that is used to maintain the
2145Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
2146Tools/faqwiz.
2147
2148- New tool: webchecker -- a simple extensible web robot that, when
2149aimed at a web server, checks that server for dead links. Available
2150are a command line utility as well as a Tkinter based GUI version. In
2151Tools/webchecker. A simplified version of this program is dissected
2152in my article in O'Reilly's WWW Journal, the issue on Scripting
2153Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
2154Includes a parser for robots.txt files by Skip Montanaro.
2155
2156- New small tools: cvsfiles.py (prints a list of all files under CVS
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002157n a particular directory tree), treesync.py (a rather Guido-specific
Guido van Rossum61000331997-08-15 04:39:58 +00002158script to synchronize two source trees, one on Windows NT, the other
2159one on Unix under CVS but accessible from the NT box), and logmerge.py
2160(sort a collection of RCS or CVS logs by date). In Tools/scripts.
2161
2162- The freeze script now also works under Windows (NT). Another
2163feature allows the -p option to be pointed at the Python source tree
2164instead of the installation prefix. This was loosely based on part of
2165xfreeze by Sam Rushing and Bill Tutt.
2166
2167- New examples (Demo/extend) that show how to use the generic
2168extension makefile (Misc/Makefile.pre.in).
2169
2170- Tools/scripts/h2py.py now supports C++ comments.
2171
Guido van Rossum2da391f1997-08-18 21:17:32 +00002172- Tools/scripts/pystone.py script is upgraded to version 1.1; there
2173was a bug in version 1.0 (distributed with Python 1.4) that leaked
2174memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
2175
2176- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Guido van Rossum61000331997-08-15 04:39:58 +00002177
2178
2179Windows (NT and 95)
2180-------------------
2181
2182- New project files for Developer Studio (Visual C++) 5.0 for Windows
2183NT (the old VC++ 4.2 Makefile is also still supported, but will
2184eventually be withdrawn due to its bulkiness).
2185
2186- See the note on the new module search path in the "Miscellaneous" section
2187above.
2188
2189- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
2190basically withdrawn. If it still works for you, you're lucky.
2191
2192- There's a new extension module, msvcrt.c, which provides various
2193low-level operations defined in the Microsoft Visual C++ Runtime Library.
2194These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
2195console I/O functions like kbhit(), getch() and putch().
2196
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002197- The -u option not only sets the standard I/O streams to unbuffered
2198status, but also sets them in binary mode. (This can also be done
2199using msvcrt.setmode(), by the way.)
Guido van Rossum61000331997-08-15 04:39:58 +00002200
2201- The, sys.prefix and sys.exec_prefix variables point to the directory
2202where Python is installed, or to the top of the source tree, if it was run
2203from there.
2204
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002205- The various os.path modules (posixpath, ntpath, macpath) now support
2206passing more than two arguments to the join() function, so
2207os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
2208c)).
2209
Guido van Rossum61000331997-08-15 04:39:58 +00002210- The ntpath module (normally used as os.path) supports ~ to $HOME
2211expansion in expanduser().
2212
2213- The freeze tool now works on Windows.
2214
Guido van Rossum2da391f1997-08-18 21:17:32 +00002215- See also the Tkinter category for a sad note on
2216_tkinter.createfilehandler().
2217
2218- The truncate() method for file objects now works on Windows.
2219
2220- Py_Initialize() is no longer called when the DLL is loaded. You
Guido van Rossumb68b77f1997-10-07 19:12:50 +00002221must call it yourself.
Guido van Rossum61000331997-08-15 04:39:58 +00002222
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002223- The time module's clock() function now has good precision through
2224the use of the Win32 API QueryPerformanceCounter().
2225
2226- Mark Hammond will release Python 1.5 versions of PythonWin and his
2227other Windows specific code: the win32api extensions, COM/ActiveX
2228support, and the MFC interface.
2229
Guido van Rossum61000331997-08-15 04:39:58 +00002230
2231Mac
2232---
2233
Guido van Rossum2da391f1997-08-18 21:17:32 +00002234- As always, the Macintosh port will be done by Jack Jansen. He will
2235make a separate announcement for the Mac specific source code and the
2236binary distribution(s) when these are ready.
Guido van Rossum61000331997-08-15 04:39:58 +00002237
2238
Guido van Rossum92664b81997-10-07 00:12:43 +00002239======================================================================