blob: 50a6749eb092a163cedd377cff903c659dfe0505 [file] [log] [blame]
Guido van Rossuma598c932000-09-04 16:26:03 +00001Python History
Guido van Rossuma7925f11994-01-26 10:20:16 +00002--------------
3
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004This file contains the release messages for previous Python releases.
5As you read on you go back to the dark ages of Python's history.
6
7
8======================================================================
9
10
Guido van Rossuma598c932000-09-04 16:26:03 +000011What's new in release 1.6?
12==========================
13
14Below is a list of all relevant changes since release 1.5.2.
15
16
17Source Incompatibilities
18------------------------
19
20Several small incompatible library changes may trip you up:
21
22 - The append() method for lists can no longer be invoked with more
23 than one argument. This used to append a single tuple made out of
24 all arguments, but was undocumented. To append a tuple, use
25 e.g. l.append((a, b, c)).
26
27 - The connect(), connect_ex() and bind() methods for sockets require
28 exactly one argument. Previously, you could call s.connect(host,
29 port), but this was undocumented. You must now write
30 s.connect((host, port)).
31
32 - The str() and repr() functions are now different more often. For
33 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
34 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
35 For floats, repr() now gives 17 digits of precision, to ensure no
36 precision is lost (on all current hardware).
37
38 - The -X option is gone. Built-in exceptions are now always
39 classes. Many more library modules also have been converted to
40 class-based exceptions.
41
42
43Binary Incompatibilities
44------------------------
45
46- Third party extensions built for Python 1.5.x cannot be used with
47Python 1.6; these extensions will have to be rebuilt for Python 1.6.
48
49- On Windows, attempting to import a third party extension built for
50Python 1.5.x results in an immediate crash; there's not much we can do
51about this. Check your PYTHONPATH environment variable!
52
53
54Overview of Changes since 1.5.2
55-------------------------------
56
57For this overview, I have borrowed from the document "What's New in
58Python 2.0" by Andrew Kuchling and Moshe Zadka:
59http://starship.python.net/crew/amk/python/writing/new-python/.
60
61There are lots of new modules and lots of bugs have been fixed. A
62list of all new modules is included below.
63
64Probably the most pervasive change is the addition of Unicode support.
65We've added a new fundamental datatype, the Unicode string, a new
66build-in function unicode(), an numerous C APIs to deal with Unicode
67and encodings. See the file Misc/unicode.txt for details, or
68http://starship.python.net/crew/lemburg/unicode-proposal.txt.
69
70Two other big changes, related to the Unicode support, are the
71addition of string methods and (yet another) new regular expression
72engine.
73
74 - String methods mean that you can now say s.lower() etc. instead of
75 importing the string module and saying string.lower(s) etc. One
76 peculiarity is that the equivalent of string.join(sequence,
77 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
78 the effect of string.join(sequence); to make this more readable, try
79 space=" " first. Note that the maxsplit argument defaults in
80 split() and replace() have changed from 0 to -1.
81
82 - The new regular expression engine, SRE by Fredrik Lundh, is fully
83 backwards compatible with the old engine, and is in fact invoked
84 using the same interface (the "re" module). You can explicitly
85 invoke the old engine by import pre, or the SRE engine by importing
86 sre. SRE is faster than pre, and supports Unicode (which was the
87 main reason to put effort in yet another new regular expression
88 engine -- this is at least the fourth!).
89
90
91Other Changes
92-------------
93
94Other changes that won't break code but are nice to know about:
95
96Deleting objects is now safe even for deeply nested data structures.
97
98Long/int unifications: long integers can be used in seek() calls, as
99slice indexes.
100
101String formatting (s % args) has a new formatting option, '%r', which
102acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
103alpha 1.)
104
105Greg Ward's "distutils" package is included: this will make
106installing, building and distributing third party packages much
107simpler.
108
109There's now special syntax that you can use instead of the apply()
110function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
111You can also use variations f(a1, a2, *args, **kwds) and you can leave
112one or the other out: f(*args), f(**kwds).
113
114The built-ins int() and long() take an optional second argument to
115indicate the conversion base -- of course only if the first argument
116is a string. This makes string.atoi() and string.atol() obsolete.
117(string.atof() was already obsolete).
118
119When a local variable is known to the compiler but undefined when
120used, a new exception UnboundLocalError is raised. This is a class
121derived from NameError so code catching NameError should still work.
122The purpose is to provide better diagnostics in the following example:
123 x = 1
124 def f():
125 print x
126 x = x+1
127This used to raise a NameError on the print statement, which confused
128even experienced Python programmers (especially if there are several
129hundreds of lines of code between the reference and the assignment to
130x :-).
131
132You can now override the 'in' operator by defining a __contains__
133method. Note that it has its arguments backwards: x in a causes
134a.__contains__(x) to be called. That's why the name isn't __in__.
135
136The exception AttributeError will have a more friendly error message,
137e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
138<b>break code</b> that expects the message to be exactly the attribute
139name.
140
141
142New Modules in 1.6
143------------------
144
145UserString - base class for deriving from the string type.
146
147distutils - tools for distributing Python modules.
148
149robotparser - parse a robots.txt file, for writing web spiders.
150(Moved from Tools/webchecker/.)
151
152linuxaudiodev - audio for Linux.
153
154mmap - treat a file as a memory buffer. (Windows and Unix.)
155
156sre - regular expressions (fast, supports unicode). Currently, this
157code is very rough. Eventually, the re module will be reimplemented
158using sre (without changes to the re API).
159
160filecmp - supersedes the old cmp.py and dircmp.py modules.
161
162tabnanny - check Python sources for tab-width dependance. (Moved from
163Tools/scripts/.)
164
165urllib2 - new and improved but incompatible version of urllib (still
166experimental).
167
168zipfile - read and write zip archives.
169
170codecs - support for Unicode encoders/decoders.
171
172unicodedata - provides access to the Unicode 3.0 database.
173
174_winreg - Windows registry access.
175
176encodings - package which provides a large set of standard codecs --
177currently only for the new Unicode support. It has a drop-in extension
178mechanism which allows you to add new codecs by simply copying them
179into the encodings package directory. Asian codec support will
180probably be made available as separate distribution package built upon
181this technique and the new distutils package.
182
183
184Changed Modules
185---------------
186
187readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
188chunk, wave, random, shelve, nntplib - minor enhancements.
189
190socket, httplib, urllib - optional OpenSSL support (Unix only).
191
192_tkinter - support for 8.0 up to 8.3. Support for versions older than
1938.0 has been dropped.
194
195string - most of this module is deprecated now that strings have
196methods. This no longer uses the built-in strop module, but takes
197advantage of the new string methods to provide transparent support for
198both Unicode and ordinary strings.
199
200
201Changes on Windows
202------------------
203
204The installer no longer runs a separate Tcl/Tk installer; instead, it
205installs the needed Tcl/Tk files directly in the Python directory. If
206you already have a Tcl/Tk installation, this wastes some disk space
207(about 4 Megs) but avoids problems with conflincting Tcl/Tk
208installations, and makes it much easier for Python to ensure that
209Tcl/Tk can find all its files. Note: the alpha installers don't
210include the documentation.
211
212The Windows installer now installs by default in \Python16\ on the
213default volume, instead of \Program Files\Python-1.6\.
214
215
216Changed Tools
217-------------
218
219IDLE - complete overhaul. See the <a href="../idle/">IDLE home
220page</a> for more information. (Python 1.6 alpha 1 will come with
221IDLE 0.6.)
222
223Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
224text extraction tool used for internationalizing applications written
225in Python.
226
227
228Obsolete Modules
229----------------
230
231stdwin and everything that uses it. (Get Python 1.5.2 if you need
232it. :-)
233
234soundex. (Skip Montanaro has a version in Python but it won't be
235included in the Python release.)
236
237cmp, cmpcache, dircmp. (Replaced by filecmp.)
238
239dump. (Use pickle.)
240
241find. (Easily coded using os.walk().)
242
243grep. (Not very useful as a library module.)
244
245packmail. (No longer has any use.)
246
247poly, zmod. (These were poor examples at best.)
248
249strop. (No longer needed by the string module.)
250
251util. (This functionality was long ago built in elsewhere).
252
253whatsound. (Use sndhdr.)
254
255
256Detailed Changes from 1.6b1 to 1.6
257----------------------------------
258
259- Slight changes to the CNRI license. A copyright notice has been
260added; the requirement to indicate the nature of modifications now
261applies when making a derivative work available "to others" instead of
262just "to the public"; the version and date are updated. The new
263license has a new handle.
264
265- Added the Tools/compiler package. This is a project led by Jeremy
266Hylton to write the Python bytecode generator in Python.
267
268- The function math.rint() is removed.
269
270- In Python.h, "#define _GNU_SOURCE 1" was added.
271
272- Version 0.9.1 of Greg Ward's distutils is included (instead of
273version 0.9).
274
275- A new version of SRE is included. It is more stable, and more
276compatible with the old RE module. Non-matching ranges are indicated
277by -1, not None. (The documentation said None, but the PRE
278implementation used -1; changing to None would break existing code.)
279
280- The winreg module has been renamed to _winreg. (There are plans for
281a higher-level API called winreg, but this has not yet materialized in
282a form that is acceptable to the experts.)
283
284- The _locale module is enabled by default.
285
286- Fixed the configuration line for the _curses module.
287
288- A few crashes have been fixed, notably <file>.writelines() with a
289list containing non-string objects would crash, and there were
290situations where a lost SyntaxError could dump core.
291
292- The <list>.extend() method now accepts an arbitrary sequence
293argument.
294
295- If __str__() or __repr__() returns a Unicode object, this is
296converted to an 8-bit string.
297
298- Unicode string comparisons is no longer aware of UTF-16
299encoding peculiarities; it's a straight 16-bit compare.
300
301- The Windows installer now installs the LICENSE file and no longer
302registers the Python DLL version in the registry (this is no longer
303needed). It now uses Tcl/Tk 8.3.2.
304
305- A few portability problems have been fixed, in particular a
306compilation error involving socklen_t.
307
308- The PC configuration is slightly friendlier to non-Microsoft
309compilers.
310
311
312======================================================================
313
314
Guido van Rossum2001da42000-09-01 22:26:44 +0000315From 1.5.2c1 to 1.5.2 (final)
316=============================
317
318Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
319
320 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
321
322 * PCbuild/python15.dsp: Added shamodule.c
323
324 * PC/config.c: Added sha module!
325
326 * README, Include/patchlevel.h: Prepare for final release.
327
328 * Misc/ACKS:
329 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
330
331 * Python/thread_solaris.h:
332 While I can't really test this thoroughly, Pat Knight and the Solaris
333 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
334 the flags on thr_create(), and that there really isn't a downside, so
335 I'll do that.
336
337 * Misc/ACKS:
338 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
339
340 * PC/python_nt.rc:
341 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
342 (I can't even display this on NT, maybe Win/98 can?)
343
344 * Lib/pstats.py:
345 Fix mysterious references to jprofile that were in the source since
346 its creation. I'm assuming these were once valid references to "Jim
347 Roskind's profile"...
348
349 * Lib/Attic/threading_api.py:
350 Removed; since long subsumed in Doc/lib/libthreading.tex
351
352 * Modules/socketmodule.c:
353 Put back __osf__ support for gethostbyname_r(); the real bug was that
354 it was being used even without threads. This of course might be an
355 all-platform problem so now we only use the _r variant when we are
356 using threads.
357
358Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
359
360 * Modules/cPickle.c:
361 Fix accidentally reversed NULL test in load_mark(). Suggested by
362 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
363 returns NULL.)
364
365 * README:
366 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
367
368 * README: Add note about -D_REENTRANT for HP-UX 10.20.
369
370 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
371
372 * PC/Attic/vc40.mak, PC/readme.txt:
373 Remove all VC++ info (except VC 1.5) from readme.txt;
374 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
375
376 * README: Clarify PC build instructions (point to PCbuild).
377
378 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
379
380 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
381 Forgot to add this file. CDROM device parameters.
382
383 * Lib/gzip.py: Two different changes.
384
385 1. Jack Jansen reports that on the Mac, the time may be negative, and
386 solves this by adding a write32u() function that writes an unsigned
387 long.
388
389 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
390 casting both values to be compared to "unsigned long" i.e. modulo
391 0x100000000L.
392
393Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
394
395 * PC/Attic/_tkinter.def: No longer needed.
396
397 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
398
399 * README: Add DEC Ultrix notes (from Donn Cave's email).
400
401 * configure: The usual
402
403 * configure.in:
404 Quote a bunch of shell variables used in test, related to long-long.
405
406 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
407 casts for picky compilers.
408
409 * Modules/socketmodule.c:
410 3-arg gethostbyname_r doesn't really work on OSF/1.
411
412 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
413 Avoid totally empty files.
414
415Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
416
417 * Tools/scripts/fixps.py: Use re instead of regex.
418 Don't rewrite the file in place.
419 (Reported by Andy Dustman.)
420
421 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
422
423Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
424
425 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
426 Add a variable %_TCL_% that makes it easier to switch to a different version.
427
428
429======================================================================
430
431
432From 1.5.2b2 to 1.5.2c1
433=======================
434
435Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
436
437 * PCbuild/python15.wse:
438 Release 1.5.2c1. Add IDLE and Uninstall to program group.
439 Don't distribute zlib.dll. Tweak some comments.
440
441 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
442
443 * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
444 The usual
445
446 * Include/patchlevel.h: Release 1.5.2c1
447
448 * README: Release 1.5.2c1.
449
450 * Misc/NEWS: News for the 1.5.2c1 release.
451
452 * Lib/test/test_strftime.py:
453 On Windows, we suddenly find, strftime() may return "" for an
454 unsupported format string. (I guess this is because the logic for
455 deciding whether to reallocate the buffer or not has been improved.)
456 This caused the test code to crash on result[0]. Fix this by assuming
457 an empty result also means the format is not supported.
458
459 * Demo/tkinter/matt/window-creation-w-location.py:
460 This demo imported some private code from Matt. Make it cripple along.
461
462 * Lib/lib-tk/Tkinter.py:
463 Delete an accidentally checked-in feature that actually broke more
464 than was worth it: when deleting a canvas item, it would try to
465 automatically delete the bindings for that item. Since there's
466 nothing that says you can't reuse the tag and still have the bindings,
467 this is not correct. Also, it broke at least one demo
468 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
469
470 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
471
472Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
473
474 * Modules/zlibmodule.c:
475 Patch by Andrew Kuchling to unflush() (flush() for deflating).
476 Without this, if inflate() returned Z_BUF_ERROR asking for more output
477 space, we would report the error; now, we increase the buffer size and
478 try again, just as for Z_OK.
479
480 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
481
482 * Tools/idle/ChangeLog: New change log.
483
484 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
485
486 * Python/pythonrun.c:
487 Alas, get rid of the Win specific hack to ask the user to press Return
488 before exiting when an error happened. This didn't work right when
489 Python is invoked from a daemon.
490
491 * Tools/idle/idlever.py: Version bump awaiting impending new release.
492 (Not much has changed :-( )
493
494 * Lib/lib-tk/Tkinter.py:
495 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
496 so the preferred name for them is tag_lower, tag_raise
497 (similar to tag_bind, and similar to the Text widget);
498 unfortunately can't delete the old ones yet (maybe in 1.6)
499
500 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
501 Changes by Mark Hammond for Windows CE. Mostly of the form
502 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
503
504 * Python/bltinmodule.c:
505 Remove unused variable from complex_from_string() code.
506
507 * Include/patchlevel.h:
508 Add the possibility of a gamma release (release candidate).
509 Add '+' to string version number to indicate we're beyond b2 now.
510
511 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
512
513 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
514
515 Per writes:
516
517 """
518 The application where Signum Support uses smtplib needs to be able to
519 report good error messages to the user when sending email fails. To
520 help in diagnosing problems it is useful to be able to report the
521 entire message sent by the server, not only the SMTP error code of the
522 offending command.
523
524 A lot of the functions in sendmail.py unfortunately discards the
525 message, leaving only the code. The enclosed patch fixes that
526 problem.
527
528 The enclosed patch also introduces a base class for exceptions that
529 include an SMTP error code and error message, and make the code and
530 message available on separate attributes, so that surrounding code can
531 deal with them in whatever way it sees fit. I've also added some
532 documentation to the exception classes.
533
534 The constructor will now raise an exception if it cannot connect to
535 the SMTP server.
536
537 The data() method will raise an SMTPDataError if it doesn't receive
538 the expected 354 code in the middle of the exchange.
539
540 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
541 text, including no text at all" after the error code. If the response
542 of a HELO command contains no text self.helo_resp will be set to the
543 empty string (""). The patch fixes the test in the sendmail() method
544 so that helo_resp is tested against None; if it has the empty string
545 as value the sendmail() method would invoke the helo() method again.
546
547 The code no longer accepts a -1 reply from the ehlo() method in
548 sendmail().
549
550 [Text about removing SMTPRecipientsRefused deleted --GvR]
551 """
552
553 and also:
554
555 """
556 smtplib.py appends an extra blank line to the outgoing mail if the
557 `msg' argument to the sendmail method already contains a trailing
558 newline. This patch should fix the problem.
559 """
560
561 The Dragon writes:
562
563 """
564 Mostly I just re-added the SMTPRecipientsRefused exception
565 (the exeption object now has the appropriate info in it ) [Per had
566 removed this in his patch --GvR] and tweaked the behavior of the
567 sendmail method whence it throws the newly added SMTPHeloException (it
568 was closing the connection, which it shouldn't. whatever catches the
569 exception should do that. )
570
571 I pondered the change of the return values to tuples all around,
572 and after some thinking I decided that regularizing the return values was
573 too much of the Right Thing (tm) to not do.
574
575 My one concern is that code expecting an integer & getting a tuple
576 may fail silently.
577
578 (i.e. if it's doing :
579
580 x.somemethod() >= 400:
581 expecting an integer, the expression will always be true if it gets a
582 tuple instead. )
583
584 However, most smtplib code I've seen only really uses the
585 sendmail() method, so this wouldn't bother it. Usually code I've seen
586 that calls the other methods usually only calls helo() and ehlo() for
587 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
588 and thus I would think not much code uses it yet.
589 """
590
591Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
592
593 * Lib/test/test_ntpath.py:
594 Fix the tests now that splitdrive() no longer treats UNC paths special.
595 (Some tests converted to splitunc() tests.)
596
597 * Lib/ntpath.py:
598 Withdraw the UNC support from splitdrive(). Instead, a new function
599 splitunc() parses UNC paths. The contributor of the UNC parsing in
600 splitdrive() doesn't like it, but I haven't heard a good reason to
601 keep it, and it causes some problems. (I think there's a
602 philosophical problem -- to me, the split*() functions are purely
603 syntactical, and the fact that \\foo is not a valid path doesn't mean
604 that it shouldn't be considered an absolute path.)
605
606 Also (quite separately, but strangely related to the philosophical
607 issue above) fix abspath() so that if win32api exists, it doesn't fail
608 when the path doesn't actually exist -- if GetFullPathName() fails,
609 fall back on the old strategy (join with getcwd() if neccessary, and
610 then use normpath()).
611
612 * configure.in, configure, config.h.in, acconfig.h:
613 For BeOS PowerPC. Chris Herborth.
614
615Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
616
617 * Modules/timemodule.c:
618 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
619 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
620
621 * Misc/ACKS:
622 Bunch of new contributors, including 9 who contributed to the Docs,
623 reported by Fred.
624
625Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
626
627 * Lib/gzip.py:
628 Oops, missed mode parameter to open().
629
630 * Lib/gzip.py:
631 Made the default mode 'rb' instead of 'r', for better cross-platform
632 support. (Based on comment on the documentation by Bernhard Reiter
633 <bernhard@csd.uwm.edu>).
634
635Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
636
637 * Tools/scripts/dutree.py:
638 For reasons I dare not explain, this script should always execute
639 main() when imported (in other words, it is not usable as a module).
640
641Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
642
643 * Lib/test/test_cpickle.py: Jonathan Giddy write:
644
645 In test_cpickle.py, the module os got imported, but the line to remove
646 the temp file has gone missing.
647
648Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
649
650 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
651
652 If you send something like "PUT / HTTP/1.0" to something derived from
653 BaseHTTPServer that doesn't define do_PUT, you will get a response
654 that begins like this:
655
656 HTTP/1.0 501 Unsupported method ('do_PUT')
657 Server: SimpleHTTP/0.3 Python/1.5
658 Date: Tue, 30 Mar 1999 18:53:53 GMT
659
660 The server should complain about 'PUT' instead of 'do_PUT'. This
661 patch should fix the problem.
662
663Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
664
665 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
666
667 """
668 - It needlessly used the makefile() method for each response that is
669 read from the SMTP server.
670
671 - If the remote SMTP server closes the connection unexpectedly the
672 code raised an IndexError. It now raises an SMTPServerDisconnected
673 exception instead.
674
675 - The code now checks that all lines in a multiline response actually
676 contains an error code.
677 """
678
679 The Dragon approves.
680
681Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
682
683 * Lib/compileall.py:
684 When run as a script, report failures in the exit code as well.
685 Patch largely based on changes by Andrew Dalke, as discussed in the
686 distutils-sig.
687
688Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
689
690 * Lib/urllib.py:
691 Hack so that if a 302 or 301 redirect contains a relative URL, the
692 right thing "just happens" (basejoin() with old URL).
693
694 * Modules/cPickle.c:
695 Protection against picling to/from closed (real) file.
696 The problem was reported by Moshe Zadka.
697
698 * Lib/test/test_cpickle.py:
699 Test protection against picling to/from closed (real) file.
700
701 * Modules/timemodule.c: Chris Lawrence writes:
702
703 """
704 The GNU folks, in their infinite wisdom, have decided not to implement
705 altzone in libc6; this would not be horrible, except that timezone
706 (which is implemented) includes the current DST setting (i.e. timezone
707 for Central is 18000 in summer and 21600 in winter). So Python's
708 timezone and altzone variables aren't set correctly during DST.
709
710 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
711 show the "right" thing on Linux (by using the tm_gmtoff stuff
712 available in BSD, which is how the GLIBC manual claims things should
713 be done) and (b) should cope with the southern hemisphere. In pursuit
714 of (b), I also took the liberty of renaming the "summer" and "winter"
715 variables to "july" and "jan". This patch should also make certain
716 time calculations on Linux actually work right (like the tz-aware
717 functions in the rfc822 module).
718
719 (It's hard to find DST that's currently being used in the southern
720 hemisphere; I tested using Africa/Windhoek.)
721 """
722
723 * Lib/test/output/test_gzip:
724 Jonathan Giddy discovered this file was missing.
725
726 * Modules/shamodule.c:
727 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
728 middlename) Marangozov, patch coded by Greg Stein.
729
730 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
731 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
732
733Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
734
735 * Tools/scripts/ndiff.py: Tim Peters writes:
736
737 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
738 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
739 for recreating the original files from ndiff's output. That's attached, if
740 you're game! Us Windows guys don't usually have a sed sitting around
741 <wink>.
742
743Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
744
745 * Tools/scripts/ndiff.py: Tim Peters writes:
746
747 Attached is a cleaned-up version of ndiff (added useful module
748 docstring, now echo'ed in case of cmd line mistake); added -q option
749 to suppress initial file identification lines; + other minor cleanups,
750 & a slightly faster match engine.
751
752Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
753
754 * Tools/scripts/dutree.py:
755 During display, if EPIPE is raised, it's probably because a pager was
756 killed. Discard the error in that case, but propogate it otherwise.
757
758Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
759
760 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
761 Test suite for UserList.
762
763 * Lib/UserList.py: Use isinstance() where appropriate.
764 Reformatted with 4-space indent.
765
766Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
767
768 * Tools/pynche/PyncheWidget.py:
769 Helpwin.__init__(): The text widget should get focus.
770
771 * Tools/pynche/pyColorChooser.py:
772 Removed unnecessary import `from PyncheWidget import PyncheWidget'
773
774Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
775
776 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
777 Test suite for UserDict
778
779 * Lib/UserDict.py: Improved a bunch of things.
780 The constructor now takes an optional dictionary.
781 Use isinstance() where appropriate.
782
783Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
784
785 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
786 Basic regr tests for pickle/cPickle
787
788 * Lib/pickle.py:
789 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
790 points out) it doesn't work in JPython Applets.
791
792Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
793
794 * Lib/test/test_gzip.py:
795 Added a simple test suite for gzip. It simply opens a temp file,
796 writes a chunk of compressed data, closes it, writes another chunk, and
797 reads the contents back to verify that they are the same.
798
799 * Lib/gzip.py:
800 Based on a suggestion from bruce@hams.com, make a trivial change to
801 allow using the 'a' flag as a mode for opening a GzipFile. gzip
802 files, surprisingly enough, can be concatenated and then decompressed;
803 the effect is to concatenate the two chunks of data.
804
805 If we support it on writing, it should also be supported on reading.
806 This *wasn't* trivial, and required rearranging the code in the
807 reading path, particularly the _read() method.
808
809 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
810 and 'Unknown compression method'
811
812Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
813
814 * Lib/test/test_b1.py:
815 Add tests for float() and complex() with string args (Nick/Stephanie
816 Lockwood).
817
818Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
819
820 * Modules/zlibmodule.c:
821 Add an .unused_data attribute to decompressor objects. If .unused_data
822 is not an empty string, this means that you have arrived at the
823 end of the stream of compressed data, and the contents of .unused_data are
824 whatever follows the compressed stream.
825
826Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
827
828 * Python/bltinmodule.c:
829 Patch by Nick and Stephanie Lockwood to implement complex() with a string
830 argument. This closes TODO item 2.19.
831
832Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
833
834 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
835 Unfortunately his code breaks wcgui.py in a way that's not easy
836 to fix. I expect that this is a temporary situation --
837 eventually Sam's changes will be merged back in.
838 (The changes add a -t option to specify exceptions to the -x
839 option, and explicit checking for #foo style fragment ids.)
840
841 * Objects/dictobject.c:
842 Vladimir Marangozov contributed updated comments.
843
844 * Objects/bufferobject.c: Folded long lines.
845
846 * Lib/test/output/test_sha, Lib/test/test_sha.py:
847 Added Jeremy's test code for the sha module.
848
849 * Modules/shamodule.c, Modules/Setup.in:
850 Added Greg Stein and Andrew Kuchling's sha module.
851 Fix comments about zlib version and URL.
852
853 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
854
855 * Include/pythread.h: Conform to standard boilerplate.
856
857 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
858 Chris Herborth: the new compiler in R4.1 needs some new options to work...
859
860 * Modules/socketmodule.c:
861 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
862 data struct before calling gethostby{name,addr}_r(); (2) ignore the
863 3/5/6 args determinations made by the configure script and switch on
864 platform identifiers instead:
865
866 AIX, OSF have 3 args
867 Sun, SGI have 5 args
868 Linux has 6 args
869
870 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
871
872 * Modules/socketmodule.c:
873 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
874
875 * Lib/mailbox.py:
876 Add readlines() to _Subfile class. Not clear who would need it, but
877 Chris Lawrence sent me a broken version; this one is a tad simpler and
878 more conforming to the standard.
879
880Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
881
882 * Lib/gzip.py: use struct instead of bit-manipulate in Python
883
884Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
885
886 * Modules/Makefile.pre.in:
887 Add $(EXE) to various occurrences of python so it will work on Cygwin
888 with egcs (after setting EXE=.exe). Patch by Norman Vine.
889
890 * configure, configure.in:
891 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
892
893Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
894
895 * Include/thread.h:
896 Adding thread.h -- unused but for b/w compatibility.
897 As requested by Bill Janssen.
898
899 * configure.in, configure:
900 Add code to test for all sorts of gethostbyname_r variants,
901 donated by David Arnold.
902
903 * config.h.in, acconfig.h:
904 Add symbols for gethostbyname_r variants (sigh).
905
906 * Modules/socketmodule.c: Clean up pass for the previous patches.
907
908 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
909 glibc2.
910
911 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
912 don't know what code should be used.
913
914 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
915
916 - Modify the gethostbyaddr() code to also hold on to the lock until
917 after it is safe to release, overlapping with the Python lock.
918
919 (Note: I think that it could in theory be possible that Python code
920 executed while gethostbyname_lock is held could attempt to reacquire
921 the lock -- e.g. in a signal handler or destructor. I will simply say
922 "don't do that then.")
923
924 * Modules/socketmodule.c: Jonathan Giddy writes:
925
926 Here's a patch to fix the race condition, which wasn't fixed by Rob's
927 patch. It holds the gethostbyname lock until the results are copied out,
928 which means that this lock and the Python global lock are held at the same
929 time. This shouldn't be a problem as long as the gethostbyname lock is
930 always acquired when the global lock is not held.
931
932Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
933
934 * Modules/zlibmodule.c:
935 Fixed the flush() method of compression objects; the test for
936 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
937 Logic cleaned up and commented.
938
939 * Lib/test/test_zlib.py:
940 Added simple test for the flush() method of compression objects, trying the
941 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
942
943Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
944
945 * Lib/shlex.py:
946 Bug reported by Tobias Thelen: missing "self." in assignment target.
947
948Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
949
950 * Modules/arraymodule.c:
951 Use an unsigned cast to avoid a warning in VC++.
952
953 * Lib/dospath.py, Lib/ntpath.py:
954 New code for split() by Tim Peters, behaves more like posixpath.split().
955
956 * Objects/floatobject.c:
957 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
958 a block cannot be freed, add its free items back to the free list.
959 This is necessary to avoid leaking when Python is reinitialized later.
960
961 * Objects/intobject.c:
962 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
963 a block cannot be freed, add its free items back to the free list, and
964 add its valid ints back to the small_ints array if they are in range.
965 This is necessary to avoid leaking when Python is reinitialized later.
966
967 * Lib/types.py:
968 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
969
970 * Python/bltinmodule.c:
971 New builtin buffer() creates a derived read-only buffer from any
972 object that supports the buffer interface (e.g. strings, arrays).
973
974 * Objects/bufferobject.c:
975 Added check for negative offset for PyBuffer_FromObject and check for
976 negative size for PyBuffer_FromMemory. Greg Stein.
977
978Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
979
980 * Lib/urlparse.py: Sjoerd Mullender writes:
981
982 If a filename on Windows starts with \\, it is converted to a URL
983 which starts with ////. If this URL is passed to urlparse.urlparse
984 you get a path that starts with // (and an empty netloc). If you pass
985 the result back to urlparse.urlunparse, you get a URL that starts with
986 //, which is parsed differently by urlparse.urlparse. The fix is to
987 add the (empty) netloc with accompanying slashes if the path in
988 urlunparse starts with //. Do this for all schemes that use a netloc.
989
990 * Lib/nturl2path.py: Sjoerd Mullender writes:
991
992 Pathnames of files on other hosts in the same domain
993 (\\host\path\to\file) are not translated correctly to URLs and back.
994 The URL should be something like file:////host/path/to/file.
995 Note that a combination of drive letter and remote host is not
996 possible.
997
998Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
999
1000 * Lib/urlparse.py:
1001 Delete non-standard-conforming code in urljoin() that would use the
1002 netloc from the base url as the default netloc for the resulting url
1003 even if the schemes differ.
1004
1005 Once upon a time, when the web was wild, this was a valuable hack
1006 because some people had a URL referencing an ftp server colocated with
1007 an http server without having the host in the ftp URL (so they could
1008 replicate it or change the hostname easily).
1009
1010 More recently, after the file: scheme got added back to the list of
1011 schemes that accept a netloc, it turns out that this caused weirdness
1012 when joining an http: URL with a file: URL -- the resulting file: URL
1013 would always inherit the host from the http: URL because the file:
1014 scheme supports a netloc but in practice never has one.
1015
1016 There are two reasons to get rid of the old, once-valuable hack,
1017 instead of removing the file: scheme from the uses_netloc list. One,
1018 the RFC says that file: uses the netloc syntax, and does not endorse
1019 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
1020 hack.
1021
1022 * Include/ceval.h, Include/abstract.h:
1023 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
1024
1025Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1026
1027 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
1028
1029 An attempt to execute grid_slaves with arguments (0,0) results in
1030 *all* of the slaves being returned, not just the slave associated with
1031 row 0, column 0. This is because the test for arguments in the method
1032 does not test to see if row (and column) does not equal None, but
1033 rather just whether is evaluates to non-false. A value of 0 fails
1034 this test.
1035
1036Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1037
1038 * Modules/cmathmodule.c:
1039 Docstring fix: acosh() returns the hyperbolic arccosine, not the
1040 hyperbolic cosine. Problem report via David Ascher by one of his
1041 students.
1042
1043Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1044
1045 * configure.in:
1046 Should test for gethost*by*name_r, not for gethostname_r (which
1047 doesn't exist and doesn't make sense).
1048
1049 * Modules/socketmodule.c:
1050 Patch by Rob Riggs for Linux -- glibc2 has a different argument
1051 converntion for gethostbyname_r() etc. than Solaris!
1052
1053 * Python/thread_pthread.h: Rob Riggs wrote:
1054
1055 """
1056 Spec says that on success pthread_create returns 0. It does not say
1057 that an error code will be < 0. Linux glibc2 pthread_create() returns
1058 ENOMEM (12) when one exceed process limits. (It looks like it should
1059 return EAGAIN, but that's another story.)
1060
1061 For reference, see:
1062 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
1063 """
1064
1065 [I have a feeling that similar bugs were fixed before; perhaps someone
1066 could check that all error checks no check for != 0?]
1067
1068 * Tools/bgen/bgen/bgenObjectDefinition.py:
1069 New mixin class that defines cmp and hash that use
1070 the ob_itself pointer. This allows (when using the mixin)
1071 different Python objects pointing to the same C object and
1072 behaving well as dictionary keys.
1073
1074 Or so sez Jack Jansen...
1075
1076 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
1077
1078 Don't convert URLs to URLs using pathname2url.
1079
1080Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1081
1082 * Lib/cmd.py: Patch by Michael Scharf. He writes:
1083
1084 The module cmd requires for each do_xxx command a help_xxx
1085 function. I think this is a little old fashioned.
1086
1087 Here is a patch: use the docstring as help if no help_xxx
1088 function can be found.
1089
1090 [I'm tempted to rip out all the help_* functions from pdb, but I'll
1091 resist it. Any takers? --Guido]
1092
1093 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
1094
1095 Under Windows, python freeze.py -o hello hello.py
1096 creates all the correct files in the hello subdirectory, but the
1097 Makefile has the directory prefix in it for frozen_extensions.c
1098 nmake fails because it tries to locate hello/frozen_extensions.c
1099
1100 (His fix adds a call to os.path.basename() in the appropriate place.)
1101
1102 * Objects/floatobject.c, Objects/intobject.c:
1103 Vladimir has restructured his code somewhat so that the blocks are now
1104 represented by an explicit structure. (There are still too many casts
1105 in the code, but that may be unavoidable.)
1106
1107 Also added code so that with -vv it is very chatty about what it does.
1108
1109 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
1110 Change #! line to modern usage; also chmod +x
1111
1112 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
1113 Change #! line to modern usage
1114
1115 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
1116
1117 The filename to URL conversion didn't properly quote special
1118 characters.
1119 The URL to filename didn't properly unquote special chatacters.
1120
1121 * Objects/floatobject.c:
1122 OK, try again. Vladimir gave me a fix for the alignment bus error,
1123 so here's his patch again. This time it works (at least on Solaris,
1124 Linux and Irix).
1125
1126Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1127
1128 * Tools/idle/PathBrowser.py:
1129 Don't crash when sys.path contains an empty string.
1130
1131 * Tools/idle/PathBrowser.py:
1132 - Don't crash in the case where a superclass is a string instead of a
1133 pyclbr.Class object; this can happen when the superclass is
1134 unrecognizable (to pyclbr), e.g. when module renaming is used.
1135
1136 - Show a watch cursor when calling pyclbr (since it may take a while
1137 recursively parsing imported modules!).
1138
1139Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1140
1141 * Lib/mimetypes.py:
1142 Added .rdf and .xsl as application/xml types. (.rdf is for the
1143 Resource Description Framework, a metadata encoding, and .xsl is for
1144 the Extensible Stylesheet Language.)
1145
1146Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1147
1148 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
1149 Test for popen2 module, by Chris Tismer.
1150
1151 * Objects/floatobject.c:
1152 Alas, Vladimir's patch caused a bus error (probably double
1153 alignment?), and I didn't test it. Withdrawing it for now.
1154
1155Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1156
1157 * Objects/floatobject.c:
1158 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
1159 floats on finalization.
1160
1161 * Objects/intobject.c:
1162 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
1163 integers on finalization.
1164
1165 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
1166 Add PathBrowser to File module
1167
1168 * Tools/idle/PathBrowser.py:
1169 "Path browser" - 4 scrolled lists displaying:
1170 directories on sys.path
1171 modules in selected directory
1172 classes in selected module
1173 methods of selected class
1174
1175 Sinlge clicking in a directory, module or class item updates the next
1176 column with info about the selected item. Double clicking in a
1177 module, class or method item opens the file (and selects the clicked
1178 item if it is a class or method).
1179
1180 I guess eventually I should be using a tree widget for this, but the
1181 ones I've seen don't work well enough, so for now I use the old
1182 Smalltalk or NeXT style multi-column hierarchical browser.
1183
1184 * Tools/idle/MultiScrolledLists.py:
1185 New utility: multiple scrolled lists in parallel
1186
1187 * Tools/idle/ScrolledList.py: - White background.
1188 - Display "(None)" (or text of your choosing) when empty.
1189 - Don't set the focus.
1190
1191Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1192
1193 * Lib/urllib.py:
1194 open_http also had the 'data is None' test backwards. don't call with the
1195 extra argument if data is None.
1196
1197 * Demo/embed/demo.c:
1198 Call Py_SetProgramName() instead of redefining getprogramname(),
1199 reflecting changes in the runtime around 1.5 or earlier.
1200
1201 * Python/ceval.c:
1202 Always test for an error return (usually NULL or -1) without setting
1203 an exception.
1204
1205 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
1206 He writes:
1207
1208 I had an off-by-1000 error in floatsleep(),
1209 and the problem with time.clock() is that it's not implemented properly
1210 on QNX... ANSI says it's supposed to return _CPU_ time used by the
1211 process, but on QNX it returns the amount of real time used... so I was
1212 confused.
1213
1214 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
1215 Test for self.returntype behaving like OSErr rather than being it.
1216
1217Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
1218
1219 * Lib/urllib.py:
1220 http_error had the 'data is None' test backwards. don't call with the
1221 extra argument if data is None.
1222
1223 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
1224
1225 * Lib/urllib.py: pleasing the tabnanny
1226
1227Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1228
1229 * Lib/colorsys.py:
1230 Oops, one more "x, y, z" to convert...
1231
1232 * Lib/colorsys.py:
1233 Adjusted comment at the top to be less confusing, following Fredrik
1234 Lundh's example.
1235
1236 Converted comment to docstring.
1237
1238Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1239
1240 * Lib/toaiff.py:
1241 Use sndhdr instead of the obsolete whatsound module.
1242
1243Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
1244
1245 * Lib/urllib.py:
1246 When performing a POST request, i.e. when the second argument to
1247 urlopen is used to specify form data, make sure the second argument is
1248 threaded through all of the http_error_NNN calls. This allows error
1249 handlers like the redirect and authorization handlers to properly
1250 re-start the connection.
1251
1252Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1253
1254 * Lib/mhlib.py: Patch by Lars Wirzenius:
1255
1256 o the initial comment is wrong: creating messages is already
1257 implemented
1258
1259 o Message.getbodytext: if the mail or it's part contains an
1260 empty content-transfer-encoding header, the code used to
1261 break; the change below treats an empty encoding value the same
1262 as the other types that do not need decoding
1263
1264 o SubMessage.getbodytext was missing the decode argument; the
1265 change below adds it; I also made it unconditionally return
1266 the raw text if decoding was not desired, because my own
1267 routines needed that (and it was easier than rewriting my
1268 own routines ;-)
1269
1270Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
1271
1272 * Python/bltinmodule.c (initerrors):
1273 Make sure that the exception tuples ("base-classes" when
1274 string-based exceptions are used) reflect the real class hierarchy,
1275 i.e. that SystemExit derives from Exception not StandardError.
1276
1277 * Lib/exceptions.py:
1278 Document the correct class hierarchy for SystemExit. It is not an
1279 error and so it derives from Exception and not SystemError. The
1280 docstring was incorrect but the implementation was fine.
1281
1282Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1283
1284 * Lib/shutil.py:
1285 Add import sys, needed by reference to sys.exc_info() in rmtree().
1286 Discovered by Mitch Chapman.
1287
1288 * config.h.in:
1289 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
1290 disappears. It wasn't used anywhere anyway...
1291
1292 * Modules/arraymodule.c:
1293 Carefully check for overflow when allocating the memory for fromfile
1294 -- someone tried to pass in sys.maxint and got bitten by the bogus
1295 calculations.
1296
1297 * configure.in:
1298 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
1299 LIBM (from --with-libm=...); this actually broke the customizability
1300 offered by the latter option. Thanks go to Clay Spence for reporting
1301 this.
1302
1303 * Lib/test/test_dl.py:
1304 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
1305 2. When no test case worked, raise ImportError instead of failing.
1306
1307 * Python/bltinmodule.c:
1308 Patch by Tim Peters to improve the range checks for range() and
1309 xrange(), especially for platforms where int and long are different
1310 sizes (so sys.maxint isn't actually the theoretical limit for the
1311 length of a list, but the largest C int is -- sys.maxint is the
1312 largest Python int, which is actually a C long).
1313
1314 * Makefile.in:
1315 1. Augment the DG/UX rule so it doesn't break the BeOS build.
1316 2. Add $(EXE) to various occurrences of python so it will work on
1317 Cygwin with egcs (after setting EXE=.exe). These patches by
1318 Norman Vine.
1319
1320 * Lib/posixfile.py:
1321 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
1322 list (of bsd variants that have a different lock structure).
1323
1324 * Lib/test/test_fcntl.py:
1325 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
1326
1327 * Modules/timemodule.c:
1328 Patch by Tadayoshi Funaba (with some changes) to be smarter about
1329 guessing what happened when strftime() returns 0. Is it buffer
1330 overflow or was the result simply 0 bytes long? (This happens for an
1331 empty format string, or when the format string is a single %Z and the
1332 timezone is unknown.) if the buffer is at least 256 times as long as
1333 the format, assume the latter.
1334
1335Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1336
1337 * Lib/urllib.py:
1338 As Des Barry points out, we need to call pathname2url(file) in two
1339 calls to addinfourl() in open_file().
1340
1341 * Modules/Setup.in: Document *static* -- in two places!
1342
1343 * Modules/timemodule.c:
1344 We don't support leap seconds, so the seconds field of a time 9-tuple
1345 should be in the range [0-59]. Noted by Tadayoshi Funaba.
1346
1347 * Modules/stropmodule.c:
1348 In atoi(), don't use isxdigit() to test whether the last character
1349 converted was a "digit" -- use isalnum(). This test is there only to
1350 guard against "+" or "-" being interpreted as a valid int literal.
1351 Reported by Takahiro Nakayama.
1352
1353 * Lib/os.py:
1354 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
1355 so they don't need to be treated specially here.
1356
1357Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1358
1359 * Misc/NEWS:
1360 Typo: "apparentlt" --> "apparently"
1361
1362Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1363
1364 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
1365
1366 * Modules/posixmodule.c:
1367 The docstring for ttyname(..) claims a second "mode" argument. The
1368 actual code does not allow such an argument. (Finn Bock.)
1369
1370 * Lib/lib-old/poly.py:
1371 Dang. Even though this is obsolete code, somebody found a bug, and I
1372 fix it. Oh well.
1373
1374Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1375
1376 * Lib/pyclbr.py:
1377 Bow to font-lock at the end of the docstring, since it throws stuff
1378 off.
1379
1380 Make sure the path paramter to readmodule() is a list before adding it
1381 with sys.path, or the addition could fail.
1382
1383
1384======================================================================
1385
1386
1387From 1.5.2b1 to 1.5.2b2
1388=======================
1389
1390General
1391-------
1392
1393- Many memory leaks fixed.
1394
1395- Many small bugs fixed.
1396
1397- Command line option -OO (or -O -O) suppresses inclusion of doc
1398strings in resulting bytecode.
1399
1400Windows-specific changes
1401------------------------
1402
1403- New built-in module winsound provides an interface to the Win32
1404PlaySound() call.
1405
1406- Re-enable the audioop module in the config.c file.
1407
1408- On Windows, support spawnv() and associated P_* symbols.
1409
1410- Fixed the conversion of times() return values on Windows.
1411
1412- Removed freeze from the installer -- it doesn't work without the
1413source tree. (See FAQ 8.11.)
1414
1415- On Windows 95/98, the Tkinter module now is smart enough to find
1416Tcl/Tk even when the PATH environment variable hasn't been set -- when
1417the import of _tkinter fails, it searches in a standard locations,
1418patches os.environ["PATH"], and tries again. When it still fails, a
1419clearer error message is produced. This should avoid most
1420installation problems with Tkinter use (e.g. in IDLE).
1421
1422- The -i option doesn't make any calls to set[v]buf() for stdin --
1423this apparently screwed up _kbhit() and the _tkinter main loop.
1424
1425- The ntpath module (and hence, os.path on Windows) now parses out UNC
1426paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
1427splitdrive() will \\host\mountpoint as the drive and \dir\file as the
1428path. ** EXPERIMENTAL **
1429
1430- Added a hack to the exit code so that if (1) the exit status is
1431nonzero and (2) we think we have our own DOS box (i.e. we're not
1432started from a command line shell), we print a message and wait for
1433the user to hit a key before the DOS box is closed.
1434
1435- Updated the installer to WISE 5.0g. Added a dialog warning about
1436the imminent Tcl installation. Added a dialog to specify the program
1437group name in the start menu. Upgraded the Tcl installer to Tcl
14388.0.4.
1439
1440Changes to intrinsics
1441---------------------
1442
1443- The repr() or str() of a module object now shows the __file__
1444attribute (i.e., the file which it was loaded), or the string
1445"(built-in)" if there is no __file__ attribute.
1446
1447- The range() function now avoids overflow during its calculations (if
1448at all possible).
1449
1450- New info string sys.hexversion, which is an integer encoding the
1451version in hexadecimal. In other words, hex(sys.hexversion) ==
14520x010502b2 for Python 1.5.2b2.
1453
1454New or improved ports
1455---------------------
1456
1457- Support for Nextstep descendants (future Mac systems).
1458
1459- Improved BeOS support.
1460
1461- Support dynamic loading of shared libraries on NetBSD platforms that
1462use ELF (i.e., MIPS and Alpha systems).
1463
1464Configuration/build changes
1465---------------------------
1466
1467- The Lib/test directory is no longer included in the default module
1468search path (sys.path) -- "test" has been a package ever since 1.5.
1469
1470- Now using autoconf 2.13.
1471
1472New library modules
1473-------------------
1474
1475- New library modules asyncore and asynchat: these form Sam Rushing's
1476famous asynchronous socket library. Sam has gracefully allowed me to
1477incorporate these in the standard Python library.
1478
1479- New module statvfs contains indexing constants for [f]statvfs()
1480return tuple.
1481
1482Changes to the library
1483----------------------
1484
1485- The wave module (platform-independent support for Windows sound
1486files) has been fixed to actually make it work.
1487
1488- The sunau module (platform-independent support for Sun/NeXT sound
1489files) has been fixed to work across platforms. Also, a weird
1490encoding bug in the header of the audio test data file has been
1491corrected.
1492
1493- Fix a bug in the urllib module that occasionally tripped up
1494webchecker and other ftp retrieves.
1495
1496- ConfigParser's get() method now accepts an optional keyword argument
1497(vars) that is substituted on top of the defaults that were setup in
1498__init__. You can now also have recusive references in your
1499configuration file.
1500
1501- Some improvements to the Queue module, including a put_nowait()
1502module and an optional "block" second argument, to get() and put(),
1503defaulting to 1.
1504
1505- The updated xmllib module is once again compatible with the version
1506present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
1507
1508- The bdb module (base class for the debugger) now supports
1509canonicalizing pathnames used in breakpoints. The derived class must
1510override the new canonical() method for this to work. Also changed
1511clear_break() to the backwards compatible old signature, and added
1512clear_bpbynumber() for the new functionality.
1513
1514- In sgmllib (and hence htmllib), recognize attributes even if they
1515don't have space in front of them. I.e. '<a
1516name="foo"href="bar.html">' will now have two attributes recognized.
1517
1518- In the debugger (pdb), change clear syntax to support three
1519alternatives: clear; clear file:line; clear bpno bpno ...
1520
1521- The os.path module now pretends to be a submodule within the os
1522"package", so you can do things like "from os.path import exists".
1523
1524- The standard exceptions now have doc strings.
1525
1526- In the smtplib module, exceptions are now classes. Also avoid
1527inserting a non-standard space after "TO" in rcpt() command.
1528
1529- The rfc822 module's getaddrlist() method now uses all occurrences of
1530the specified header instead of just the first. Some other bugfixes
1531too (to handle more weird addresses found in a very large test set,
1532and to avoid crashes on certain invalid dates), and a small test
1533module has been added.
1534
1535- Fixed bug in urlparse in the common-case code for HTTP URLs; it
1536would lose the query, fragment, and/or parameter information.
1537
1538- The sndhdr module no longer supports whatraw() -- it depended on a
1539rare extenral program.
1540
1541- The UserList module/class now supports the extend() method, like
1542real list objects.
1543
1544- The uu module now deals better with trailing garbage generated by
1545some broke uuencoders.
1546
1547- The telnet module now has an my_interact() method which uses threads
1548instead of select. The interact() method uses this by default on
1549Windows (where the single-threaded version doesn't work).
1550
1551- Add a class to mailbox.py for dealing with qmail directory
1552mailboxes. The test code was extended to notice these being used as
1553well.
1554
1555Changes to extension modules
1556----------------------------
1557
1558- Support for the [f]statvfs() system call, where it exists.
1559
1560- Fixed some bugs in cPickle where bad input could cause it to dump
1561core.
1562
1563- Fixed cStringIO to make the writelines() function actually work.
1564
1565- Added strop.expandtabs() so string.expandtabs() is now much faster.
1566
1567- Added fsync() and fdatasync(), if they appear to exist.
1568
1569- Support for "long files" (64-bit seek pointers).
1570
1571- Fixed a bug in the zlib module's flush() function.
1572
1573- Added access() system call. It returns 1 if access granted, 0 if
1574not.
1575
1576- The curses module implements an optional nlines argument to
1577w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
1578
1579Changes to tools
1580----------------
1581
1582- Some changes to IDLE; see Tools/idle/NEWS.txt.
1583
1584- Latest version of Misc/python-mode.el included.
1585
1586Changes to Tkinter
1587------------------
1588
1589- Avoid tracebacks when an image is deleted after its root has been
1590destroyed.
1591
1592Changes to the Python/C API
1593---------------------------
1594
1595- When parentheses are used in a PyArg_Parse[Tuple]() call, any
1596sequence is now accepted, instead of requiring a tuple. This is in
1597line with the general trend towards accepting arbitrary sequences.
1598
1599- Added PyModule_GetFilename().
1600
1601- In PyNumber_Power(), remove unneeded and even harmful test for float
1602to the negative power (which is already and better done in
1603floatobject.c).
1604
1605- New version identification symbols; read patchlevel.h for info. The
1606version numbers are now exported by Python.h.
1607
1608- Rolled back the API version change -- it's back to 1007!
1609
1610- The frozenmain.c function calls PyInitFrozenExtensions().
1611
1612- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
1613INCREF.
1614
1615
1616======================================================================
1617
1618
1619From 1.5.2a2 to 1.5.2b1
1620=======================
1621
1622Changes to intrinsics
1623---------------------
1624
1625- New extension NotImplementedError, derived from RuntimeError. Not
1626used, but recommended use is for "abstract" methods to raise this.
1627
1628- The parser will now spit out a warning or error when -t or -tt is
1629used for parser input coming from a string, too.
1630
1631- The code generator now inserts extra SET_LINENO opcodes when
1632compiling multi-line argument lists.
1633
1634- When comparing bound methods, use identity test on the objects, not
1635equality test.
1636
1637New or improved ports
1638---------------------
1639
1640- Chris Herborth has redone his BeOS port; it now works on PowerPC
1641(R3/R4) and x86 (R4 only). Threads work too in this port.
1642
1643Renaming
1644--------
1645
1646- Thanks to Chris Herborth, the thread primitives now have proper Py*
1647names in the source code (they already had those for the linker,
1648through some smart macros; but the source still had the old, un-Py
1649names).
1650
1651Configuration/build changes
1652---------------------------
1653
1654- Improved support for FreeBSD/3.
1655
1656- Check for pthread_detach instead of pthread_create in libc.
1657
1658- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
1659
1660- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
1661Otherwise modules such as thread didn't get incorporated in extensions.
1662
1663New library modules
1664-------------------
1665
1666- shlex.py by Eric Raymond provides a lexical analyzer class for
1667simple shell-like syntaxes.
1668
1669- netrc.py by Eric Raymond provides a parser for .netrc files. (The
1670undocumented Netrc class in ftplib.py is now obsolete.)
1671
1672- codeop.py is a new module that contains the compile_command()
1673function that was previously in code.py. This is so that JPython can
1674provide its own version of this function, while still sharing the
1675higher-level classes in code.py.
1676
1677- turtle.py is a new module for simple turtle graphics. I'm still
1678working on it; let me know if you use this to teach Python to children
1679or other novices without prior programming experience.
1680
1681Obsoleted library modules
1682-------------------------
1683
1684- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
1685their status of obsoleteness. They don't do a particularly good job
1686and don't seem particularly relevant to the Python core.
1687
1688New tools
1689---------
1690
1691- I've added IDLE: my Integrated DeveLopment Environment for Python.
1692Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
1693work on Macintosh, but I haven't been able to test it there; it does
1694depend on new features in 1.5.2 and perhaps even new features in
16951.5.2b1, especially the new code module). This is very much a work in
1696progress. I'd like to hear how people like it compared to PTUI (or
1697any other IDE they are familiar with).
1698
1699- New tools by Barry Warsaw:
1700
1701 = audiopy: controls the Solaris Audio device
1702 = pynche: The PYthonically Natural Color and Hue Editor
1703 = world: Print mappings between country names and DNS country codes
1704
1705New demos
1706---------
1707
1708- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
1709song.
1710
1711- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
1712Tkinter. (By Fredrik Lundh -- not by me!)
1713
1714Changes to the library
1715----------------------
1716
1717- compileall.py now avoids recompiling .py files that haven't changed;
1718it adds a -f option to force recompilation.
1719
1720- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
1721patches).
1722
1723- nntplib.py: statparse() no longer lowercases the message-id.
1724
1725- types.py: use type(__stdin__) for FileType.
1726
1727- urllib.py: fix translations for filenames with "funny" characters.
1728Patch by Sjoerd Mullender. Note that if you subclass one of the
1729URLopener classes, and you have copied code from the old urllib.py,
1730your subclass may stop working. A long-term solution is to provide
1731more methods so that you don't have to copy code.
1732
1733- cgi.py: In read_multi, allow a subclass to override the class we
1734instantiate when we create a recursive instance, by setting the class
1735variable 'FieldStorageClass' to the desired class. By default, this
1736is set to None, in which case we use self.__class__ (as before).
1737Also, a patch by Jim Fulton to pass additional arguments to recursive
1738calls to the FieldStorage constructor from its read_multi method.
1739
1740- UserList.py: In __getslice__, use self.__class__ instead of
1741UserList.
1742
1743- In SimpleHTTPServer.py, the server specified in test() should be
1744BaseHTTPServer.HTTPServer, in case the request handler should want to
1745reference the two attributes added by BaseHTTPServer.server_bind. (By
1746Jeff Rush, for Bobo). Also open the file in binary mode, so serving
1747images from a Windows box might actually work.
1748
1749- In CGIHTTPServer.py, the list of acceptable formats is -split-
1750on spaces but -joined- on commas, resulting in double commas
1751in the joined text. (By Jeff Rush.)
1752
1753- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
1754new threaded versions of Unix Server classes, using the ThreadingMixIn
1755class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
1756
1757- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
1758method do_delete(); do_clear() was meant. By Greg Ward.
1759
1760- getopt.py: accept a non-list sequence for the long options (request
1761by Jack Jansen). Because it might be a common mistake to pass a
1762single string, this situation is treated separately. Also added
1763docstrings (copied from the library manual) and removed the (now
1764redundant) module comments.
1765
1766- tempfile.py: improvements to avoid security leaks.
1767
1768- code.py: moved compile_command() to new module codeop.py.
1769
1770- pickle.py: support pickle format 1.3 (binary float added). By Jim
1771Fulton. Also get rid of the undocumented obsolete Pickler dump_special
1772method.
1773
1774- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
1775
1776- imaplib.py: fix problem with some versions of IMAP4 servers that
1777choose to mix the case in their CAPABILITIES response.
1778
1779- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
1780by Fredrik Lundh.
1781
1782Changes to extension modules
1783----------------------------
1784
1785- More doc strings for several modules were contributed by Chris
1786Petrilli: math, cmath, fcntl.
1787
1788- Fixed a bug in zlibmodule.c that could cause core dumps on
1789decompression of rarely occurring input.
1790
1791- cPickle.c: new version from Jim Fulton, with Open Source copyright
1792notice. Also, initialize self->safe_constructors early on to prevent
1793crash in early dealloc.
1794
1795- cStringIO.c: new version from Jim Fulton, with Open Source copyright
1796notice. Also fixed a core dump in cStringIO.c when doing seeks.
1797
1798- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
1799
1800- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
1801modifies its argument string (bad function!), so we make a temporary
1802copy.
1803
1804- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
1805control pseudo-device, per audio(7I).
1806
1807Changes to tools
1808----------------
1809
1810- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
1811support for Emacs).
1812
1813- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
1814only the names of offending files to be printed.
1815
1816- freeze: when printing missing modules, also print the module they
1817were imported from.
1818
1819- untabify.py: patch by Detlef Lannert to implement -t option
1820(set tab size).
1821
1822Changes to Tkinter
1823------------------
1824
1825- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
1826row2?
1827
1828- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
1829doesn't work when running in a non-threaded environment. He added
1830some #ifdefs that fix this.
1831
1832Changes to the Python/C API
1833---------------------------
1834
1835- Bumped API version number to 1008 -- enough things have changed!
1836
1837- There's a new macro, PyThreadState_GET(), which does the same work
1838as PyThreadState_Get() without the overhead of a function call (it
1839also avoids the error check). The two top calling locations of
1840PyThreadState_Get() have been changed to use this macro.
1841
1842- All symbols intended for export from a DLL or shared library are now
1843marked as such (with the DL_IMPORT() macro) in the header file that
1844declares them. This was needed for the BeOS port, and should also
1845make some other ports easier. The PC port no longer needs the file
1846with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
1847macro which is only used for init methods in extension modules, and
1848for Py_Main().
1849
1850Invisible changes to internals
1851------------------------------
1852
1853- Fixed a bug in new_buffersize() in fileobject.c which could
1854return a buffer size that was way too large.
1855
1856- Use PySys_WriteStderr instead of fprintf in most places.
1857
1858- dictobject.c: remove dead code discovered by Vladimir Marangozov.
1859
1860- tupleobject.c: make tuples less hungry -- an extra item was
1861allocated but never used. Tip by Vladimir Marangozov.
1862
1863- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
1864Jansen)
1865
1866- import.c: Jim Fulton fixes a reference count bug in
1867PyEval_GetGlobals.
1868
1869- glmodule.c: check in the changed version after running the stubber
1870again -- this solves the conflict with curses over the 'clear' entry
1871point much nicer. (Jack Jansen had checked in the changes to cstubs
1872eons ago, but I never regenrated glmodule.c :-( )
1873
1874- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
1875Marangozov.
1876
1877- stropmodule.c: add a missing DECREF in an error exit. Submitted by
1878Jonathan Giddy.
1879
1880
1881======================================================================
1882
1883
1884From 1.5.2a1 to 1.5.2a2
1885=======================
1886
1887General
1888-------
1889
1890- It is now a syntax error to have a function argument without a
1891default following one with a default.
1892
1893- __file__ is now set to the .py file if it was parsed (it used to
1894always be the .pyc/.pyo file).
1895
1896- Don't exit with a fatal error during initialization when there's a
1897problem with the exceptions.py module.
1898
1899- New environment variable PYTHONOPTIMIZE can be used to set -O.
1900
1901- New version of python-mode.el for Emacs.
1902
1903Miscellaneous fixed bugs
1904------------------------
1905
1906- No longer print the (confusing) error message about stack underflow
1907while compiling.
1908
1909- Some threading and locking bugs fixed.
1910
1911- When errno is zero, report "Error", not "Success".
1912
1913Documentation
1914-------------
1915
1916- Documentation will be released separately.
1917
1918- Doc strings added to array and md5 modules by Chris Petrilli.
1919
1920Ports and build procedure
1921-------------------------
1922
1923- Stop installing when a move or copy fails.
1924
1925- New version of the OS/2 port code by Jeff Rush.
1926
1927- The makesetup script handles absolute filenames better.
1928
1929- The 'new' module is now enabled by default in the Setup file.
1930
1931- I *think* I've solved the problem with the Linux build blowing up
1932sometimes due to a conflict between sigcheck/intrcheck and
1933signalmodule.
1934
1935Built-in functions
1936------------------
1937
1938- The second argument to apply() can now be any sequence, not just a
1939tuple.
1940
1941Built-in types
1942--------------
1943
1944- Lists have a new method: L1.extend(L2) is equivalent to the common
1945idiom L1[len(L1):] = L2.
1946
1947- Better error messages when a sequence is indexed with a non-integer.
1948
1949- Bettter error message when calling a non-callable object (include
1950the type in the message).
1951
1952Python services
1953---------------
1954
1955- New version of cPickle.c fixes some bugs.
1956
1957- pickle.py: improved instantiation error handling.
1958
1959- code.py: reworked quite a bit. New base class
1960InteractiveInterpreter and derived class InteractiveConsole. Fixed
1961several problems in compile_command().
1962
1963- py_compile.py: print error message and continue on syntax errors.
1964Also fixed an old bug with the fstat code (it was never used).
1965
1966- pyclbr.py: support submodules of packages.
1967
1968String Services
1969---------------
1970
1971- StringIO.py: raise the right exception (ValueError) for attempted
1972I/O on closed StringIO objects.
1973
1974- re.py: fixed a bug in subn(), which caused .groups() to fail inside
1975the replacement function called by sub().
1976
1977- The struct module has a new format 'P': void * in native mode.
1978
1979Generic OS Services
1980-------------------
1981
1982- Module time: Y2K robustness. 2-digit year acceptance depends on
1983value of time.accept2dyear, initialized from env var PYTHONY2K,
1984default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
1985(POSIX or X/Open recommendation).
1986
1987- os.path: normpath(".//x") should return "x", not "/x".
1988
1989- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
1990doesn't work.
1991
1992- tempfile.py: regenerate the template after a fork() call.
1993
1994Optional OS Services
1995--------------------
1996
1997- In the signal module, disable restarting interrupted system calls
1998when we have siginterrupt().
1999
2000Debugger
2001--------
2002
2003- No longer set __args__; this feature is no longer supported and can
2004affect the debugged code.
2005
2006- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
2007added aliases and some other useful new features, e.g. much better
2008breakpoint support: temporary breakpoint, disabled breakpoints,
2009breakpoints with ignore counts, and conditions; breakpoints can be set
2010on a file before it is loaded.
2011
2012Profiler
2013--------
2014
2015- Changes so that JPython can use it. Also fix the calibration code
2016so it actually works again
2017.
2018Internet Protocols and Support
2019------------------------------
2020
2021- imaplib.py: new version from Piers Lauder.
2022
2023- smtplib.py: change sendmail() method to accept a single string or a
2024list or strings as the destination (commom newbie mistake).
2025
2026- poplib.py: LIST with a msg argument fixed.
2027
2028- urlparse.py: some optimizations for common case (http).
2029
2030- urllib.py: support content-length in info() for ftp protocol;
2031support for a progress meter through a third argument to
2032urlretrieve(); commented out gopher test (the test site is dead).
2033
2034Internet Data handling
2035----------------------
2036
2037- sgmllib.py: support tags with - or . in their name.
2038
2039- mimetypes.py: guess_type() understands 'data' URLs.
2040
2041Restricted Execution
2042--------------------
2043
2044- The classes rexec.RModuleLoader and rexec.RModuleImporter no
2045longer exist.
2046
2047Tkinter
2048-------
2049
2050- When reporting an exception, store its info in sys.last_*. Also,
2051write all of it to stderr.
2052
2053- Added NS, EW, and NSEW constants, for grid's sticky option.
2054
2055- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
2056
2057- Make bind variants without a sequence return a tuple of sequences
2058(formerly it returned a string, which wasn't very convenient).
2059
2060- Add image commands to the Text widget (these are new in Tk 8.0).
2061
2062- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
2063
2064- Improved the thread code (but you still can't call update() from
2065another thread on Windows).
2066
2067- Fixed unnecessary references to _default_root in the new dialog
2068modules.
2069
2070- Miscellaneous problems fixed.
2071
2072
2073Windows General
2074---------------
2075
2076- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
2077search for dependent dlls in the directory containing the .pyd.
2078
2079- In debugging mode, call DebugBreak() in Py_FatalError().
2080
2081Windows Installer
2082-----------------
2083
2084- Install zlib.dll in the DLLs directory instead of in the win32
2085system directory, to avoid conflicts with other applications that have
2086their own zlib.dll.
2087
2088Test Suite
2089----------
2090
2091- test_long.py: new test for long integers, by Tim Peters.
2092
2093- regrtest.py: improved so it can be used for other test suites as
2094well.
2095
2096- test_strftime.py: use re to compare test results, to support legal
2097variants (e.g. on Linux).
2098
2099Tools and Demos
2100---------------
2101
2102- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
2103remove/add Windows style '\r\n' line endings), untabify.py (to remove
2104tabs), and rgrep.yp (reverse grep).
2105
2106- Improvements to Tools/freeze/. Each Python module is now written to
2107its own C file. This prevents some compilers or assemblers from
2108blowing up on large frozen programs, and saves recompilation time if
2109only a few modules are changed. Other changes too, e.g. new command
2110line options -x and -i.
2111
2112- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
2113
2114Python/C API
2115------------
2116
2117- New mechanism to support extensions of the type object while
2118remaining backward compatible with extensions compiled for previous
2119versions of Python 1.5. A flags field indicates presence of certain
2120fields.
2121
2122- Addition to the buffer API to differentiate access to bytes and
21238-bit characters (in anticipation of Unicode characters).
2124
2125- New argument parsing format t# ("text") to indicate 8-bit
2126characters; s# simply means 8-bit bytes, for backwards compatibility.
2127
2128- New object type, bufferobject.c is an example and can be used to
2129create buffers from memory.
2130
2131- Some support for 64-bit longs, including some MS platforms.
2132
2133- Many calls to fprintf(stderr, ...) have been replaced with calls to
2134PySys_WriteStderr(...).
2135
2136- The calling context for PyOS_Readline() has changed: it must now be
2137called with the interpreter lock held! It releases the lock around
2138the call to the function pointed to by PyOS_ReadlineFunctionPointer
2139(default PyOS_StdioReadline()).
2140
2141- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
2142
2143- Renamed header file "thread.h" to "pythread.h".
2144
2145- The code string of code objects may now be anything that supports the
2146buffer API.
2147
2148
2149======================================================================
2150
2151
2152From 1.5.1 to 1.5.2a1
2153=====================
2154
2155General
2156-------
2157
2158- When searching for the library, a landmark that is a compiled module
2159(string.pyc or string.pyo) is also accepted.
2160
2161- When following symbolic links to the python executable, use a loop
2162so that a symlink to a symlink can work.
2163
2164- Added a hack so that when you type 'quit' or 'exit' at the
2165interpreter, you get a friendly explanation of how to press Ctrl-D (or
2166Ctrl-Z) to exit.
2167
2168- New and improved Misc/python-mode.el (Python mode for Emacs).
2169
2170- Revert a new feature in Unix dynamic loading: for one or two
2171revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
2172out to be a bad idea.
2173
2174Miscellaneous fixed bugs
2175------------------------
2176
2177- All patches on the patch page have been integrated. (But much more
2178has been done!)
2179
2180- Several memory leaks plugged (e.g. the one for classes with a
2181__getattr__ method).
2182
2183- Removed the only use of calloc(). This triggered an obscure bug on
2184multiprocessor Sparc Solaris 2.6.
2185
2186- Fix a peculiar bug that would allow "import sys.time" to succeed
2187(believing the built-in time module to be a part of the sys package).
2188
2189- Fix a bug in the overflow checking when converting a Python long to
2190a C long (failed to convert -2147483648L, and some other cases).
2191
2192Documentation
2193-------------
2194
2195- Doc strings have been added to many extension modules: __builtin__,
2196errno, select, signal, socket, sys, thread, time. Also to methods of
2197list objects (try [].append.__doc__). A doc string on a type will now
2198automatically be propagated to an instance if the instance has methods
2199that are accessed in the usual way.
2200
2201- The documentation has been expanded and the formatting improved.
2202(Remember that the documentation is now unbundled and has its own
2203release cycle though; see http://www.python.org/doc/.)
2204
2205- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
2206
2207Ports and build procedure
2208-------------------------
2209
2210- The BeOS port is now integrated. Courtesy Chris Herborth.
2211
2212- Symbol files for FreeBSD 2.x and 3.x have been contributed
2213(Lib/plat-freebsd[23]/*).
2214
2215- Support HPUX 10.20 DCE threads.
2216
2217- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
2218works, it won't also use -Olimit 1500 (which gives a warning for every
2219file). Also support the SGI_ABI environment variable better.
2220
2221- The makesetup script now understands absolute pathnames ending in .o
2222in the module -- it assumes it's a file for which we have no source.
2223
2224- Other miscellaneous improvements to the configure script and
2225Makefiles.
2226
2227- The test suite now uses a different sound sample.
2228
2229Built-in functions
2230------------------
2231
2232- Better checks for invalid input to int(), long(), string.atoi(),
2233string.atol(). (Formerly, a sign without digits would be accepted as
2234a legal ways to spell zero.)
2235
2236- Changes to map() and filter() to use the length of a sequence only
2237as a hint -- if an IndexError happens earlier, take that. (Formerly,
2238this was considered an error.)
2239
2240- Experimental feature in getattr(): a third argument can specify a
2241default (instead of raising AttributeError).
2242
2243- Implement round() slightly different, so that for negative ndigits
2244no additional errors happen in the last step.
2245
2246- The open() function now adds the filename to the exception when it
2247fails.
2248
2249Built-in exceptions
2250-------------------
2251
2252- New standard exceptions EnvironmentError and PosixError.
2253EnvironmentError is the base class for IOError and PosixError;
2254PosixError is the same as os.error. All this so that either exception
2255class can be instantiated with a third argument indicating a filename.
2256The built-in function open() and most os/posix functions that take a
2257filename argument now use this.
2258
2259Built-in types
2260--------------
2261
2262- List objects now have an experimental pop() method; l.pop() returns
2263and removes the last item; l.pop(i) returns and removes the item at
2264i. Also, the sort() method is faster again. Sorting is now also
2265safer: it is impossible for the sorting function to modify the list
2266while the sort is going on (which could cause core dumps).
2267
2268- Changes to comparisons: numbers are now smaller than any other type.
2269This is done to prevent the circularity where [] < 0L < 1 < [] is
2270true. As a side effect, cmp(None, 0) is now positive instead of
2271negative. This *shouldn't* affect any working code, but I've found
2272that the change caused several "sleeping" bugs to become active, so
2273beware!
2274
2275- Instance methods may now have other callable objects than just
2276Python functions as their im_func. Use new.instancemethod() or write
2277your own C code to create them; new.instancemethod() may be called
2278with None for the instance to create an unbound method.
2279
2280- Assignment to __name__, __dict__ or __bases__ of a class object is
2281now allowed (with stringent type checks); also allow assignment to
2282__getattr__ etc. The cached values for __getattr__ etc. are
2283recomputed after such assignments (but not for derived classes :-( ).
2284
2285- Allow assignment to some attributes of function objects: func_code,
2286func_defaults and func_doc / __doc__. (With type checks except for
2287__doc__ / func_doc .)
2288
2289Python services
2290---------------
2291
2292- New tests (in Lib/test): reperf.py (regular expression benchmark),
2293sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
2294for the MimeWriter module).
2295
2296- Generalized test/regrtest.py so that it is useful for testing other
2297packages.
2298
2299- The ihooks.py module now understands package imports.
2300
2301- In code.py, add a class that subsumes Fredrik Lundh's
2302PythonInterpreter class. The interact() function now uses this.
2303
2304- In rlcompleter.py, in completer(), return None instead of raising an
2305IndexError when there are no more completions left.
2306
2307- Fixed the marshal module to test for certain common kinds of invalid
2308input. (It's still not foolproof!)
2309
2310- In the operator module, add an alias (now the preferred name)
2311"contains" for "sequenceincludes".
2312
2313String Services
2314---------------
2315
2316- In the string and strop modules, in the replace() function, treat an
2317empty pattern as an error (since it's not clear what was meant!).
2318
2319- Some speedups to re.py, especially the string substitution and split
2320functions. Also added new function/method findall(), to find all
2321occurrences of a given substring.
2322
2323- In cStringIO, add better argument type checking and support the
2324readonly 'closed' attribute (like regular files).
2325
2326- In the struct module, unsigned 1-2 byte sized formats no longer
2327result in long integer values.
2328
2329Miscellaneous services
2330----------------------
2331
2332- In whrandom.py, added new method and function randrange(), same as
2333choice(range(start, stop, step)) but faster. This addresses the
2334problem that randint() was accidentally defined as taking an inclusive
2335range. Also, randint(a, b) is now redefined as randrange(a, b+1),
2336adding extra range and type checking to its arguments!
2337
2338- Add some semi-thread-safety to random.gauss() (it used to be able to
2339crash when invoked from separate threads; now the worst it can do is
2340give a duplicate result occasionally).
2341
2342- Some restructuring and generalization done to cmd.py.
2343
2344- Major upgrade to ConfigParser.py; converted to using 're', added new
2345exceptions, support underscore in section header and option name. No
2346longer add 'name' option to every section; instead, add '__name__'.
2347
2348- In getpass.py, don't use raw_input() to ask for the password -- we
2349don't want it to show up in the readline history! Also don't catch
2350interrupts (the try-finally already does all necessary cleanup).
2351
2352Generic OS Services
2353-------------------
2354
2355- New functions in os.py: makedirs(), removedirs(), renames(). New
2356variable: linesep (the line separator as found in binary files,
2357i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
2358this with files opened in (default) text mode; the line separator used
2359will always be '\n'!
2360
2361- Changes to the 'os.path' submodule of os.py: added getsize(),
2362getmtime(), getatime() -- these fetch the most popular items from the
2363stat return tuple.
2364
2365- In the time module, add strptime(), if it exists. (This parses a
2366time according to a format -- the inverse of strftime().) Also,
2367remove the call to mktime() from strftime() -- it messed up the
2368formatting of some non-local times.
2369
2370- In the socket module, added a new function gethostbyname_ex().
2371Also, don't use #ifdef to test for some symbols that are enums on some
2372platforms (and should exist everywhere).
2373
2374Optional OS Services
2375--------------------
2376
2377- Some fixes to gzip.py. In particular, the readlines() method now
2378returns the lines *with* trailing newline characters, like readlines()
2379of regular file objects. Also, it didn't work together with cPickle;
2380fixed that.
2381
2382- In whichdb.py, support byte-swapped dbhash (bsddb) files.
2383
2384- In anydbm.py, look at the type of an existing database to determine
2385which module to use to open it. (The anydbm.error exception is now a
2386tuple.)
2387
2388Unix Services
2389-------------
2390
2391- In the termios module, in tcsetattr(), initialize the structure vy
2392calling tcgetattr().
2393
2394- Added some of the "wait status inspection" macros as functions to
2395the posix module (and thus to the os module): WEXITSTATUS(),
2396WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
2397
2398- In the syslog module, make the default facility more intuitive
2399(matching the docs).
2400
2401Debugger
2402--------
2403
2404- In pdb.py, support for setting breaks on files/modules that haven't
2405been loaded yet.
2406
2407Internet Protocols and Support
2408------------------------------
2409
2410- Changes in urllib.py; sped up unquote() and quote(). Fixed an
2411obscure bug in quote_plus(). Added urlencode(dict) -- convenience
2412function for sending a POST request with urlopen(). Use the getpass
2413module to ask for a password. Rewrote the (test) main program so that
2414when used as a script, it can retrieve one or more URLs to stdout.
2415Use -t to run the self-test. Made the proxy code work again.
2416
2417- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
2418fail when someone asks for their HEAD. Also, for POST, set the
2419default content-type to application/x-www-form-urlencoded. Also, in
2420FieldStorage.__init__(), when method='GET', always get the query
2421string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
2422explicitly passed in fp.
2423
2424- The smtplib.py module now supports ESMTP and has improved standard
2425compliance, for picky servers.
2426
2427- Improved imaplib.py.
2428
2429- Fixed UDP support in SocketServer.py (it never worked).
2430
2431- Fixed a small bug in CGIHTTPServer.py.
2432
2433Internet Data handling
2434----------------------
2435
2436- In rfc822.py, add a new class AddressList. Also support a new
2437overridable method, isheader(). Also add a get() method similar to
2438dictionaries (and make getheader() an alias for it). Also, be smarter
2439about seekable (test whether fp.tell() works) and test for presence of
2440unread() method before trying seeks.
2441
2442- In sgmllib.py, restore the call to report_unbalanced() that was lost
2443long ago. Also some other improvements: handle <? processing
2444instructions >, allow . and - in entity names, and allow \r\n as line
2445separator.
2446
2447- Some restructuring and generalization done to multifile.py; support
2448a 'seekable' flag.
2449
2450Restricted Execution
2451--------------------
2452
2453- Improvements to rexec.py: package support; support a (minimal)
2454sys.exc_info(). Also made the (test) main program a bit fancier (you
2455can now use it to run arbitrary Python scripts in restricted mode).
2456
2457Tkinter
2458-------
2459
2460- On Unix, Tkinter can now safely be used from a multi-threaded
2461application. (Formerly, no threads would make progress while
2462Tkinter's mainloop() was active, because it didn't release the Python
2463interpreter lock.) Unfortunately, on Windows, threads other than the
2464main thread should not call update() or update_idletasks() because
2465this will deadlock the application.
2466
2467- An interactive interpreter that uses readline and Tkinter no longer
2468uses up all available CPU time.
2469
2470- Even if readline is not used, Tk windows created in an interactive
2471interpreter now get continuously updated. (This even works in Windows
2472as long as you don't hit a key.)
2473
2474- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
2475
2476- No longer register Tcl_finalize() as a low-level exit handler. It
2477may call back into Python, and that's a bad idea.
2478
2479- Allow binding of Tcl commands (given as a string).
2480
2481- Some minor speedups; replace explicitly coded getint() with int() in
2482most places.
2483
2484- In FileDialog.py, remember the directory of the selected file, if
2485given.
2486
2487- Change the names of all methods in the Wm class: they are now
2488wm_title(), etc. The old names (title() etc.) are still defined as
2489aliases.
2490
2491- Add a new method of interpreter objects, interpaddr(). This returns
2492the address of the Tcl interpreter object, as an integer. Not very
2493useful for the Python programmer, but this can be called by another C
2494extension that needs to make calls into the Tcl/Tk C API and needs to
2495get the address of the Tcl interpreter object. A simple cast of the
2496return value to (Tcl_Interp *) will do the trick.
2497
2498Windows General
2499---------------
2500
2501- Don't insist on proper case for module source files if the filename
2502is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
2503doesn't). This should address problems with this feature on
2504oldfashioned filesystems (Novell servers?).
2505
2506Windows Library
2507---------------
2508
2509- os.environ is now all uppercase, but accesses are case insensitive,
2510and the putenv() calls made as a side effect of changing os.environ
2511are case preserving.
2512
2513- Removed samefile(), sameopenfile(), samestat() from os.path (aka
2514ntpath.py) -- these cannot be made to work reliably (at least I
2515wouldn't know how).
2516
2517- Fixed os.pipe() so that it returns file descriptors acceptable to
2518os.read() and os.write() (like it does on Unix), rather than Windows
2519file handles.
2520
2521- Added a table of WSA error codes to socket.py.
2522
2523- In the select module, put the (huge) file descriptor arrays on the
2524heap.
2525
2526- The getpass module now raises KeyboardInterrupt when it sees ^C.
2527
2528- In mailbox.py, fix tell/seek when using files opened in text mode.
2529
2530- In rfc822.py, fix tell/seek when using files opened in text mode.
2531
2532- In the msvcrt extension module, release the interpreter lock for
2533calls that may block: _locking(), _getch(), _getche(). Also fix a
2534bogus error return when open_osfhandle() doesn't have the right
2535argument list.
2536
2537Windows Installer
2538-----------------
2539
2540- The registry key used is now "1.5" instead of "1.5.x" -- so future
2541versions of 1.5 and Mark Hammond's win32all installer don't need to be
2542resynchronized.
2543
2544Windows Tools
2545-------------
2546
2547- Several improvements to freeze specifically for Windows.
2548
2549Windows Build Procedure
2550-----------------------
2551
2552- The VC++ project files and the WISE installer have been moved to the
2553PCbuild subdirectory, so they are distributed in the same subdirectory
2554where they must be used. This avoids confusion.
2555
2556- New project files for Windows 3.1 port by Jim Ahlstrom.
2557
2558- Got rid of the obsolete subdirectory PC/setup_nt/.
2559
2560- The projects now use distinct filenames for the .exe, .dll, .lib and
2561.pyd files built in debug mode (by appending "_d" to the base name,
2562before the extension). This makes it easier to switch between the two
2563and get the right versions. There's a pragma in config.h that directs
2564the linker to include the appropriate .lib file (so python15.lib no
2565longer needs to be explicit in your project).
2566
2567- The installer now installs more files (e.g. config.h). The idea is
2568that you shouldn't need the source distribution if you want build your
2569own extensions in C or C++.
2570
2571Tools and Demos
2572---------------
2573
2574- New script nm2def.py by Marc-Andre Lemburg, to construct
2575PC/python_nt.def automatically (some hand editing still required).
2576
2577- New tool ndiff.py: Tim Peters' text diffing tool.
2578
2579- Various and sundry improvements to the freeze script.
2580
2581- The script texi2html.py (which was part of the Doc tree but is no
2582longer used there) has been moved to the Tools/scripts subdirectory.
2583
2584- Some generalizations in the webchecker code. There's now a
2585primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
2586
2587- The ftpmirror.py script now handles symbolic links properly, and
2588also files with multiple spaces in their names.
2589
2590- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
2591last line is both indented and lacks a newline. This is now fixed.
2592
2593Python/C API
2594------------
2595
2596- Added missing prototypes for PyEval_CallFunction() and
2597PyEval_CallMethod().
2598
2599- New macro PyList_SET_ITEM().
2600
2601- New macros to access object members for PyFunction, PyCFunction
2602objects.
2603
2604- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
2605dynamically add one or many entries to the table of built-in modules.
2606
2607- New macro Py_InitModule3(name, methods, doc) which calls
2608Py_InitModule4() with appropriate arguments. (The -4 variant requires
2609you to pass an obscure version number constant which is always the same.)
2610
2611- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
2612sys.stdout or sys.stderr using a printf-like interface. (Used in
2613_tkinter.c, for example.)
2614
2615- New APIs for conversion between Python longs and C 'long long' if
2616your compiler supports it.
2617
2618- PySequence_In() is now called PySequence_Contains().
2619(PySequence_In() is still supported for b/w compatibility; it is
2620declared obsolete because its argument order is confusing.)
2621
2622- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
2623*never* raise an exception -- (even if the hash() fails, simply clear
2624the error). This was necessary because there is lots of code out
2625there that already assumes this.
2626
2627- Changes to PySequence_Tuple() and PySequence_List() to use the
2628length of a sequence only as a hint -- if an IndexError happens
2629earlier, take that. (Formerly, this was considered an error.)
2630
2631- Reformatted abstract.c to give it a more familiar "look" and fixed
2632many error checking bugs.
2633
2634- Add NULL pointer checks to all calls of a C function through a type
2635object and extensions (e.g. nb_add).
2636
2637- The code that initializes sys.path now calls Py_GetPythonHome()
2638instead of getenv("PYTHONHOME"). This, together with the new API
2639Py_SetPythonHome(), makes it easier for embedding applications to
2640change the notion of Python's "home" directory (where the libraries
2641etc. are sought).
2642
2643- Fixed a very old bug in the parsing of "O?" format specifiers.
2644
2645
2646======================================================================
2647
2648
Guido van Rossum439d1fa1998-12-21 21:41:14 +00002649From 1.5 to 1.5.1
2650=================
2651
2652General
2653-------
2654
2655- The documentation is now unbundled. It has also been extensively
2656modified (mostly to implement a new and more uniform formatting
2657style). We figure that most people will prefer to download one of the
2658preformatted documentation sets (HTML, PostScript or PDF) and that
2659only a minority have a need for the LaTeX or FrameMaker sources. Of
2660course, the unbundled documentation sources still released -- just not
2661in the same archive file, and perhaps not on the same date.
2662
2663- All bugs noted on the errors page (and many unnoted) are fixed. All
2664new bugs take their places.
2665
2666- No longer a core dump when attempting to print (or repr(), or str())
2667a list or dictionary that contains an instance of itself; instead, the
2668recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
2669Py_ReprLeave() below. Comparisons of such objects still go beserk,
2670since this requires a different kind of fix; fortunately, this is a
2671less common scenario in practice.
2672
2673Syntax change
2674-------------
2675
2676- The raise statement can now be used without arguments, to re-raise
2677a previously set exception. This should be used after catching an
2678exception with an except clause only, either in the except clause or
2679later in the same function.
2680
2681Import and module handling
2682--------------------------
2683
2684- The implementation of import has changed to use a mutex (when
2685threading is supported). This means that when two threads
2686simultaneously import the same module, the import statements are
2687serialized. Recursive imports are not affected.
2688
2689- Rewrote the finalization code almost completely, to be much more
2690careful with the order in which modules are destroyed. Destructors
2691will now generally be able to reference built-in names such as None
2692without trouble.
2693
2694- Case-insensitive platforms such as Mac and Windows require the case
2695of a module's filename to match the case of the module name as
2696specified in the import statement (see below).
2697
2698- The code for figuring out the default path now distinguishes between
2699files, modules, executable files, and directories. When expecting a
2700module, we also look for the .pyc or .pyo file.
2701
2702Parser/tokenizer changes
2703------------------------
2704
2705- The tokenizer can now warn you when your source code mixes tabs and
2706spaces for indentation in a manner that depends on how much a tab is
2707worth in spaces. Use "python -t" or "python -v" to enable this
2708option. Use "python -tt" to turn the warnings into errors. (See also
2709tabnanny.py and tabpolice.py below.)
2710
2711- Return unsigned characters from tok_nextc(), so '\377' isn't
2712mistaken for an EOF character.
2713
2714- Fixed two pernicious bugs in the tokenizer that only affected AIX.
2715One was actually a general bug that was triggered by AIX's smaller I/O
2716buffer size. The other was a bug in the AIX optimizer's loop
2717unrolling code; swapping two statements made the problem go away.
2718
2719Tools, demos and miscellaneous files
2720------------------------------------
2721
2722- There's a new version of Misc/python-mode.el (the Emacs mode for
2723Python) which is much smarter about guessing the indentation style
2724used in a particular file. Lots of other cool features too!
2725
2726- There are two new tools in Tools/scripts: tabnanny.py and
2727tabpolice.py, implementing two different ways of checking whether a
2728file uses indentation in a way that is sensitive to the interpretation
2729of a tab. The preferred module is tabnanny.py (by Tim Peters).
2730
2731- Some new demo programs:
2732
2733 Demo/tkinter/guido/paint.py -- Dave Mitchell
2734 Demo/sockets/unixserver.py -- Piet van Oostrum
2735
2736
2737- Much better freeze support. The freeze script can now freeze
2738hierarchical module names (with a corresponding change to import.c),
2739and has a few extra options (e.g. to suppress freezing specific
2740modules). It also does much more on Windows NT.
2741
2742- Version 1.0 of the faq wizard is included (only very small changes
2743since version 0.9.0).
2744
2745- New feature for the ftpmirror script: when removing local files
2746(i.e., only when -r is used), do a recursive delete.
2747
2748Configuring and building Python
2749-------------------------------
2750
2751- Get rid of the check for -linet -- recent Sequent Dynix systems don't
2752need this any more and apparently it screws up their configuration.
2753
2754- Some changes because gcc on SGI doesn't support '-all'.
2755
2756- Changed the build rules to use $(LIBRARY) instead of
2757 -L.. -lpython$(VERSION)
2758since the latter trips up the SunOS 4.1.x linker (sigh).
2759
2760- Fix the bug where the '# dgux is broken' comment in the Makefile
2761tripped over Make on some platforms.
2762
2763- Changes for AIX: install the python.exp file; properly use
2764$(srcdir); the makexp_aix script now removes C++ entries of the form
2765Class::method.
2766
2767- Deleted some Makefile targets only used by the (long obsolete)
2768gMakefile hacks.
2769
2770Extension modules
2771-----------------
2772
2773- Performance and threading improvements to the socket and bsddb
2774modules, by Christopher Lindblad of Infoseek.
2775
2776- Added operator.__not__ and operator.not_.
2777
2778- In the thread module, when a thread exits due to an unhandled
2779exception, don't store the exception information in sys.last_*; it
2780prevents proper calling of destructors of local variables.
2781
2782- Fixed a number of small bugs in the cPickle module.
2783
2784- Changed find() and rfind() in the strop module so that
2785find("x","",2) returns -1, matching the implementation in string.py.
2786
2787- In the time module, be more careful with the result of ctime(), and
2788test for HAVE_MKTIME before usinmg mktime().
2789
2790- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
2791modules.
2792
2793- Added the LOG_SYSLOG constant to the syslog module, if defined.
2794
2795Standard library modules
2796------------------------
2797
2798- All standard library modules have been converted to an indentation
2799style using either only tabs or only spaces -- never a mixture -- if
2800they weren't already consistent according to tabnanny. This means
2801that the new -t option (see above) won't complain about standard
2802library modules.
2803
2804- New standard library modules:
2805
2806 threading -- GvR and the thread-sig
2807 Java style thread objects -- USE THIS!!!
2808
2809 getpass -- Piers Lauder
2810 simple utilities to prompt for a password and to
2811 retrieve the current username
2812
2813 imaplib -- Piers Lauder
2814 interface for the IMAP4 protocol
2815
2816 poplib -- David Ascher, Piers Lauder
2817 interface for the POP3 protocol
2818
2819 smtplib -- Dragon De Monsyne
2820 interface for the SMTP protocol
2821
2822- Some obsolete modules moved to a separate directory (Lib/lib-old)
2823which is *not* in the default module search path:
2824
2825 Para
2826 addpack
2827 codehack
2828 fmt
2829 lockfile
2830 newdir
2831 ni
2832 rand
2833 tb
2834
2835- New version of the PCRE code (Perl Compatible Regular Expressions --
2836the re module and the supporting pcre extension) by Andrew Kuchling.
2837Incompatible new feature in re.sub(): the handling of escapes in the
2838replacement string has changed.
2839
2840- Interface change in the copy module: a __deepcopy__ method is now
2841called with the memo dictionary as an argument.
2842
2843- Feature change in the tokenize module: differentiate between NEWLINE
2844token (an official newline) and NL token (a newline that the grammar
2845ignores).
2846
2847- Several bugfixes to the urllib module. It is now truly thread-safe,
2848and several bugs and a portability problem have been fixed. New
2849features, all due to Sjoerd Mullender: When creating a temporary file,
2850it gives it an appropriate suffix. Support the "data:" URL scheme.
2851The open() method uses the tempcache.
2852
2853- New version of the xmllib module (this time with a test suite!) by
2854Sjoerd Mullender.
2855
2856- Added debugging code to the telnetlib module, to be able to trace
2857the actual traffic.
2858
2859- In the rfc822 module, added support for deleting a header (still no
2860support for adding headers, though). Also fixed a bug where an
2861illegal address would cause a crash in getrouteaddr(), fixed a
2862sign reversal in mktime_tz(), and use the local timezone by default
2863(the latter two due to Bill van Melle).
2864
2865- The normpath() function in the dospath and ntpath modules no longer
2866does case normalization -- for that, use the separate function
2867normcase() (which always existed); normcase() has been sped up and
2868fixed (it was the cause of a crash in Mark Hammond's installer in
2869certain locales).
2870
2871- New command supported by the ftplib module: rmd(); also fixed some
2872minor bugs.
2873
2874- The profile module now uses a different timer function by default --
2875time.clock() is generally better than os.times(). This makes it work
2876better on Windows NT, too.
2877
2878- The tempfile module now recovers when os.getcwd() raises an
2879exception.
2880
2881- Fixed some bugs in the random module; gauss() was subtly wrong, and
2882vonmisesvariate() should return a full circle. Courtesy Mike Miller,
2883Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
2884
2885- Better default seed in the whrandom module, courtesy Andrew Kuchling.
2886
2887- Fix slow close() in shelve module.
2888
2889- The Unix mailbox class in the mailbox module is now more robust when
2890a line begins with the string "From " but is definitely not the start
2891of a new message. The pattern used can be changed by overriding a
2892method or class variable.
2893
2894- Added a rmtree() function to the copy module.
2895
2896- Fixed several typos in the pickle module. Also fixed problems when
2897unpickling in restricted execution environments.
2898
2899- Added docstrings and fixed a typo in the py_compile and compileall
2900modules. At Mark Hammond's repeated request, py_compile now append a
2901newline to the source if it needs one. Both modules support an extra
2902parameter to specify the purported source filename (to be used in
2903error messages).
2904
2905- Some performance tweaks by Jeremy Hylton to the gzip module.
2906
2907- Fixed a bug in the merge order of dictionaries in the ConfigParser
2908module. Courtesy Barry Warsaw.
2909
2910- In the multifile module, support the optional second parameter to
2911seek() when possible.
2912
2913- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
2914urlparse now correctly handles Gopher URLs with query strings.
2915
2916- Fixed a tiny bug in format_exception() in the traceback module.
2917Also rewrite tb_lineno() to be compatible with JPython (and not
2918disturb the current exception!); by Jim Hugunin.
2919
2920- The httplib module is more robust when servers send a short response
2921-- courtesy Tim O'Malley.
2922
2923Tkinter and friends
2924-------------------
2925
2926- Various typos and bugs fixed.
2927
2928- New module Tkdnd implements a drag-and-drop protocol (within one
2929application only).
2930
2931- The event_*() widget methods have been restructured slightly -- they
2932no longer use the default root.
2933
2934- The interfaces for the bind*() and unbind() widget methods have been
2935redesigned; the bind*() methods now return the name of the Tcl command
2936created for the callback, and this can be passed as a optional
2937argument to unbind() in order to delete the command (normally, such
2938commands are automatically unbound when the widget is destroyed, but
2939for some applications this isn't enough).
2940
2941- Variable objects now have trace methods to interface to Tcl's
2942variable tracing facilities.
2943
2944- Image objects now have an optional keyword argument, 'master', to
2945specify a widget (tree) to which they belong. The image_names() and
2946image_types() calls are now also widget methods.
2947
2948- There's a new global call, Tkinter.NoDefaultRoot(), which disables
2949all use of the default root by the Tkinter library. This is useful to
2950debug applications that are in the process of being converted from
2951relying on the default root to explicit specification of the root
2952widget.
2953
2954- The 'exit' command is deleted from the Tcl interpreter, since it
2955provided a loophole by which one could (accidentally) exit the Python
2956interpreter without invoking any cleanup code.
2957
2958- Tcl_Finalize() is now registered as a Python low-level exit handle,
2959so Tcl will be finalized when Python exits.
2960
2961The Python/C API
2962----------------
2963
2964- New function PyThreadState_GetDict() returns a per-thread dictionary
2965intended for storing thread-local global variables.
2966
2967- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
2968dictionary to allow recursive container types to detect recursion in
2969their repr(), str() and print implementations.
2970
2971- New function PyObject_Not(x) calculates (not x) according to Python's
2972standard rules (basically, it negates the outcome PyObject_IsTrue(x).
2973
2974- New function _PyModule_Clear(), which clears a module's dictionary
2975carefully without removing the __builtins__ entry. This is implied
2976when a module object is deallocated (this used to clear the dictionary
2977completely).
2978
2979- New function PyImport_ExecCodeModuleEx(), which extends
2980PyImport_ExecCodeModule() by adding an extra parameter to pass it the
2981true file.
2982
2983- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
2984allow embedded applications to force a different value for PYTHONHOME.
2985
2986- New global flag Py_FrozenFlag is set when this is a "frozen" Python
2987binary; it suppresses warnings about not being able to find the
2988standard library directories.
2989
2990- New global flag Py_TabcheckFlag is incremented by the -t option and
2991causes the tokenizer to issue warnings or errors about inconsistent
2992mixing of tabs and spaces for indentation.
2993
2994Miscellaneous minor changes and bug fixes
2995-----------------------------------------
2996
2997- Improved the error message when an attribute of an attribute-less
2998object is requested -- include the name of the attribute and the type
2999of the object in the message.
3000
3001- Sped up int(), long(), float() a bit.
3002
3003- Fixed a bug in list.sort() that would occasionally dump core.
3004
3005- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
3006when taken tothe real power.
3007
3008- Fixed a number of bugs in the file reading code, at least one of
3009which could cause a core dump on NT, and one of which would
3010occasionally cause file.read() to return less than the full contents
3011of the file.
3012
3013- Performance hack by Vladimir Marangozov for stack frame creation.
3014
3015- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
3016
3017Windows 95/NT
3018-------------
3019
3020- The .lib files are now part of the distribution; they are collected
3021in the subdirectory "libs" of the installation directory.
3022
3023- The extension modules (.pyd files) are now collected in a separate
3024subdirectory of the installation directory named "DLLs".
3025
3026- The case of a module's filename must now match the case of the
3027module name as specified in the import statement. This is an
3028experimental feature -- if it turns out to break in too many
3029situations, it will be removed (or disabled by default) in the future.
3030It can be disabled on a per-case basis by setting the environment
3031variable PYTHONCASEOK (to any value).
3032
3033
3034======================================================================
3035
3036
3037From 1.5b2 to 1.5
3038=================
3039
3040- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
3041
3042- Added doc strings to string.py, stropmodule.c, structmodule.c,
3043thanks to Charles Waldman.
3044
3045- Many nits fixed in the manuals, thanks to Fred Drake and many others
3046(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
3047HTML markup instead of inline GIF images for tables; only two images
3048are left (for obsure bits of math). The index of the HTML version has
3049also been much improved. Finally, it is once again possible to
3050generate an Emacs info file from the library manual (but I don't
3051commit to supporting this in future versions).
3052
3053- New module: telnetlib.py (a simple telnet client library).
3054
3055- New tool: Tools/versioncheck/, by Jack Jansen.
3056
3057- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
3058DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
3059extension modules.
3060
3061- Many small changes again to Tkinter.py -- mostly bugfixes and adding
3062missing routines. Thanks to Greg McFarlane for reporting a bunch of
3063problems and proofreading my fixes.
3064
3065- The re module and its documentation are up to date with the latest
3066version released to the string-sig (Dec. 22).
3067
3068- Stop test_grp.py from failing when the /etc/group file is empty
3069(yes, this happens!).
3070
3071- Fix bug in integer conversion (mystrtoul.c) that caused
30724294967296==0 to be true!
3073
3074- The VC++ 4.2 project file should be complete again.
3075
3076- In tempfile.py, use a better template on NT, and add a new optional
3077argument "suffix" with default "" to specify a specific extension for
3078the temporary filename (needed sometimes on NT but perhaps also handy
3079elsewhere).
3080
3081- Fixed some bugs in the FAQ wizard, and converted it to use re
3082instead of regex.
3083
3084- Fixed a mysteriously undetected error in dlmodule.c (it was using a
3085totally bogus routine name to raise an exception).
3086
3087- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
3088
3089- Hopefully harmless changes to the build process to support shared
3090libraries on DG/UX. This adds a target to create
3091libpython$(VERSION).so; however this target is *only* for DG/UX.
3092
3093- Fixed a bug in the new format string error checking in getargs.c.
3094
3095- A simple fix for infinite recursion when printing __builtins__:
3096reset '_' to None before printing and set it to the printed variable
3097*after* printing (and only when printing is successful).
3098
3099- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
3100parent window is not (Skip Montanaro).
3101
3102- Fixed the two most annoying problems with ftp URLs in
3103urllib.urlopen(); an empty file now correctly raises an error, and it
3104is no longer required to explicitly close the returned "file" object
3105before opening another ftp URL to the same host and directory.
3106
3107
3108======================================================================
3109
3110
3111From 1.5b1 to 1.5b2
3112===================
3113
3114- Fixed a bug in cPickle.c that caused it to crash right away because
3115the version string had a different format.
3116
3117- Changes in pickle.py and cPickle.c: when unpickling an instance of a
3118class that doesn't define the __getinitargs__() method, the __init__()
3119constructor is no longer called. This makes a much larger group of
3120classes picklable by default, but may occasionally change semantics.
3121To force calling __init__() on unpickling, define a __getinitargs__()
3122method. Other changes too, in particular cPickle now handles classes
3123defined in packages correctly. The same change applies to copying
3124instances with copy.py. The cPickle.c changes and some pickle.py
3125changes are courtesy Jim Fulton.
3126
3127- Locale support in he "re" (Perl regular expressions) module. Use
3128the flag re.L (or re.LOCALE) to enable locale-specific matching
3129rules for \w and \b. The in-line syntax for this flag is (?L).
3130
3131- The built-in function isinstance(x, y) now also succeeds when y is
3132a type object and type(x) is y.
3133
3134- repr() and str() of class and instance objects now reflect the
3135package/module in which the class is defined.
3136
3137- Module "ni" has been removed. (If you really need it, it's been
3138renamed to "ni1". Let me know if this causes any problems for you.
3139Package authors are encouraged to write __init__.py files that
3140support both ni and 1.5 package support, so the same version can be
3141used with Python 1.4 as well as 1.5.)
3142
3143- The thread module is now automatically included when threads are
3144configured. (You must remove it from your existing Setup file,
3145since it is now in its own Setup.thread file.)
3146
3147- New command line option "-x" to skip the first line of the script;
3148handy to make executable scripts on non-Unix platforms.
3149
3150- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
3151haven't checked how this affects things, but it should make symbols
3152in one shared library available to the next one.
3153
3154- The Windows installer now installs in the "Program Files" folder on
3155the proper volume by default.
3156
3157- The Windows configuration adds a new main program, "pythonw", and
3158registers a new extension, ".pyw" that invokes this. This is a
3159pstandard Python interpreter that does not pop up a console window;
3160handy for pure Tkinter applications. All output to the original
3161stdout and stderr is lost; reading from the original stdin yields
3162EOF. Also, both python.exe and pythonw.exe now have a pretty icon
3163(a green snake in a box, courtesy Mark Hammond).
3164
3165- Lots of improvements to emacs-mode.el again. See Barry's web page:
3166http://www.python.org/ftp/emacs/pmdetails.html.
3167
3168- Lots of improvements and additions to the library reference manual;
3169many by Fred Drake.
3170
3171- Doc strings for the following modules: rfc822.py, posixpath.py,
3172ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
3173
3174- Some more regression testing.
3175
3176- An optional 4th (maxsplit) argument to strop.replace().
3177
3178- Fixed handling of maxsplit in string.splitfields().
3179
3180- Tweaked os.environ so it can be pickled and copied.
3181
3182- The portability problems caused by indented preprocessor commands
3183and C++ style comments should be gone now.
3184
3185- In random.py, added Pareto and Weibull distributions.
3186
3187- The crypt module is now disabled in Modules/Setup.in by default; it
3188is rarely needed and causes errors on some systems where users often
3189don't know how to deal with those.
3190
3191- Some improvements to the _tkinter build line suggested by Case Roole.
3192
3193- A full suite of platform specific files for NetBSD 1.x, submitted by
3194Anders Andersen.
3195
3196- New Solaris specific header STROPTS.py.
3197
3198- Moved a confusing occurrence of *shared* from the comments in
3199Modules/Setup.in (people would enable this one instead of the real
3200one, and get disappointing results).
3201
3202- Changed the default mode for directories to be group-writable when
3203the installation process creates them.
3204
3205- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
3206shared libraries for both.
3207
3208- Support FreeBSD and NetBSD in posixfile.py.
3209
3210- Support for the "event" command, new in Tk 4.2. By Case Roole.
3211
3212- Add Tix_SafeInit() support to tkappinit.c.
3213
3214- Various bugs fixed in "re.py" and "pcre.c".
3215
3216- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
3217
3218- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
3219is set.
3220
3221- Provide default blocksize for retrbinary in ftplib.py (Skip
3222Montanaro).
3223
3224- In NT, pick the username up from different places in user.py (Jeff
3225Bauer).
3226
3227- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
3228
3229- Many small improvements to Jeff Rush' OS/2 support.
3230
3231- ospath.py is gone; it's been obsolete for so many years now...
3232
3233- The reference manual is now set up to prepare better HTML (still
3234using webmaker, alas).
3235
3236- Add special handling to /Tools/freeze for Python modules that are
3237imported implicitly by the Python runtime: 'site' and 'exceptions'.
3238
3239- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
3240inside <PRE>, by "Scott".
3241
3242- Added ConfigParser.py, a generic parser for sectioned configuration
3243files.
3244
3245- In _localemodule.c, LC_MESSAGES is not always defined; put it
3246between #ifdefs.
3247
3248- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
3249
3250- Demo/scripts/newslist.py: Fix the way the version number is gotten
3251out of the RCS revision.
3252
3253- PyArg_Parse[Tuple] now explicitly check for bad characters at the
3254end of the format string.
3255
3256- Revamped PC/example_nt to support VC++ 5.x.
3257
3258- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
3259after studying the GNU libg++ quicksort. This should be much faster
3260if there are lots of duplicates, and otherwise at least as good.
3261
3262- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
3263uudecode bug where it complaints about trailing garbage is still there
3264:-( ).
3265
3266- pickle.py requires integers in text mode to be in decimal notation
3267(it used to accept octal and hex, even though it would only generate
3268decimal numbers).
3269
3270- In string.atof(), don't fail when the "re" module is unavailable.
3271Plug the ensueing security leak by supplying an empty __builtins__
3272directory to eval().
3273
3274- A bunch of small fixes and improvements to Tkinter.py.
3275
3276- Fixed a buffer overrun in PC/getpathp.c.
3277
3278
3279======================================================================
3280
3281
3282From 1.5a4 to 1.5b1
3283===================
3284
3285- The Windows NT/95 installer now includes full HTML of all manuals.
3286It also has a checkbox that lets you decide whether to install the
3287interpreter and library. The WISE installer script for the installer
3288is included in the source tree as PC/python15.wse, and so are the
3289icons used for Python files. The config.c file for the Windows build
3290is now complete with the pcre module.
3291
3292- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
3293evaluated for the prompt.
3294
3295- The reference manual is brought up to date (more or less -- it still
3296needs work, e.g. in the area of package import).
3297
3298- The icons used by latex2html are now included in the Doc
3299subdirectory (mostly so that tarring up the HTML files can be fully
3300automated). A simple index.html is also added to Doc (it only works
3301after you have successfully run latex2html).
3302
3303- For all you would-be proselytizers out there: a new version of
3304Misc/BLURB describes Python more concisely, and Misc/comparisons
3305compares Python to several other languages. Misc/BLURB.WINDOWS
3306contains a blurb specifically aimed at Windows programmers (by Mark
3307Hammond).
3308
3309- A new version of the Python mode for Emacs is included as
3310Misc/python-mode.el. There are too many new features to list here.
3311See http://www.python.org/ftp/emacs/pmdetails.html for more info.
3312
3313- New module fileinput makes iterating over the lines of a list of
3314files easier. (This still needs some more thinking to make it more
3315extensible.)
3316
3317- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
3318version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
3319Age C++ compiler. I expect that Jeff will also provide a binary
3320release for this platform.
3321
3322- On Linux, the configure script now uses '-Xlinker -export-dynamic'
3323instead of '-rdynamic' to link the main program so that it exports its
3324symbols to shared libraries it loads dynamically. I hope this doesn't
3325break on older Linux versions; it is needed for mklinux and appears to
3326work on Linux 2.0.30.
3327
3328- Some Tkinter resstructuring: the geometry methods that apply to a
3329master are now properly usable on toplevel master widgets. There's a
3330new (internal) widget class, BaseWidget. New, longer "official" names
3331for the geometry manager methods have been added,
3332e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
3333shorter names still work, and where there's ambiguity, pack wins over
3334place wins over grid. Also, the bind_class method now returns its
3335value.
3336
3337- New, RFC-822 conformant parsing of email addresses and address lists
3338in the rfc822 module, courtesy Ben Escoto.
3339
3340- New, revamped tkappinit.c with support for popular packages (PIL,
3341TIX, BLT, TOGL). For the last three, you need to execute the Tcl
3342command "load {} Tix" (or Blt, or Togl) to gain access to them.
3343The Modules/Setup line for the _tkinter module has been rewritten
3344using the cool line-breaking feature of most Bourne shells.
3345
3346- New socket method connect_ex() returns the error code from connect()
3347instead of raising an exception on errors; this makes the logic
3348required for asynchronous connects simpler and more efficient.
3349
3350- New "locale" module with (still experimental) interface to the
3351standard C library locale interface, courtesy Martin von Loewis. This
3352does not repeat my mistake in 1.5a4 of always calling
3353setlocale(LC_ALL, ""). In fact, we've pretty much decided that
3354Python's standard numerical formatting operations should always use
3355the conventions for the C locale; the locale module contains utility
3356functions to format numbers according to the user specified locale.
3357(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
3358"C") after locale-changing calls.) See the library manual. (Alas, the
3359promised changes to the "re" module for locale support have not been
3360materialized yet. If you care, volunteer!)
3361
3362- Memory leak plugged in Py_BuildValue when building a dictionary.
3363
3364- Shared modules can now live inside packages (hierarchical module
3365namespaces). No changes to the shared module itself are needed.
3366
3367- Improved policy for __builtins__: this is a module in __main__ and a
3368dictionary everywhere else.
3369
3370- Python no longer catches SIGHUP and SIGTERM by default. This was
3371impossible to get right in the light of thread contexts. If you want
3372your program to clean up when a signal happens, use the signal module
3373to set up your own signal handler.
3374
3375- New Python/C API PyNumber_CoerceEx() does not return an exception
3376when no coercion is possible. This is used to fix a problem where
3377comparing incompatible numbers for equality would raise an exception
3378rather than return false as in Python 1.4 -- it once again will return
3379false.
3380
3381- The errno module is changed again -- the table of error messages
3382(errorstr) is removed. Instead, you can use os.strerror(). This
3383removes redundance and a potential locale dependency.
3384
3385- New module xmllib, to parse XML files. By Sjoerd Mullender.
3386
3387- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
3388It resets the signal module's notion of what the current process ID
3389and thread are, so that signal handlers will work after (and across)
3390calls to os.fork().
3391
3392- Fixed most occurrences of fatal errors due to missing thread state.
3393
3394- For vgrind (a flexible source pretty printer) fans, there's a simple
3395Python definition in Misc/vgrindefs, courtesy Neale Pickett.
3396
3397- Fixed memory leak in exec statement.
3398
3399- The test.pystone module has a new function, pystones(loops=LOOPS),
3400which returns a (benchtime, stones) tuple. The main() function now
3401calls this and prints the report.
3402
3403- Package directories now *require* the presence of an __init__.py (or
3404__init__.pyc) file before they are considered as packages. This is
3405done to prevent accidental subdirectories with common names from
3406overriding modules with the same name.
3407
3408- Fixed some strange exceptions in __del__ methods in library modules
3409(e.g. urllib). This happens because the builtin names are already
3410deleted by the time __del__ is called. The solution (a hack, but it
3411works) is to set some instance variables to 0 instead of None.
3412
3413- The table of built-in module initializers is replaced by a pointer
3414variable. This makes it possible to switch to a different table at
3415run time, e.g. when a collection of modules is loaded from a shared
3416library. (No example code of how to do this is given, but it is
3417possible.) The table is still there of course, its name prefixed with
3418an underscore and used to initialize the pointer.
3419
3420- The warning about a thread still having a frame now only happens in
3421verbose mode.
3422
3423- Change the signal finialization so that it also resets the signal
3424handlers. After this has been called, our signal handlers are no
3425longer active!
3426
3427- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
3428literals. There's now also a test fort this module.
3429
3430- The copy module now also uses __dict__.update(state) instead of
3431going through individual attribute assignments, for class instances
3432without a __setstate__ method.
3433
3434- New module reconvert translates old-style (regex module) regular
3435expressions to new-style (re module, Perl-style) regular expressions.
3436
3437- Most modules that used to use the regex module now use the re
3438module. The grep module has a new pgrep() function which uses
3439Perl-style regular expressions.
3440
3441- The (very old, backwards compatibility) regexp.py module has been
3442deleted.
3443
3444- Restricted execution (rexec): added the pcre module (support for the
3445re module) to the list of trusted extension modules.
3446
3447- New version of Jim Fulton's CObject object type, adds
3448PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
3449
3450- Some patches to Lee Busby's fpectl mods that accidentally didn't
3451make it into 1.5a4.
3452
3453- In the string module, add an optional 4th argument to count(),
3454matching find() etc.
3455
3456- Patch for the nntplib module by Charles Waldman to add optional user
3457and password arguments to NNTP.__init__(), for nntp servers that need
3458them.
3459
3460- The str() function for class objects now returns
3461"modulename.classname" instead of returning the same as repr().
3462
3463- The parsing of \xXX escapes no longer relies on sscanf().
3464
3465- The "sharedmodules" subdirectory of the installation is renamed to
3466"lib-dynload". (You may have to edit your Modules/Setup file to fix
3467this in an existing installation!)
3468
3469- Fixed Don Beaudry's mess-up with the OPT test in the configure
3470script. Certain SGI platforms will still issue a warning for each
3471compile; there's not much I can do about this since the compiler's
3472exit status doesn't indicate that I was using an obsolete option.
3473
3474- Fixed Barry's mess-up with {}.get(), and added test cases for it.
3475
3476- Shared libraries didn't quite work under AIX because of the change
3477in status of the GNU readline interface. Fix due to by Vladimir
3478Marangozov.
3479
3480
3481======================================================================
3482
3483
3484From 1.5a3 to 1.5a4
3485===================
3486
3487- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
3488feature; better install instructions; removed faqmain.py (which was an
3489older version).
3490
3491- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
3492about the treatment of lines starting with '.'. Added a minimal test
3493function.
3494
3495- struct module: ignore most whitespace in format strings.
3496
3497- urllib.py: close the socket and temp file in URLopener.retrieve() so
3498that multiple retrievals using the same connection work.
3499
3500- All standard exceptions are now classes by default; use -X to make
3501them strings (for backward compatibility only).
3502
3503- There's a new standard exception hierarchy, defined in the standard
3504library module exceptions.py (which you never need to import
3505explicitly). See
3506http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
3507more info.
3508
3509- Three new C API functions:
3510
3511 - int PyErr_GivenExceptionMatches(obj1, obj2)
3512
3513 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
3514 instance of type obj2, or of a class derived from obj2
3515
3516 - int PyErr_ExceptionMatches(obj)
3517
3518 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
3519 PyErr_Occurred() as obj1. This will be the more commonly called
3520 function.
3521
3522 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
3523
3524 Normalizes exceptions, and places the normalized values in the
3525 arguments. If type is not a class, this does nothing. If type is a
3526 class, then it makes sure that value is an instance of the class by:
3527
3528 1. if instance is of the type, or a class derived from type, it does
3529 nothing.
3530
3531 2. otherwise it instantiates the class, using the value as an
3532 argument. If value is None, it uses an empty arg tuple, and if
3533 the value is a tuple, it uses just that.
3534
3535- Another new C API function: PyErr_NewException() creates a new
3536exception class derived from Exception; when -X is given, it creates a
3537new string exception.
3538
3539- core interpreter: remove the distinction between tuple and list
3540unpacking; allow an arbitrary sequence on the right hand side of any
3541unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
3542thing, which should really be called UNPACK_SEQUENCE.)
3543
3544- classes: Allow assignments to an instance's __dict__ or __class__,
3545so you can change ivars (including shared ivars -- shock horror) and
3546change classes dynamically. Also make the check on read-only
3547attributes of classes less draconic -- only the specials names
3548__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
3549assigned.
3550
3551- Two new built-in functions: issubclass() and isinstance(). Both
3552take classes as their second arguments. The former takes a class as
3553the first argument and returns true iff first is second, or is a
3554subclass of second. The latter takes any object as the first argument
3555and returns true iff first is an instance of the second, or any
3556subclass of second.
3557
3558- configure: Added configuration tests for presence of alarm(),
3559pause(), and getpwent().
3560
3561- Doc/Makefile: changed latex2html targets.
3562
3563- classes: Reverse the search order for the Don Beaudry hook so that
3564the first class with an applicable hook wins. Makes more sense.
3565
3566- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
3567now legal to call these more than once. The first call to
3568Py_Initialize() initializes, the first call to Py_Finalize()
3569finalizes. There's also a new API, Py_IsInitalized() which checks
3570whether we are already initialized (in case you want to leave things
3571as they were).
3572
3573- Completely disable the declarations for malloc(), realloc() and
3574free(). Any 90's C compiler has these in header files, and the tests
3575to decide whether to suppress the declarations kept failing on some
3576platforms.
3577
3578- *Before* (instead of after) signalmodule.o is added, remove both
3579intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
3580ld on various systems.
3581
3582- Added reop to PC/config.c
3583
3584- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
3585Removed outdated HP-UX comments from README. Added Cray T3E comments.
3586
3587- Various renames of statically defined functions that had name
3588conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
3589roundup (sys/types.h).
3590
3591- urllib.py: Interpret three slashes in file: URL as local file (for
3592Netscape on Windows/Mac).
3593
3594- copy.py: Make sure the objects returned by __getinitargs__() are
3595kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
3596easily reproducable because it requires a later call to
3597__getinitargs__() to return a tuple that happens to be allocated at
3598the same address.)
3599
3600- Added definition of AR to toplevel Makefile. Renamed @buildno temp
3601file to buildno1.
3602
3603- Moved Include/assert.h to Parser/assert.h, which seems to be the
3604only place where it's needed.
3605
3606- Tweaked the dictionary lookup code again for some more speed
3607(Vladimir Marangozov).
3608
3609- NT build: Changed the way python15.lib is included in the other
3610projects. Per Mark Hammond's suggestion, add it to the extra libs in
3611Settings instead of to the project's source files.
3612
3613- regrtest.py: Change default verbosity so that there are only three
3614levels left: -q, default and -v. In default mode, the name of each
3615test is now printed. -v is the same as the old -vv. -q is more quiet
3616than the old default mode.
3617
3618- Removed the old FAQ from the distribution. You now have to get it
3619from the web!
3620
3621- Removed the PC/make_nt.in file from the distribution; it is no
3622longer needed.
3623
3624- Changed the build sequence so that shared modules are built last.
3625This fixes things for AIX and doesn't hurt elsewhere.
3626
3627- Improved test for GNU MP v1 in mpzmodule.c
3628
3629- fileobject.c: ftell() on Linux discards all buffered data; changed
3630read() code to use lseek() instead to get the same effect
3631
3632- configure.in, configure, importdl.c: NeXT sharedlib fixes
3633
3634- tupleobject.c: PyTuple_SetItem asserts refcnt==1
3635
3636- resource.c: Different strategy regarding whether to declare
3637getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
3638conflicting decls in its headers. Choice: only declare the return
3639type, not the argument prototype, and not on Linux.
3640
3641- importdl.c, configure*: set sharedlib extensions properly for NeXT
3642
3643- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
3644fixed; moved addition of PURIFY to LINKCC to configure
3645
3646- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
3647added to shup up various compilers.
3648
3649- _tkinter.c: removed buggy mac #ifndef
3650
3651- Doc: various Mac documentation changes, added docs for 'ic' module
3652
3653- PC/make_nt.in: deleted
3654
3655- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
3656"")
3657
3658- test_rotor.py: print b -> print `b`
3659
3660- Tkinter.py: (tagOrId) -> (tagOrId,)
3661
3662- Tkinter.py: the Tk class now also has a configure() method and
3663friends (they have been moved to the Misc class to accomplish this).
3664
3665- dict.get(key[, default]) returns dict[key] if it exists, or default
3666if it doesn't. The default defaults to None. This is quicker for
3667some applications than using either has_key() or try:...except
3668KeyError:....
3669
3670- Tools/webchecker/: some small changes to webchecker.py; added
3671websucker.py (a simple web site mirroring script).
3672
3673- Dictionary objects now have a get() method (also in UserDict.py).
3674dict.get(key, default) returns dict[key] if it exists and default
3675otherwise; default defaults to None.
3676
3677- Tools/scripts/logmerge.py: print the author, too.
3678
3679- Changes to import: support for "import a.b.c" is now built in. See
3680http://grail.cnri.reston.va.us/python/essays/packages.html
3681for more info. Most important deviations from "ni.py": __init__.py is
3682executed in the package's namespace instead of as a submodule; and
3683there's no support for "__" or "__domain__". Note that "ni.py" is not
3684changed to match this -- it is simply declared obsolete (while at the
3685same time, it is documented...:-( ).
3686Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
3687for an example implementation of hierarchical module import written in
3688Python).
3689
3690- More changes to import: the site.py module is now imported by
3691default when Python is initialized; use -S to disable it. The site.py
3692module extends the path with several more directories: site-packages
3693inside the lib/python1.5/ directory, site-python in the lib/
3694directory, and pathnames mentioned in *.pth files found in either of
3695those directories. See
3696http://grail.cnri.reston.va.us/python/essays/packages.html
3697for more info.
3698
3699- Changes to standard library subdirectory names: those subdirectories
3700that are not packages have been renamed with a hypen in their name,
3701e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
3702The test suite is now a package -- to run a test, you must now use
3703"import test.test_foo".
3704
3705- A completely new re.py module is provided (thanks to Andrew
3706Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
3707"pcre" re compiler and engine. For a while, the "old" re.py (which
3708was new in 1.5a3!) will be kept around as re1.py. The "old" regex
3709module and underlying parser and engine are still present -- while
3710regex is now officially obsolete, it will probably take several major
3711release cycles before it can be removed.
3712
3713- The posix module now has a strerror() function which translates an
3714error code to a string.
3715
3716- The emacs.py module (which was long obsolete) has been removed.
3717
3718- The universal makefile Misc/Makefile.pre.in now features an
3719"install" target. By default, installed shared libraries go into
3720$exec_prefix/lib/python$VERSION/site-packages/.
3721
3722- The install-sh script is installed with the other configuration
3723specific files (in the config/ subdirectory).
3724
3725- It turns out whatsound.py and sndhdr.py were identical modules.
3726Since there's also an imghdr.py file, I propose to make sndhdr.py the
3727official one. For compatibility, whatsound.py imports * from
3728sndhdr.py.
3729
3730- Class objects have a new attribute, __module__, giving the name of
3731the module in which they were declared. This is useful for pickle and
3732for printing the full name of a class exception.
3733
3734- Many extension modules no longer issue a fatal error when their
3735initialization fails; the importing code now checks whether an error
3736occurred during module initialization, and correctly propagates the
3737exception to the import statement.
3738
3739- Most extension modules now raise class-based exceptions (except when
3740-X is used).
3741
3742- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
3743thread state -- just don't manipulate the lock if it isn't there.
3744
3745- Fixed a bug in Python/getopt.c that made it do the wrong thing when
3746an option was a single '-'. Thanks to Andrew Kuchling.
3747
3748- New module mimetypes.py will guess a MIME type from a filename's
3749extension.
3750
3751- Windows: the DLL version is now settable via a resource rather than
3752being hardcoded. This can be used for "branding" a binary Python
3753distribution.
3754
3755- urllib.py is now threadsafe -- it now uses re instead of regex, and
3756sys.exc_info() instead of sys.exc_{type,value}.
3757
3758- Many other library modules that used to use
3759sys.exc_{type,value,traceback} are now more thread-safe by virtue of
3760using sys.exc_info().
3761
3762- The functions in popen2 have an optional buffer size parameter.
3763Also, the command argument can now be either a string (passed to the
3764shell) or a list of arguments (passed directly to execv).
3765
3766- Alas, the thread support for _tkinter released with 1.5a3 didn't
3767work. It's been rewritten. The bad news is that it now requires a
3768modified version of a file in the standard Tcl distribution, which you
3769must compile with a -I option pointing to the standard Tcl source
3770tree. For this reason, the thread support is disabled by default.
3771
3772- The errno extension module adds two tables: errorcode maps errno
3773numbers to errno names (e.g. EINTR), and errorstr maps them to
3774message strings. (The latter is redundant because the new call
3775posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
3776
3777- The readline extension module now provides some interfaces to
3778internal readline routines that make it possible to write a completer
3779in Python. An example completer, rlcompleter.py, is provided.
3780
3781 When completing a simple identifier, it completes keywords,
3782 built-ins and globals in __main__; when completing
3783 NAME.NAME..., it evaluates (!) the expression up to the last
3784 dot and completes its attributes.
3785
3786 It's very cool to do "import string" type "string.", hit the
3787 completion key (twice), and see the list of names defined by
3788 the string module!
3789
3790 Tip: to use the tab key as the completion key, call
3791
3792 readline.parse_and_bind("tab: complete")
3793
3794- The traceback.py module has a new function tb_lineno() by Marc-Andre
3795Lemburg which extracts the line number from the linenumber table in
3796the code object. Apparently the traceback object doesn't contains the
3797right linenumber when -O is used. Rather than guessing whether -O is
3798on or off, the module itself uses tb_lineno() unconditionally.
3799
3800- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
3801to tag_bind() so it works again.
3802
3803- The pystone script is now a standard library module. Example use:
3804"import test.pystone; test.pystone.main()".
3805
3806- The import of the readline module in interactive mode is now also
3807attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
3808Lemburg, who asked for this. :-)
3809
3810- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
3811Mullender, to be closer to the standard. This fixes the getaddr()
3812method. Unfortunately, getaddrlist() is as broken as ever, since it
3813splits on commas without regard for RFC 822 quoting conventions.
3814
3815- pprint.py: correctly emit trailing "," in singleton tuples.
3816
3817- _tkinter.c: export names for its type objects, TkappType and
3818TkttType.
3819
3820- pickle.py: use __module__ when defined; fix a particularly hard to
3821reproduce bug that confuses the memo when temporary objects are
3822returned by custom pickling interfaces; and a semantic change: when
3823unpickling the instance variables of an instance, use
3824inst.__dict__.update(value) instead of a for loop with setattr() over
3825the value.keys(). This is more consistent (the pickling doesn't use
3826getattr() either but pickles inst.__dict__) and avoids problems with
3827instances that have a __setattr__ hook. But it *is* a semantic change
3828(because the setattr hook is no longer used). So beware!
3829
3830- config.h is now installed (at last) in
3831$exec_prefix/include/python1.5/. For most sites, this means that it
3832is actually in $prefix/include/python1.5/, with all the other Python
3833include files, since $prefix and $exec_prefix are the same by
3834default.
3835
3836- The imp module now supports parts of the functionality to implement
3837import of hierarchical module names. It now supports find_module()
3838and load_module() for all types of modules. Docstrings have been
3839added for those functions in the built-in imp module that are still
3840relevant (some old interfaces are obsolete). For a sample
3841implementation of hierarchical module import in Python, see the new
3842library module knee.py.
3843
3844- The % operator on string objects now allows arbitrary nested parens
3845in a %(...)X style format. (Brad Howes)
3846
3847- Reverse the order in which Setup and Setup.local are passed to the
3848makesetup script. This allows variable definitions in Setup.local to
3849override definitions in Setup. (But you'll still have to edit Setup
3850if you want to disable modules that are enabled by default, or if such
3851modules need non-standard options.)
3852
3853- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
3854is like PyImport_ImporModule(name) but receives the globals and locals
3855dict and the fromlist arguments as well. (The name is a char*; the
3856others are PyObject*s).
3857
3858- The 'p' format in the struct extension module alloded to above is
3859new in 1.5a4.
3860
3861- The types.py module now uses try-except in a few places to make it
3862more likely that it can be imported in restricted mode. Some type
3863names are undefined in that case, e.g. CodeType (inaccessible),
3864FileType (not always accessible), and TracebackType and FrameType
3865(inaccessible).
3866
3867- In urllib.py: added separate administration of temporary files
3868created y URLopener.retrieve() so cleanup() can properly remove them.
3869The old code removed everything in tempcache which was a bad idea if
3870the user had passed a non-temp file into it. Also, in basejoin(),
3871interpret relative paths starting in "../". This is necessary if the
3872server uses symbolic links.
3873
3874- The Windows build procedure and project files are now based on
3875Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
3876directory. It is much more robust, and properly builds separate Debug
3877and Release versions. (The installer will be added shortly.)
3878
3879- Added casts and changed some return types in regexpr.c to avoid
3880compiler warnings or errors on some platforms.
3881
3882- The AIX build tools for shared libraries now supports VPATH. (Donn
3883Cave)
3884
3885- By default, disable the "portable" multimedia modules audioop,
3886imageop, and rgbimg, since they don't work on 64-bit platforms.
3887
3888- Fixed a nasty bug in cStringIO.c when code was actually using the
3889close() method (the destructors would try to free certain fields a
3890second time).
3891
3892- For those who think they need it, there's a "user.py" module. This
3893is *not* imported by default, but can be imported to run user-specific
3894setup commands, ~/.pythonrc.py.
3895
3896- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
3897Vladimir Marangozov, and others.
3898
3899- Added os.altsep; this is '/' on DOS/Windows, and None on systems
3900with a sane filename syntax.
3901
3902- os.py: Write out the dynamic OS choice, to avoid exec statements.
3903Adding support for a new OS is now a bit more work, but I bet that
3904'dos' or 'nt' will cover most situations...
3905
3906- The obsolete exception AccessError is now really gone.
3907
3908- Tools/faqwiz/: New installation instructions show how to maintain
3909multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
3910Added instructions to bootstrap script, too. Version bumped to 0.8.1.
3911Added <html>...</html> feature suggested by Skip Montanaro. Added
3912leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
3913default SRCDIR.
3914
3915- Documentation for the relatively new modules "keyword" and "symbol"
3916has been added (to the end of the section on the parser extension
3917module).
3918
3919- In module bisect.py, but functions have two optional argument 'lo'
3920and 'hi' which allow you to specify a subsequence of the array to
3921operate on.
3922
3923- In ftplib.py, changed most methods to return their status (even when
3924it is always "200 OK") rather than swallowing it.
3925
3926- main() now calls setlocale(LC_ALL, ""), if setlocale() and
3927<locale.h> are defined.
3928
3929- Changes to configure.in, the configure script, and both
3930Makefile.pre.in files, to support SGI's SGI_ABI platform selection
3931environment variable.
3932
3933
3934======================================================================
3935
3936
3937From 1.4 to 1.5a3
3938=================
3939
3940Security
3941--------
3942
3943- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
3944please use the new version. The old version has a huge security leak.
3945
3946Miscellaneous
3947-------------
3948
3949- Because of various (small) incompatible changes in the Python
3950bytecode interpreter, the magic number for .pyc files has changed
3951again.
3952
3953- The default module search path is now much saner. Both on Unix and
3954Windows, it is essentially derived from the path to the executable
3955(which can be overridden by setting the environment variable
3956$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
3957front of the default path, like in Unix (instead of overriding the
3958default path). On Windows, the directory containing the executable is
3959added to the end of the path.
3960
3961- A new version of python-mode.el for Emacs has been included. Also,
3962a new file ccpy-style.el has been added to configure Emacs cc-mode for
3963the preferred style in Python C sources.
3964
3965- On Unix, when using sys.argv[0] to insert the script directory in
3966front of sys.path, expand a symbolic link. You can now install a
3967program in a private directory and have a symbolic link to it in a
3968public bin directory, and it will put the private directory in the
3969module search path. Note that the symlink is expanded in sys.path[0]
3970but not in sys.argv[0], so you can still tell the name by which you
3971were invoked.
3972
3973- It is now recommended to use ``#!/usr/bin/env python'' instead of
3974``#!/usr/local/bin/python'' at the start of executable scripts, except
3975for CGI scripts. It has been determined that the use of /usr/bin/env
3976is more portable than that of /usr/local/bin/python -- scripts almost
3977never have to be edited when the Python interpreter lives in a
3978non-standard place. Note that this doesn't work for CGI scripts since
3979the python executable often doesn't live in the HTTP server's default
3980search path.
3981
3982- The silly -s command line option and the corresponding
3983PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
3984flag in the Python/C API) are gone.
3985
3986- Most problems on 64-bit platforms should now be fixed. Andrew
3987Kuchling helped. Some uncommon extension modules are still not
3988clean (image and audio ops?).
3989
3990- Fixed a bug where multiple anonymous tuple arguments would be mixed up
3991when using the debugger or profiler (reported by Just van Rossum).
3992The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
3993would print the wrong value when run under the debugger or profiler.
3994
3995- The hacks that the dictionary implementation used to speed up
3996repeated lookups of the same C string were removed; these were a
3997source of subtle problems and don't seem to serve much of a purpose
3998any longer.
3999
4000- All traces of support for the long dead access statement have been
4001removed from the sources.
4002
4003- Plugged the two-byte memory leak in the tokenizer when reading an
4004interactive EOF.
4005
4006- There's a -O option to the interpreter that removes SET_LINENO
4007instructions and assert statements (see below); it uses and produces
4008.pyo files instead of .pyc files. The speedup is only a few percent
4009in most cases. The line numbers are still available in the .pyo file,
4010as a separate table (which is also available in .pyc files). However,
4011the removal of the SET_LINENO instructions means that the debugger
4012(pdb) can't set breakpoints on lines in -O mode. The traceback module
4013contains a function to extract a line number from the code object
4014referenced in a traceback object. In the future it should be possible
4015to write external bytecode optimizers that create better optimized
4016.pyo files, and there should be more control over optimization;
4017consider the -O option a "teaser". Without -O, the assert statement
4018actually generates code that first checks __debug__; if this variable
4019is false, the assertion is not checked. __debug__ is a built-in
4020variable whose value is initialized to track the -O flag (it's true
4021iff -O is not specified). With -O, no code is generated for assert
4022statements, nor for code of the form ``if __debug__: <something>''.
4023Sorry, no further constant folding happens.
4024
4025
4026Performance
4027-----------
4028
4029- It's much faster (almost twice for pystone.py -- see
4030Tools/scripts). See the entry on string interning below.
4031
4032- Some speedup by using separate free lists for method objects (both
4033the C and the Python variety) and for floating point numbers.
4034
4035- Big speedup by allocating frame objects with a single malloc() call.
4036The Python/C API for frames is changed (you shouldn't be using this
4037anyway).
4038
4039- Significant speedup by inlining some common opcodes for common operand
4040types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
4041
4042- Small speedup by reordering the method tables of some common
4043objects (e.g. list.append is now first).
4044
4045- Big optimization to the read() method of file objects. A read()
4046without arguments now attempts to use fstat to allocate a buffer of
4047the right size; for pipes and sockets, it will fall back to doubling
4048the buffer size. While that the improvement is real on all systems,
4049it is most dramatic on Windows.
4050
4051
4052Documentation
4053-------------
4054
4055- Many new pieces of library documentation were contributed, mostly by
4056Andrew Kuchling. Even cmath is now documented! There's also a
4057chapter of the library manual, "libundoc.tex", which provides a
4058listing of all undocumented modules, plus their status (e.g. internal,
4059obsolete, or in need of documentation). Also contributions by Sue
4060Williams, Skip Montanaro, and some module authors who succumbed to
4061pressure to document their own contributed modules :-). Note that
4062printing the documentation now kills fewer trees -- the margins have
4063been reduced.
4064
4065- I have started documenting the Python/C API. Unfortunately this project
4066hasn't been completed yet. It will be complete before the final release of
4067Python 1.5, though. At the moment, it's better to read the LaTeX source
4068than to attempt to run it through LaTeX and print the resulting dvi file.
4069
4070- The posix module (and hence os.py) now has doc strings! Thanks to Neil
4071Schemenauer. I received a few other contributions of doc strings. In most
4072other places, doc strings are still wishful thinking...
4073
4074
4075Language changes
4076----------------
4077
4078- Private variables with leading double underscore are now a permanent
4079feature of the language. (These were experimental in release 1.4. I have
4080favorable experience using them; I can't label them "experimental"
4081forever.)
4082
4083- There's new string literal syntax for "raw strings". Prefixing a string
4084literal with the letter r (or R) disables all escape processing in the
4085string; for example, r'\n' is a two-character string consisting of a
4086backslash followed by the letter n. This combines with all forms of string
4087quotes; it is actually useful for triple quoted doc strings which might
4088contain references to \n or \t. An embedded quote prefixed with a
4089backslash does not terminate the string, but the backslash is still
4090included in the string; for example, r'\'' is a two-character string
4091consisting of a backslash and a quote. (Raw strings are also
4092affectionately known as Robin strings, after their inventor, Robin
4093Friedrich.)
4094
4095- There's a simple assert statement, and a new exception
4096AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
4097not foo > 0: raise AssertionError''. Sorry, the text of the asserted
4098condition is not available; it would be too complicated to generate
4099code for this (since the code is generated from a parse tree).
4100However, the text is displayed as part of the traceback!
4101
4102- The raise statement has a new feature: when using "raise SomeClass,
4103somevalue" where somevalue is not an instance of SomeClass, it
4104instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
4105instance of a *derived* class of SomeClass, the exception class raised
4106is set to somevalue.__class__, and SomeClass is ignored after that.
4107
4108- Duplicate keyword arguments are now detected at compile time;
4109f(a=1,a=2) is now a syntax error.
4110
4111
4112Changes to builtin features
4113---------------------------
4114
4115- There's a new exception FloatingPointError (used only by Lee Busby's
4116patches to catch floating point exceptions, at the moment).
4117
4118- The obsolete exception ConflictError (presumably used by the long
4119obsolete access statement) has been deleted.
4120
4121- There's a new function sys.exc_info() which returns the tuple
4122(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
4123
4124- There's a new variable sys.executable, pointing to the executable file
4125for the Python interpreter.
4126
4127- The sort() methods for lists no longer uses the C library qsort(); I
4128wrote my own quicksort implementation, with lots of help (in the form
4129of a kind of competition) from Tim Peters. This solves a bug in
4130dictionary comparisons on some Solaris versions when Python is built
4131with threads, and makes sorting lists even faster.
4132
4133- The semantics of comparing two dictionaries have changed, to make
4134comparison of unequal dictionaries faster. A shorter dictionary is
4135always considered smaller than a larger dictionary. For dictionaries
4136of the same size, the smallest differing element determines the
4137outcome (which yields the same results as before in this case, without
4138explicit sorting). Thanks to Aaron Watters for suggesting something
4139like this.
4140
4141- The semantics of try-except have changed subtly so that calling a
4142function in an exception handler that itself raises and catches an
4143exception no longer overwrites the sys.exc_* variables. This also
4144alleviates the problem that objects referenced in a stack frame that
4145caught an exception are kept alive until another exception is caught
4146-- the sys.exc_* variables are restored to their previous value when
4147returning from a function that caught an exception.
4148
4149- There's a new "buffer" interface. Certain objects (e.g. strings and
4150arrays) now support the "buffer" protocol. Buffer objects are acceptable
4151whenever formerly a string was required for a write operation; mutable
4152buffer objects can be the target of a read operation using the call
4153f.readinto(buffer). A cool feature is that regular expression matching now
4154also work on array objects. Contribution by Jack Jansen. (Needs
4155documentation.)
4156
4157- String interning: dictionary lookups are faster when the lookup
4158string object is the same object as the key in the dictionary, not
4159just a string with the same value. This is done by having a pool of
4160"interned" strings. Most names generated by the interpreter are now
4161automatically interned, and there's a new built-in function intern(s)
4162that returns the interned version of a string. Interned strings are
4163not a different object type, and interning is totally optional, but by
4164interning most keys a speedup of about 15% was obtained for the
4165pystone benchmark.
4166
4167- Dictionary objects have several new methods; clear() and copy() have
4168the obvious semantics, while update(d) merges the contents of another
4169dictionary d into this one, overriding existing keys. The dictionary
4170implementation file is now called dictobject.c rather than the
4171confusing mappingobject.c.
4172
4173- The intrinsic function dir() is much smarter; it looks in __dict__,
4174__members__ and __methods__.
4175
4176- The intrinsic functions int(), long() and float() can now take a
4177string argument and then do the same thing as string.atoi(),
4178string.atol(), and string.atof(). No second 'base' argument is
4179allowed, and complex() does not take a string (nobody cared enough).
4180
4181- When a module is deleted, its globals are now deleted in two phases.
4182In the first phase, all variables whose name begins with exactly one
4183underscore are replaced by None; in the second phase, all variables
4184are deleted. This makes it possible to have global objects whose
4185destructors depend on other globals. The deletion order within each
4186phase is still random.
4187
4188- It is no longer an error for a function to be called without a
4189global variable __builtins__ -- an empty directory will be provided
4190by default.
4191
4192- Guido's corollary to the "Don Beaudry hook": it is now possible to
4193do metaprogramming by using an instance as a base class. Not for the
4194faint of heart; and undocumented as yet, but basically if a base class
4195is an instance, its class will be instantiated to create the new
4196class. Jim Fulton will love it -- it also works with instances of his
4197"extension classes", since it is triggered by the presence of a
4198__class__ attribute on the purported base class. See
4199Demo/metaclasses/index.html for an explanation and see that directory
4200for examples.
4201
4202- Another change is that the Don Beaudry hook is now invoked when
4203*any* base class is special. (Up to 1.5a3, the *last* special base
4204class is used; in 1.5a4, the more rational choice of the *first*
4205special base class is used.)
4206
4207- New optional parameter to the readlines() method of file objects.
4208This indicates the number of bytes to read (the actual number of bytes
4209read will be somewhat larger due to buffering reading until the end of
4210the line). Some optimizations have also been made to speed it up (but
4211not as much as read()).
4212
4213- Complex numbers no longer have the ".conj" pseudo attribute; use
4214z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
4215now *do* support the __members__ and __methods__ special attributes.
4216
4217- The complex() function now looks for a __complex__() method on class
4218instances before giving up.
4219
4220- Long integers now support arbitrary shift counts, so you can now
4221write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
4222shift count for this.)
4223
4224- The hex() and oct() functions have been changed so that for regular
4225integers, they never emit a minus sign. For example, on a 32-bit
4226machine, oct(-1) now returns '037777777777' and hex(-1) returns
4227'0xffffffff'. While this may seem inconsistent, it is much more
4228useful. (For long integers, a minus sign is used as before, to fit
4229the result in memory :-)
4230
4231- The hash() function computes better hashes for several data types,
4232including strings, floating point numbers, and complex numbers.
4233
4234
4235New extension modules
4236---------------------
4237
4238- New extension modules cStringIO.c and cPickle.c, written by Jim
4239Fulton and other folks at Digital Creations. These are much more
4240efficient than their Python counterparts StringIO.py and pickle.py,
4241but don't support subclassing. cPickle.c clocks up to 1000 times
4242faster than pickle.py; cStringIO.c's improvement is less dramatic but
4243still significant.
4244
4245- New extension module zlibmodule.c, interfacing to the free zlib
4246library (gzip compatible compression). There's also a module gzip.py
4247which provides a higher level interface. Written by Andrew Kuchling
4248and Jeremy Hylton.
4249
4250- New module readline; see the "miscellaneous" section above.
4251
4252- New Unix extension module resource.c, by Jeremy Hylton, provides
4253access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
4254related symbolic constants.
4255
4256- New extension puremodule.c, by Barry Warsaw, which interfaces to the
4257Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
4258possible to enable Purify by simply setting the PURIFY Makefile
4259variable in the Modules/Setup file.
4260
4261
4262Changes in extension modules
4263----------------------------
4264
4265- The struct extension module has several new features to control byte
4266order and word size. It supports reading and writing IEEE floats even
4267on platforms where this is not the native format. It uses uppercase
4268format codes for unsigned integers of various sizes (always using
4269Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
4270and 'p' for "Pascal strings" (with a leading length byte, included in
4271the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
4272big-endian data and '<' forces little-endian data; these also select
4273standard data sizes and disable automatic alignment (use pad bytes as
4274needed).
4275
4276- The array module supports uppercase format codes for unsigned data
4277formats (like the struct module).
4278
4279- The fcntl extension module now exports the needed symbolic
4280constants. (Formerly these were in FCNTL.py which was not available
4281or correct for all platforms.)
4282
4283- The extension modules dbm, gdbm and bsddb now check that the
4284database is still open before making any new calls.
4285
4286- The dbhash module is no more. Use bsddb instead. (There's a third
4287party interface for the BSD 2.x code somewhere on the web; support for
4288bsddb will be deprecated.)
4289
4290- The gdbm module now supports a sync() method.
4291
4292- The socket module now has some new functions: getprotobyname(), and
4293the set {ntoh,hton}{s,l}().
4294
4295- Various modules now export their type object: socket.SocketType,
4296array.ArrayType.
4297
4298- The socket module's accept() method now returns unknown addresses as
4299a tuple rather than raising an exception. (This can happen in
4300promiscuous mode.) Theres' also a new function getprotobyname().
4301
4302- The pthread support for the thread module now works on most platforms.
4303
4304- STDWIN is now officially obsolete. Support for it will eventually
4305be removed from the distribution.
4306
4307- The binascii extension module is now hopefully fully debugged.
4308(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
4309received.)
4310
4311- audioop.c: added a ratecv() function; better handling of overflow in
4312add().
4313
4314- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
4315Windows, also O_TEXT and O_BINARY. The 'error' variable (the
4316exception is raises) is renamed -- its string value is now "os.error",
4317so newbies don't believe they have to import posix (or nt) to catch
4318it when they see os.error reported as posix.error. The execve()
4319function now accepts any mapping object for the environment.
4320
4321- A new version of the al (audio library) module for SGI was
4322contributed by Sjoerd Mullender.
4323
4324- The regex module has a new function get_syntax() which retrieves the
4325syntax setting set by set_syntax(). The code was also sanitized,
4326removing worries about unclean error handling. See also below for its
4327successor, re.py.
4328
4329- The "new" module (which creates new objects of various types) once
4330again has a fully functioning new.function() method. Dangerous as
4331ever! Also, new.code() has several new arguments.
4332
4333- A problem has been fixed in the rotor module: on systems with signed
4334characters, rotor-encoded data was not portable when the key contained
43358-bit characters. Also, setkey() now requires its argument rather
4336than having broken code to default it.
4337
4338- The sys.builtin_module_names variable is now a tuple. Another new
4339variables in sys is sys.executable (the full path to the Python
4340binary, if known).
4341
4342- The specs for time.strftime() have undergone some revisions. It
4343appears that not all format characters are supported in the same way
4344on all platforms. Rather than reimplement it, we note these
4345differences in the documentation, and emphasize the shared set of
4346features. There's also a thorough test set (that occasionally finds
4347problems in the C library implementation, e.g. on some Linuxes),
4348thanks to Skip Montanaro.
4349
4350- The nis module seems broken when used with NIS+; unfortunately
4351nobody knows how to fix it. It should still work with old NIS.
4352
4353
4354New library modules
4355-------------------
4356
4357- New (still experimental) Perl-style regular expression module,
4358re.py, which uses a new interface for matching as well as a new
4359syntax; the new interface avoids the thread-unsafety of the regex
4360interface. This comes with a helper extension reopmodule.c and vastly
4361rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
4362Peters, and Andrew Kuchling. See the documentation libre.tex. In
43631.5, the old regex module is still fully supported; in the future, it
4364will become obsolete.
4365
4366- New module gzip.py; see zlib above.
4367
4368- New module keyword.py exports knowledge about Python's built-in
4369keywords. (New version by Ka-Ping Yee.)
4370
4371- New module pprint.py (with documentation) which supports
4372pretty-printing of lists, tuples, & dictionaries recursively. By Fred
4373Drake.
4374
4375- New module code.py. The function code.compile_command() can
4376determine whether an interactively entered command is complete or not,
4377distinguishing incomplete from invalid input. (XXX Unfortunately,
4378this seems broken at this moment, and I don't have the time to fix
4379it. It's probably better to add an explicit interface to the parser
4380for this.)
4381
4382- There is now a library module xdrlib.py which can read and write the
4383XDR data format as used by Sun RPC, for example. It uses the struct
4384module.
4385
4386
4387Changes in library modules
4388--------------------------
4389
4390- Module codehack.py is now completely obsolete.
4391
4392- The pickle.py module has been updated to make it compatible with the
4393new binary format that cPickle.c produces. By default it produces the
4394old all-ASCII format compatible with the old pickle.py, still much
4395faster than pickle.py; it will read both formats automatically. A few
4396other updates have been made.
4397
4398- A new helper module, copy_reg.py, is provided to register extensions
4399to the pickling code.
4400
4401- Revamped module tokenize.py is much more accurate and has an
4402interface that makes it a breeze to write code to colorize Python
4403source code. Contributed by Ka-Ping Yee.
4404
4405- In ihooks.py, ModuleLoader.load_module() now closes the file under
4406all circumstances.
4407
4408- The tempfile.py module has a new class, TemporaryFile, which creates
4409an open temporary file that will be deleted automatically when
4410closed. This works on Windows and MacOS as well as on Unix. (Jim
4411Fulton.)
4412
4413- Changes to the cgi.py module: Most imports are now done at the
4414top of the module, which provides a speedup when using ni (Jim
4415Fulton). The problem with file upload to a Windows platform is solved
4416by using the new tempfile.TemporaryFile class; temporary files are now
4417always opened in binary mode (Jim Fulton). The cgi.escape() function
4418now takes an optional flag argument that quotes '"' to '&quot;'. It
4419is now possible to invoke cgi.py from a command line script, to test
4420cgi scripts more easily outside an http server. There's an optional
4421limit to the size of uploads to POST (Skip Montanaro). Added a
4422'strict_parsing' option to all parsing functions (Jim Fulton). The
4423function parse_qs() now uses urllib.unquote() on the name as well as
4424the value of fields (Clarence Gardner). The FieldStorage class now
4425has a __len__() method.
4426
4427- httplib.py: the socket object is no longer closed; all HTTP/1.*
4428responses are now accepted; and it is now thread-safe (by not using
4429the regex module).
4430
4431- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
4432
4433- The popen2.py module is now rewritten using a class, which makes
4434access to the standard error stream and the process id of the
4435subprocess possible.
4436
4437- Added timezone support to the rfc822.py module, in the form of a
4438getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
4439Also added recognition of some non-standard date formats, by Lars
4440Wirzenius, and RFC 850 dates (Chris Lawrence).
4441
4442- mhlib.py: various enhancements, including almost compatible parsing
4443of message sequence specifiers without invoking a subprocess. Also
4444added a createmessage() method by Lars Wirzenius.
4445
4446- The StringIO.StringIO class now supports readline(nbytes). (Lars
4447Wirzenius.) (Of course, you should be using cStringIO for performance.)
4448
4449- UserDict.py supports the new dictionary methods as well.
4450
4451- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
4452speed it up, and replace 0 seed values by 1 to avoid degeneration.
4453A bug was fixed in the test for invalid arguments.
4454
4455- Module ftplib.py: added support for parsing a .netrc file (Fred
4456Drake). Also added an ntransfercmd() method to the FTP class, which
4457allows access to the expected size of a transfer when available, and a
4458parse150() function to the module which parses the corresponding 150
4459response.
4460
4461- urllib.py: the ftp cache is now limited to 10 entries. Added
4462quote_plus() and unquote_plus() functions which are like quote() and
4463unquote() but also replace spaces with '+' or vice versa, for
4464encoding/decoding CGI form arguments. Catch all errors from the ftp
4465module. HTTP requests now add the Host: header line. The proxy
4466variable names are now mapped to lower case, for Windows. The
4467spliturl() function no longer erroneously throws away all data past
4468the first newline. The basejoin() function now intereprets "../"
4469correctly. I *believe* that the problems with "exception raised in
4470__del__" under certain circumstances have been fixed (mostly by
4471changes elsewher in the interpreter).
4472
4473- In urlparse.py, there is a cache for results in urlparse.urlparse();
4474its size limit is set to 20. Also, new URL schemes shttp, https, and
4475snews are "supported".
4476
4477- shelve.py: use cPickle and cStringIO when available. Also added
4478a sync() method, which calls the database's sync() method if there is
4479one.
4480
4481- The mimetools.py module now uses the available Python modules for
4482decoding quoted-printable, uuencode and base64 formats, rather than
4483creating a subprocess.
4484
4485- The python debugger (pdb.py, and its base class bdb.py) now support
4486conditional breakpoints. See the docs.
4487
4488- The modules base64.py, uu.py and quopri.py can now be used as simple
4489command line utilities.
4490
4491- Various small fixes to the nntplib.py module that I can't bother to
4492document in detail.
4493
4494- Sjoerd Mullender's mimify.py module now supports base64 encoding and
4495includes functions to handle the funny encoding you sometimes see in mail
4496headers. It is now documented.
4497
4498- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
4499gotten from the environment.
4500
4501- Many more modules now correctly open files in binary mode when this
4502is necessary on non-Unix platforms.
4503
4504- The copying functions in the undocumented module shutil.py are
4505smarter.
4506
4507- The Writer classes in the formatter.py module now have a flush()
4508method.
4509
4510- The sgmllib.py module accepts hyphens and periods in the middle of
4511attribute names. While this is against the SGML standard, there is
4512some HTML out there that uses this...
4513
4514- The interface for the Python bytecode disassembler module, dis.py,
4515has been enhanced quite a bit. There's now one main function,
4516dis.dis(), which takes almost any kind of object (function, module,
4517class, instance, method, code object) and disassembles it; without
4518arguments it disassembles the last frame of the last traceback. The
4519other functions have changed slightly, too.
4520
4521- The imghdr.py module recognizes new image types: BMP, PNG.
4522
4523- The string.py module has a new function replace(str, old, new,
4524[maxsplit]) which does substring replacements. It is actually
4525implemented in C in the strop module. The functions [r]find() an
4526[r]index() have an optional 4th argument indicating the end of the
4527substring to search, alsoo implemented by their strop counterparts.
4528(Remember, never import strop -- import string uses strop when
4529available with zero overhead.)
4530
4531- The string.join() function now accepts any sequence argument, not
4532just lists and tuples.
4533
4534- The string.maketrans() requires its first two arguments to be
4535present. The old version didn't require them, but there's not much
4536point without them, and the documentation suggests that they are
4537required, so we fixed the code to match the documentation.
4538
4539- The regsub.py module has a function clear_cache(), which clears its
4540internal cache of compiled regular expressions. Also, the cache now
4541takes the current syntax setting into account. (However, this module
4542is now obsolete -- use the sub() or subn() functions or methods in the
4543re module.)
4544
4545- The undocumented module Complex.py has been removed, now that Python
4546has built-in complex numbers. A similar module remains as
4547Demo/classes/Complex.py, as an example.
4548
4549
4550Changes to the build process
4551----------------------------
4552
4553- The way GNU readline is configured is totally different. The
4554--with-readline configure option is gone. It is now an extension
4555module, which may be loaded dynamically. You must enable it (and
4556specify the correct linraries to link with) in the Modules/Setup file.
4557Importing the module installs some hooks which enable command line
4558editing. When the interpreter shell is invoked interactively, it
4559attempts to import the readline module; when this fails, the default
4560input mechanism is used. The hook variables are PyOS_InputHook and
4561PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
4562ideas from William Magro.)
4563
4564- New build procedure: a single library, libpython1.5.a, is now built,
4565which contains absolutely everything except for a one-line main()
4566program (which calls Py_Main(argc, argv) to start the interpreter
4567shell). This makes life much simpler for applications that need to
4568embed Python. The serial number of the build is now included in the
4569version string (sys.version).
4570
4571- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
4572emits a single warning any more when compiling Python.
4573
4574- A number of new Makefile variables have been added for special
4575situations, e.g. LDLAST is appended to the link command. These are
4576used by editing the Makefile or passing them on the make command
4577line.
4578
4579- A set of patches from Lee Busby has been integrated that make it
4580possible to catch floating point exceptions. Use the configure option
4581--with-fpectl to enable the patches; the extension modules fpectl and
4582fpetest provide control to enable/disable and test the feature,
4583respectively.
4584
4585- The support for shared libraries under AIX is now simpler and more
4586robust. Thanks to Vladimir Marangozov for revamping his own patches!
4587
4588- The Modules/makesetup script now reads a file Setup.local as well as
4589a file Setup. Most changes to the Setup script can be done by editing
4590Setup.local instead, which makes it easier to carry a particular setup
4591over from one release to the next.
4592
4593- The Modules/makesetup script now copies any "include" lines it
4594encounters verbatim into the output Makefile. It also recognizes .cxx
4595and .cpp as C++ source files.
4596
4597- The configure script is smarter about C compiler options; e.g. with
4598gcc it uses -O2 and -g when possible, and on some other platforms it
4599uses -Olimit 1500 to avoid a warning from the optimizer about the main
4600loop in ceval.c (which has more than 1000 basic blocks).
4601
4602- The configure script now detects whether malloc(0) returns a NULL
4603pointer or a valid block (of length zero). This avoids the nonsense
4604of always adding one byte to all malloc() arguments on most platforms.
4605
4606- The configure script has a new option, --with-dec-threads, to enable
4607DEC threads on DEC Alpha platforms. Also, --with-threads is now an
4608alias for --with-thread (this was the Most Common Typo in configure
4609arguments).
4610
4611- Many changes in Doc/Makefile; amongst others, latex2html is now used
4612to generate HTML from all latex documents.
4613
4614
4615Change to the Python/C API
4616--------------------------
4617
4618- Because some interfaces have changed, the PYTHON_API macro has been
4619bumped. Most extensions built for the old API version will still run,
4620but I can't guarantee this. Python prints a warning message on
4621version mismatches; it dumps core when the version mismatch causes a
4622serious problem :-)
4623
4624- I've completed the Grand Renaming, with the help of Roger Masse and
4625Barry Warsaw. This makes reading or debugging the code much easier.
4626Many other unrelated code reorganizations have also been carried out.
4627The allobjects.h header file is gone; instead, you would have to
4628include Python.h followed by rename2.h. But you're better off running
4629Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
4630the rename2.h; it will disappear in the next release.
4631
4632- Various and sundry small bugs in the "abstract" interfaces have been
4633fixed. Thanks to all the (involuntary) testers of the Python 1.4
4634version! Some new functions have been added, e.g. PySequence_List(o),
4635equivalent to list(o) in Python.
4636
4637- New API functions PyLong_FromUnsignedLong() and
4638PyLong_AsUnsignedLong().
4639
4640- The API functions in the file cgensupport.c are no longer
4641supported. This file has been moved to Modules and is only ever
4642compiled when the SGI specific 'gl' module is built.
4643
4644- PyObject_Compare() can now raise an exception. Check with
4645PyErr_Occurred(). The comparison function in an object type may also
4646raise an exception.
4647
4648- The slice interface uses an upper bound of INT_MAX when no explicit
4649upper bound is given (e.x. for a[1:]). It used to ask the object for
4650its length and do the calculations.
4651
4652- Support for multiple independent interpreters. See Doc/api.tex,
4653functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
4654documentation is incomplete, also see the new Demo/pysvr example
4655(which shows how to use these in a threaded application) and the
4656source code.
4657
4658- There is now a Py_Finalize() function which "de-initializes"
4659Python. It is possible to completely restart the interpreter
4660repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
4661change of functionality in Py_Initialize() means that it is now a
4662fatal error to call it while the interpreter is already initialized.
4663The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
4664is deprecated (it is nothing more than Py_Finalize() followed by
4665exit()).
4666
4667- There are no known memory leaks left. While Py_Finalize() doesn't
4668free *all* allocated memory (some of it is hard to track down),
4669repeated calls to Py_Finalize() and Py_Initialize() do not create
4670unaccessible heap blocks.
4671
4672- There is now explicit per-thread state. (Inspired by, but not the
4673same as, Greg Stein's free threading patches.)
4674
4675- There is now better support for threading C applications. There are
4676now explicit APIs to manipulate the interpreter lock. Read the source
4677or the Demo/pysvr example; the new functions are
4678PyEval_{Acquire,Release}{Lock,Thread}().
4679
4680- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
4681with other libraries' DEBUG macros. Likewise for any other test
4682macros that didn't yet start with Py_.
4683
4684- New wrappers around malloc() and friends: Py_Malloc() etc. call
4685malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
4686just malloc(). Use of these wrappers could be essential if multiple
4687memory allocators exist (e.g. when using certain DLL setups under
4688Windows). (Idea by Jim Fulton.)
4689
4690- New C API PyImport_Import() which uses whatever __import__() hook
4691that is installed for the current execution environment. By Jim
4692Fulton.
4693
4694- It is now possible for an extension module's init function to fail
4695non-fatally, by calling one of the PyErr_* functions and returning.
4696
4697- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
4698argument to the proper type, like the similar PyString macros already
4699did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
4700and PyList_GET_ITEM.
4701
4702- Some of the Py_Get* function, like Py_GetVersion() (but not yet
4703Py_GetPath()) are now declared as returning a const char *. (More
4704should follow.)
4705
4706- Changed the run-time library to check for exceptions after object
4707comparisons. PyObject_Compare() can now return an exception; use
4708PyErr_Occurred() to check (there is *no* special return value).
4709
4710- PyFile_WriteString() and Py_Flushline() now return error indicators
4711instead of clearing exceptions. This fixes an obscure bug where using
4712these would clear a pending exception, discovered by Just van Rossum.
4713
4714- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
4715an argument list including keyword arguments. Contributed by Geoff
4716Philbrick.
4717
4718- PyArg_GetInt() is gone.
4719
4720- It's no longer necessary to include graminit.h when calling one of
4721the extended parser API functions. The three public grammar start
4722symbols are now in Python.h as Py_single_input, Py_file_input, and
4723Py_eval_input.
4724
4725- The CObject interface has a new function,
4726PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
4727on the object referenced by "module.name".
4728
4729
4730Tkinter
4731-------
4732
4733- On popular demand, _tkinter once again installs a hook for readline
4734that processes certain Tk events while waiting for the user to type
4735(using PyOS_InputHook).
4736
4737- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
4738caused by command definitions referencing widget objects beyond their
4739lifetime.
4740
4741- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
4742tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
4743with the new Tk dialog scripts, and provide more "native platform"
4744style file selection dialog boxes on some platforms. Contributed by
4745Fredrik Lundh.
4746
4747- Tkinter.py: when the first Tk object is destroyed, it sets the
4748hiddel global _default_root to None, so that when another Tk object is
4749created it becomes the new default root. Other miscellaneous
4750changes and fixes.
4751
4752- The Image class now has a configure method.
4753
4754- Added a bunch of new winfo options to Tkinter.py; we should now be
4755up to date with Tk 4.2. The new winfo options supported are:
4756mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
4757visualsavailable.
4758
4759- The broken bind() method on Canvas objects defined in the Canvas.py
4760module has been fixed. The CanvasItem and Group classes now also have
4761an unbind() method.
4762
4763- The problem with Tkinter.py falling back to trying to import
4764"tkinter" when "_tkinter" is not found has been fixed -- it no longer
4765tries "tkinter", ever. This makes diagnosing the problem "_tkinter
4766not configured" much easier and will hopefully reduce the newsgroup
4767traffic on this topic.
4768
4769- The ScrolledText module once again supports the 'cnf' parameter, to
4770be compatible with the examples in Mark Lutz' book (I know, I know,
4771too late...)
4772
4773- The _tkinter.c extension module has been revamped. It now support
4774Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
4775works well under Windows and Mac (with the latest Tk ports to those
4776platforms). It also supports threading -- it is safe for one
4777(Python-created) thread to be blocked in _tkinter.mainloop() while
4778other threads modify widgets. To make the changes visible, those
4779threads must use update_idletasks()method. (The patch for threading
4780in 1.5a3 was broken; in 1.5a4, it is back in a different version,
4781which requires access to the Tcl sources to get it to work -- hence it
4782is disabled by default.)
4783
4784- A bug in _tkinter.c has been fixed, where Split() with a string
4785containing an unmatched '"' could cause an exception or core dump.
4786
4787- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
4788CreateFileHandler, so _tkinter.createfilehandler is not available on
4789those platforms when using Tk 8.0 or later. I will have to rethink
4790how to interface with Tcl's lower-level event mechanism, or with its
4791channels (which are like Python's file-like objects). Jack Jansen has
4792provided a fix for the Mac, so createfilehandler *is* actually
4793supported there; maybe I can adapt his fix for Windows.
4794
4795
4796Tools and Demos
4797---------------
4798
4799- A new regression test suite is provided, which tests most of the
4800standard and built-in modules. The regression test is run by invoking
4801the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
4802he and Roger Masse contributed most of the new tests.
4803
4804- New tool: faqwiz -- the CGI script that is used to maintain the
4805Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
4806Tools/faqwiz.
4807
4808- New tool: webchecker -- a simple extensible web robot that, when
4809aimed at a web server, checks that server for dead links. Available
4810are a command line utility as well as a Tkinter based GUI version. In
4811Tools/webchecker. A simplified version of this program is dissected
4812in my article in O'Reilly's WWW Journal, the issue on Scripting
4813Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
4814Includes a parser for robots.txt files by Skip Montanaro.
4815
4816- New small tools: cvsfiles.py (prints a list of all files under CVS
4817n a particular directory tree), treesync.py (a rather Guido-specific
4818script to synchronize two source trees, one on Windows NT, the other
4819one on Unix under CVS but accessible from the NT box), and logmerge.py
4820(sort a collection of RCS or CVS logs by date). In Tools/scripts.
4821
4822- The freeze script now also works under Windows (NT). Another
4823feature allows the -p option to be pointed at the Python source tree
4824instead of the installation prefix. This was loosely based on part of
4825xfreeze by Sam Rushing and Bill Tutt.
4826
4827- New examples (Demo/extend) that show how to use the generic
4828extension makefile (Misc/Makefile.pre.in).
4829
4830- Tools/scripts/h2py.py now supports C++ comments.
4831
4832- Tools/scripts/pystone.py script is upgraded to version 1.1; there
4833was a bug in version 1.0 (distributed with Python 1.4) that leaked
4834memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
4835
4836- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
4837
4838
4839Windows (NT and 95)
4840-------------------
4841
4842- New project files for Developer Studio (Visual C++) 5.0 for Windows
4843NT (the old VC++ 4.2 Makefile is also still supported, but will
4844eventually be withdrawn due to its bulkiness).
4845
4846- See the note on the new module search path in the "Miscellaneous" section
4847above.
4848
4849- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
4850basically withdrawn. If it still works for you, you're lucky.
4851
4852- There's a new extension module, msvcrt.c, which provides various
4853low-level operations defined in the Microsoft Visual C++ Runtime Library.
4854These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
4855console I/O functions like kbhit(), getch() and putch().
4856
4857- The -u option not only sets the standard I/O streams to unbuffered
4858status, but also sets them in binary mode. (This can also be done
4859using msvcrt.setmode(), by the way.)
4860
4861- The, sys.prefix and sys.exec_prefix variables point to the directory
4862where Python is installed, or to the top of the source tree, if it was run
4863from there.
4864
4865- The various os.path modules (posixpath, ntpath, macpath) now support
4866passing more than two arguments to the join() function, so
4867os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
4868c)).
4869
4870- The ntpath module (normally used as os.path) supports ~ to $HOME
4871expansion in expanduser().
4872
4873- The freeze tool now works on Windows.
4874
4875- See also the Tkinter category for a sad note on
4876_tkinter.createfilehandler().
4877
4878- The truncate() method for file objects now works on Windows.
4879
4880- Py_Initialize() is no longer called when the DLL is loaded. You
4881must call it yourself.
4882
4883- The time module's clock() function now has good precision through
4884the use of the Win32 API QueryPerformanceCounter().
4885
4886- Mark Hammond will release Python 1.5 versions of PythonWin and his
4887other Windows specific code: the win32api extensions, COM/ActiveX
4888support, and the MFC interface.
4889
4890
4891Mac
4892---
4893
4894- As always, the Macintosh port will be done by Jack Jansen. He will
4895make a separate announcement for the Mac specific source code and the
4896binary distribution(s) when these are ready.
4897
4898
4899======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +00004900
Guido van Rossumaa253861994-10-06 17:18:57 +00004901
Guido van Rossumc30e95f1996-07-30 18:53:51 +00004902=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +00004903==> Release 1.4 (October 25 1996) <==
4904=====================================
4905
4906(Starting in reverse chronological order:)
4907
4908- Changed disclaimer notice.
4909
4910- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
4911default to the user's login shell.
4912
4913- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
4914widget, and bogus bspace() function.
4915
4916- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
4917paragraph.
4918
4919- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
4920subprojects, and to remove the (broken) experimental NumPy
4921subprojects.
4922
4923- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
4924(where os.stat() returns mtimes as floats.)
4925- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
4926fix POST in CGIHTTPServer.py.
4927
4928- Version 2.83 of Misc/python-mode.el for Emacs is included.
4929
4930- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
4931group starting immediately after a group tag.
4932
4933- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
4934
4935- In Objects/stringobject.c, fixed the compare function to do the
4936first char comparison in unsigned mode, for consistency with the way
4937other characters are compared by memcmp().
4938
4939- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
4940
4941- In Lib/urllib.py, fix another case where openedurl wasn't set.
4942
4943(XXX Sorry, the rest is in totally random order. No time to fix it.)
4944
4945- SyntaxError exceptions detected during code generation
4946(e.g. assignment to an expression) now include a line number.
4947
4948- Don't leave trailing / or \ in script directory inserted in front of
4949sys.path.
4950
4951- Added a note to Tools/scripts/classfix.py abouts its historical
4952importance.
4953
4954- Added Misc/Makefile.pre.in, a universal Makefile for extensions
4955built outside the distribution.
4956
4957- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
4958
4959- Install shared modules with mode 555 (needed for performance on some
4960platforms).
4961
4962- Some changes to standard library modules to avoid calling append()
4963with more than one argument -- while supported, this should be
4964outlawed, and I don't want to set a bad example.
4965
4966- bdb.py (and hence pdb.py) supports calling run() with a code object
4967instead of a code string.
4968
4969- Fixed an embarrassing bug cgi.py which prevented correct uploading
4970of binary files from Netscape (which doesn't distinguish between
4971binary and text files). Also added dormant logging support, which
4972makes it easier to debug the cgi module itself.
4973
4974- Added default writer to constructor of NullFormatter class.
4975
4976- Use binary mode for socket.makefile() calls in ftplib.py.
4977
4978- The ihooks module no longer "installs" itself upon import -- this
4979was an experimental feature that helped ironing out some bugs but that
4980slowed down code that imported it without the need to install it
4981(e.g. the rexec module). Also close the file in some cases and add
4982the __file__ attribute to loaded modules.
4983
4984- The test program for mailbox.py is now more useful.
4985
4986- Added getparamnames() to Message class in mimetools.py -- it returns
4987the names of parameters to the content-type header.
4988
4989- Fixed a typo in ni that broke the loop stripping "__." from names.
4990
4991- Fix sys.path[0] for scripts run via pdb.py's new main program.
4992
4993- profile.py can now also run a script, like pdb.
4994
4995- Fix a small bug in pyclbr -- don't add names starting with _ when
4996emulating from ... import *.
4997
4998- Fixed a series of embarrassing typos in rexec's handling of standard
4999I/O redirection. Added some more "safe" built-in modules: cmath,
5000errno, operator.
5001
5002- Fixed embarrassing typo in shelve.py.
5003
5004- Added SliceType and EllipsisType to types.py.
5005
5006- In urllib.py, added handling for error 301 (same as 302); added
5007geturl() method to get the URL after redirection.
5008
5009- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
5010for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
5011
5012- Fixed bsddbmodule.c to add binary mode indicator on platforms that
5013have it. This should make it working on Windows NT.
5014
5015- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
5016whatever applies. Also rationalized some other tests for various MS
5017platforms.
5018
5019- Added the sources for the NT installer script used for Python
50201.4beta3. Not tested with this release, but better than nothing.
5021
5022- A compromise in pickle's defenses against Trojan horses: a
5023user-defined function is now okay where a class is expected. A
5024built-in function is not okay, to prevent pickling something that
5025will execute os.system("rm -f *") when unpickling.
5026
5027- dis.py will print the name of local variables referenced by local
5028load/store/delete instructions.
5029
5030- Improved portability of SimpleHTTPServer module to non-Unix
5031platform.
5032
5033- The thread.h interface adds an extra argument to down_sema(). This
5034only affects other C code that uses thread.c; the Python thread module
5035doesn't use semaphores (which aren't provided on all platforms where
5036Python threads are supported). Note: on NT, this change is not
5037implemented.
5038
5039- Fixed some typos in abstract.h; corrected signature of
5040PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
5041abstract.c's PyObject_CallMethod().
5042
5043- apply(classname, (), {}) now works even if the class has no
5044__init__() method.
5045
5046- Implemented complex remainder and divmod() (these would dump core!).
5047Conversion of complex numbers to int, long int or float now raises an
5048exception, since there is no meaningful way to do it without losing
5049information.
5050
5051- Fixed bug in built-in complex() function which gave the wrong result
5052for two real arguments.
5053
5054- Change the hash algorithm for strings -- the multiplier is now
50551000003 instead of 3, which gives better spread for short strings.
5056
5057- New default path for Windows NT, the registry structure now supports
5058default paths for different install packages. (Mark Hammond -- the
5059next PythonWin release will use this.)
5060
5061- Added more symbols to the python_nt.def file.
5062
5063- When using GNU readline, set rl_readline_name to "python".
5064
5065- The Ellipses built-in name has been renamed to Ellipsis -- this is
5066the correct singular form. Thanks to Ka-Ping Yee, who saved us from
5067eternal embarrassment.
5068
5069- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
5070Ellipsis name change.
5071
5072- Updated the library reference manual. Added documentation of
5073restricted mode (rexec, Bastion) and the formatter module (for use
5074with the htmllib module). Fixed the documentation of htmllib
5075(finally).
5076
5077- The reference manual is now maintained in FrameMaker.
5078
5079- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
5080
5081- Slight improvements to Doc/Makefile.
5082
5083- Added fcntl.lockf(). This should be used for Unix file locking
5084instead of the posixfile module; lockf() is more portable.
5085
5086- The getopt module now supports long option names, thanks to Lars
5087Wizenius.
5088
5089- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
5090and Nils Fischbeck.
5091
5092- Use more bits of time.time() in whrandom's default seed().
5093
5094- Performance hack for regex module's regs attribute.
5095
5096- Don't close already closed socket in socket module.
5097
5098- Correctly handle separators containing embedded nulls in
5099strop.split, strop.find and strop.rfind. Also added more detail to
5100error message for strop.atoi and friends.
5101
5102- Moved fallback definition for hypot() to Python/hypot.c.
5103
5104- Added fallback definition for strdup, in Python/strdup.c.
5105
5106- Fixed some bugs where a function would return 0 to indicate an error
5107where it should return -1.
5108
5109- Test for error returned by time.localtime(), and rationalized its MS
5110tests.
5111
5112- Added Modules/Setup.local file, which is processed after Setup.
5113
5114- Corrected bug in toplevel Makefile.in -- execution of regen script
5115would not use the right PATH and PYTHONPATH.
5116
5117- Various and sundry NeXT configuration changes (sigh).
5118
5119- Support systems where libreadline needs neither termcap nor curses.
5120
5121- Improved ld_so_aix script and python.exp file (for AIX).
5122
5123- More stringent test for working <stdarg.h> in configure script.
5124
5125- Removed Demo/www subdirectory -- it was totally out of date.
5126
5127- Improved demos and docs for Fred Drake's parser module; fixed one
5128typo in the module itself.
5129
5130
5131=========================================
5132==> Release 1.4beta3 (August 26 1996) <==
5133=========================================
5134
5135
5136(XXX This is less readable that it should. I promise to restructure
5137it for the final 1.4 release.)
5138
5139
5140What's new in 1.4beta3 (since beta2)?
5141-------------------------------------
5142
5143- Name mangling to implement a simple form of class-private variables.
5144A name of the form "__spam" can't easily be used outside the class.
5145(This was added in 1.4beta3, but left out of the 1.4beta3 release
5146message.)
5147
5148- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
5149handled correctly when using a proxy server.
5150
5151- In ntpath.normpath(): don't truncate to 8+3 format.
5152
5153- In mimetools.choose_boundary(): don't die when getuid() or getpid()
5154aren't defined.
5155
5156- Module urllib: some optimizations to (un)quoting.
5157
5158- New module MimeWriter for writing MIME documents.
5159
5160- More changes to formatter module.
5161
5162- The freeze script works once again and is much more robust (using
5163sys.prefix etc.). It also supports a -o option to specify an
5164output directory.
5165
5166- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
5167
5168- The Doc/Makefile targets have been reorganized somewhat to remove the
5169insistence on always generating PostScript.
5170
5171- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
5172
5173- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
5174name conflict on the Mac.
5175
5176- Linking a module compiled with a different setting for Py_TRACE_REFS now
5177generates a linker error rather than a core dump.
5178
5179- The cgi module has a new convenience function print_exception(), which
5180formats a python exception using HTML. It also fixes a bug in the
5181compatibility code and adds a dubious feature which makes it possible to
5182have two query strings, one in the URL and one in the POST data.
5183
5184- A subtle change in the unpickling of class instances makes it possible
5185to unpickle in restricted execution mode, where the __dict__ attribute is
5186not available (but setattr() is).
5187
5188- Documentation for os.path.splitext() (== posixpath.splitext()) has been
5189cleared up. It splits at the *last* dot.
5190
5191- posixfile locking is now also correctly supported on AIX.
5192
5193- The tempfile module once again honors an initial setting of tmpdir. It
5194now works on Windows, too.
5195
5196- The traceback module has some new functions to extract, format and print
5197the active stack.
5198
5199- Some translation functions in the urllib module have been made a little
5200less sluggish.
5201
5202- The addtag_* methods for Canvas widgets in Tkinter as well as in the
5203separate Canvas class have been fixed so they actually do something
5204meaningful.
5205
5206- A tiny _test() function has been added to Tkinter.py.
5207
5208- A generic Makefile for dynamically loaded modules is provided in the Misc
5209subdirectory (Misc/gMakefile).
5210
5211- A new version of python-mode.el for Emacs is provided. See
5212http://www.python.org/ftp/emacs/pmdetails.html for details. The
5213separate file pyimenu.el is no longer needed, imenu support is folded
5214into python-mode.el.
5215
5216- The configure script can finally correctly find the readline library in a
5217non-standard location. The LDFLAGS variable is passed on the the Makefiles
5218from the configure script.
5219
5220- Shared libraries are now installed as programs (i.e. with executable
5221permission). This is required on HP-UX and won't hurt on other systems.
5222
5223- The objc.c module is no longer part of the distribution. Objective-C
5224support may become available as contributed software on the ftp site.
5225
5226- The sybase module is no longer part of the distribution. A much
5227improved sybase module is available as contributed software from the
5228ftp site.
5229
5230- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
5231Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
5232now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
5233
5234- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
5235can use *.so and *.sl as shared libraries.
5236
5237- Some more fidgeting for AIX shared libraries.
5238
5239- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
5240(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
5241available from the contrib directory on the ftp site.)
5242
5243- A warning is written to sys.stderr when a __del__ method raises an
5244exception (formerly, such exceptions were completely ignored).
5245
5246- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
5247incapable of ANSI style token concatenation and stringification.
5248
5249- All source files (except a few platform specific modules) are once again
5250compatible with K&R C compilers as well as ANSI compilers. In particular,
5251ANSI-isms have been removed or made conditional in complexobject.c,
5252getargs.c and operator.c.
5253
5254- The abstract object API has three new functions, PyObject_DelItem,
5255PySequence_DelItem, and PySequence_DelSlice.
5256
5257- The operator module has new functions delitem and delslice, and the
5258functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
5259"and" are reserved words). ("__or__" and "__and__" are unchanged.)
5260
5261- The environment module is no longer supported; putenv() is now a function
5262in posixmodule (also under NT).
5263
5264- Error in filter(<function>, "") has been fixed.
5265
5266- Unrecognized keyword arguments raise TypeError, not KeyError.
5267
5268- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
5269some more documentation.
5270
5271- Bug in float power boundary case (0.0 to the negative integer power)
5272fixed.
5273
5274- The test of negative number to the float power has been moved from the
5275built-in pow() functin to floatobject.c (so complex numbers can yield the
5276correct result).
5277
5278- The bug introduced in beta2 where shared libraries loaded (using
5279dlopen()) from the current directory would fail, has been fixed.
5280
5281- Modules imported as shared libraries now also have a __file__ attribute,
5282giving the filename from which they were loaded. The only modules without
5283a __file__ attribute now are built-in modules.
5284
5285- On the Mac, dynamically loaded modules can end in either ".slb" or
5286".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
5287extension should only be used for "fat" binaries.
5288
5289- C API addition: marshal.c now supports
5290PyMarshal_WriteObjectToString(object).
5291
5292- C API addition: getargs.c now supports
5293PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
5294to parse keyword arguments.
5295
5296- The PC versioning scheme (sys.winver) has changed once again. the
5297version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
5298first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
5299"1.4.1" for Python 1.4.1 -- the beta level is not included) and
5300<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
5301
5302- h2py.py accepts whitespace before the # in CPP directives
5303
5304- On Solaris 2.5, it should now be possible to use either Posix threads or
5305Solaris threads (XXX: how do you select which is used???). (Note: the
5306Python pthreads interface doesn't fully support semaphores yet -- anyone
5307care to fix this?)
5308
5309- Thread support should now work on AIX, using either DCE threads or
5310pthreads.
5311
5312- New file Demo/sockets/unicast.py
5313
5314- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
5315both) (XXX)
5316
5317- New project setup for PC port, now compatible with PythonWin, with
5318_tkinter and NumPy support (XXX)
5319
5320- New module site.py (XXX)
5321
5322- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
5323
5324- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
5325
5326- regen script fixed (XXX)
5327
5328- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
5329
5330- testall now also tests math module (XXX)
5331
5332- string.atoi c.s. now raise an exception for an empty input string.
5333
5334- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
5335have config.h included at various places.
5336
5337- Unrecognized keyword arguments now raise TypeError rather than KeyError.
5338
5339- The makesetup script recognizes files with extension .so or .sl as
5340(shared) libraries.
5341
5342- 'access' is no longer a reserved word, and all code related to its
5343implementation is gone (or at least #ifdef'ed out). This should make
5344Python a little speedier too!
5345
5346- Performance enhancements suggested by Sjoerd Mullender. This includes
5347the introduction of two new optional function pointers in type object,
5348getattro and setattro, which are like getattr and setattr but take a
5349string object instead of a C string pointer.
5350
5351- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
5352only on the left or only on the right, A new optional third argument to
5353split() specifies the maximum number of separators honored (so
5354splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
53551.3, splitfields(s, None) is totally equivalent to split(s).)
5356string.capwords() has an optional second argument specifying the
5357separator (which is passed to split()).
5358
5359- regsub.split() has the same addition as string.split(). regsub.splitx(s,
5360sep, maxsep) implements the functionality that was regsub.split(s, 1) in
53611.4beta2 (return a list containing the delimiters as well as the words).
5362
5363- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
5364
5365- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
5366argument to _tkinter.create() to set Tcl's argv0 variable, so X
5367resources use the right resource class again.
5368
5369- Add #undef fabs to Modules/mathmodule.c for macintosh.
5370
5371- Added some macro renames for AIX in Modules/operator.c.
5372
5373- Removed spurious 'E' from Doc/liberrno.tex.
5374
5375- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
5376Misc/gMakefile and new version of Misc/python-mode.el.
5377
5378- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
5379NameError).
5380
5381- Added missing "from types import *" to Lib/tkinter/Canvas.py.
5382
5383- Added hint about using default args for __init__ to pickle docs.
5384
5385- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
5386PySequence_Length.
5387
5388- Some improvements to Doc/texi2html.py.
5389
5390- In Python/import.c, Cast unsigned char * in struct _frozen to char *
5391in calls to rds_object().
5392
5393- In doc/ref4.tex, added note about scope of lambda bodies.
5394
5395What's new in 1.4beta2 (since beta1)?
5396-------------------------------------
5397
5398- Portability bug in the md5.h header solved.
5399
5400- The PC build procedure now really works, and sets sys.platform to a
5401meaningful value (a few things were botched in beta 1). Lib/dos_8x3
5402is now a standard part of the distribution (alas).
5403
5404- More improvements to the installation procedure. Typing "make install"
5405now inserts the version number in the pathnames of almost everything
5406installed, and creates the machine dependent modules (FCNTL.py etc.) if not
5407supplied by the distribution. (XXX There's still a problem with the latter
5408because the "regen" script requires that Python is installed. Some manual
5409intervention may still be required.) (This has been fixed in 1.4beta3.)
5410
5411- New modules: errno, operator (XXX).
5412
5413- Changes for use with Numerical Python: builtin function slice() and
5414Ellipses object, and corresponding syntax:
5415
5416 x[lo:hi:stride] == x[slice(lo, hi, stride)]
5417 x[a, ..., z] == x[(a, Ellipses, z)]
5418
5419- New documentation for errno and cgi mdoules.
5420
5421- The directory containing the script passed to the interpreter is
5422inserted in from of sys.path; "." is no longer a default path
5423component.
5424
5425- Optional third string argument to string.translate() specifies
5426characters to delete. New function string.maketrans() creates a
5427translation table for translate() or for regex.compile().
5428
5429- Module posix (and hence module os under Unix) now supports putenv().
5430Moreover, module os is enhanced so that if putenv() is supported,
5431assignments to os.environ entries make the appropriate putenv() call.
5432(XXX the putenv() implementation can leak a small amount of memory per
5433call.)
5434
5435- pdb.py can now be invoked from the command line to debug a script:
5436python pdb.py <script> <arg> ...
5437
5438- Much improved parseaddr() in rfc822.
5439
5440- In cgi.py, you can now pass an alternative value for environ to
5441nearly all functions.
5442
5443- You can now assign to instance variables whose name begins and ends
5444with '__'.
5445
5446- New version of Fred Drake's parser module and associates (token,
5447symbol, AST).
5448
5449- New PYTHON_API_VERSION value and .pyc file magic number (again!).
5450
5451- The "complex" internal structure type is now called "Py_complex" to
5452avoid name conflicts.
5453
5454- Numerous small bugs fixed.
5455
5456- Slight pickle speedups.
5457
5458- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
5459
5460- NeXT portability mods by Bill Bumgarner integrated.
5461
5462- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
5463converted to new naming style.
5464
5465
5466What's new in 1.4beta1 (since 1.3)?
5467-----------------------------------
5468
5469- Added sys.platform and sys.exec_platform for Bill Janssen.
5470
5471- Installation has been completely overhauled. "make install" now installs
5472everything, not just the python binary. Installation uses the install-sh
5473script (borrowed from X11) to install each file.
5474
5475- New functions in the posix module: mkfifo, plock, remove (== unlink),
5476and ftruncate. More functions are also available under NT.
5477
5478- New function in the fcntl module: flock.
5479
5480- Shared library support for FreeBSD.
5481
5482- The --with-readline option can now be used without a DIRECTORY argument,
5483for systems where libreadline.* is in one of the standard places. It is
5484also possible for it to be a shared library.
5485
5486- The extension tkinter has been renamed to _tkinter, to avoid confusion
5487with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
5488well as 4.0.
5489
5490- Author's change of address from CWI in Amsterdam, The Netherlands, to
5491CNRI in Reston, VA, USA.
5492
5493- The math.hypot() function is now always available (if it isn't found in
5494the C math library, Python provides its own implementation).
5495
5496- The latex documentation is now compatible with latex2e, thanks to David
5497Ascher.
5498
5499- The expression x**y is now equivalent to pow(x, y).
5500
5501- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
5502
5503- Complex numbers are now supported. Imaginary constants are written with
5504a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
5505part to an imaginary part, like 3+4j. Complex numbers are always stored in
5506floating point form, so this is equivalent to 3.0+4.0j. It is also
5507possible to create complex numbers with the new built-in function
5508complex(re, [im]). For the footprint-conscious, complex number support can
5509be disabled by defining the symbol WITHOUT_COMPLEX.
5510
5511- New built-in function list() is the long-awaited counterpart of tuple().
5512
5513- There's a new "cmath" module which provides the same functions as the
5514"math" library but with complex arguments and results. (There are very
5515good reasons why math.sqrt(-1) still raises an exception -- you have to use
5516cmath.sqrt(-1) to get 1j for an answer.)
5517
5518- The Python.h header file (which is really the same as allobjects.h except
5519it disables support for old style names) now includes several more files,
5520so you have to have fewer #include statements in the average extension.
5521
5522- The NDEBUG symbol is no longer used. Code that used to be dependent on
5523the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
5524and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
5525respectively. At long last, the source actually compiles and links without
5526errors when this symbol is defined.
5527
5528- Several symbols that didn't follow the new naming scheme have been
5529renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
5530are no external symbols left without a Py or _Py prefix, not even those
5531defined by sources that were incorporated from elsewhere (regexpr.c,
5532md5c.c). (Macros are a different story...)
5533
5534- There are now typedefs for the structures defined in config.c and
5535frozen.c.
5536
5537- New PYTHON_API_VERSION value and .pyc file magic number.
5538
5539- New module Bastion. (XXX)
5540
5541- Improved performance of StringIO module.
5542
5543- UserList module now supports + and * operators.
5544
5545- The binhex and binascii modules now actually work.
5546
5547- The cgi module has been almost totally rewritten and documented.
5548It now supports file upload and a new data type to handle forms more
5549flexibly.
5550
5551- The formatter module (for use with htmllib) has been overhauled (again).
5552
5553- The ftplib module now supports passive mode and has doc strings.
5554
5555- In (ideally) all places where binary files are read or written, the file
5556is now correctly opened in binary mode ('rb' or 'wb') so the code will work
5557on Mac or PC.
5558
5559- Dummy versions of os.path.expandvars() and expanduser() are now provided
5560on non-Unix platforms.
5561
5562- Module urllib now has two new functions url2pathname and pathname2url
5563which turn local filenames into "file:..." URLs using the same rules as
5564Netscape (why be different). it also supports urlretrieve() with a
5565pathname parameter, and honors the proxy environment variables (http_proxy
5566etc.). The URL parsing has been improved somewhat, too.
5567
5568- Micro improvements to urlparse. Added urlparse.urldefrag() which
5569removes a trailing ``#fragment'' if any.
5570
5571- The mailbox module now supports MH style message delimiters as well.
5572
5573- The mhlib module contains some new functionality: setcontext() to set the
5574current folder and parsesequence() to parse a sequence as commonly passed
5575to MH commands (e.g. 1-10 or last:5).
5576
5577- New module mimify for conversion to and from MIME format of email
5578messages.
5579
5580- Module ni now automatically installs itself when first imported -- this
5581is against the normal rule that modules should define classes and functions
5582but not invoke them, but appears more useful in the case that two
5583different, independent modules want to use ni's features.
5584
5585- Some small performance enhancements in module pickle.
5586
5587- Small interface change to the profile.run*() family of functions -- more
5588sensible handling of return values.
5589
5590- The officially registered Mac creator for Python files is 'Pyth'. This
5591replaces 'PYTH' which was used before but never registered.
5592
5593- Added regsub.capwords(). (XXX)
5594
5595- Added string.capwords(), string.capitalize() and string.translate().
5596(XXX)
5597
5598- Fixed an interface bug in the rexec module: it was impossible to pass a
5599hooks instance to the RExec class. rexec now also supports the dynamic
5600loading of modules from shared libraries. Some other interfaces have been
5601added too.
5602
5603- Module rfc822 now caches the headers in a dictionary for more efficient
5604lookup.
5605
5606- The sgmllib module now understands a limited number of SGML "shorthands"
5607like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
5608
5609- The tempfile module actually tries a number of different places to find a
5610usable temporary directory. (This was prompted by certain Linux
5611installations that appear to be missing a /usr/tmp directory.) [A bug in
5612the implementation that would ignore a pre-existing tmpdir global has been
5613fixed in beta3.]
5614
5615- Much improved and enhanved FileDialog module for Tkinter.
5616
5617- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
5618well as Tk 4.1).
5619
5620- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
5621s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
5622extension is called _socket and a wrapper module win/socket.py provides
5623"makefile()" and "dup()" functionality. On Windows, the select module
5624works only with socket objects.
5625
5626- Bugs in bsddb module fixed (e.g. missing default argument values).
5627
5628- The curses extension now includes <ncurses.h> when available.
5629
5630- The gdbm module now supports opening databases in "fast" mode by
5631specifying 'f' as the second character or the mode string.
5632
5633- new variables sys.prefix and sys.exec_prefix pass corresponding
5634configuration options / Makefile variables to the Python programmer.
5635
5636- The ``new'' module now supports creating new user-defined classes as well
5637as instances thereof.
5638
5639- The soundex module now sports get_soundex() to get the soundex value for an
5640arbitrary string (formerly it would only do soundex-based string
5641comparison) as well as doc strings.
5642
5643- New object type "cobject" to safely wrap void pointers for passing them
5644between various extension modules.
5645
5646- More efficient computation of float**smallint.
5647
5648- The mysterious bug whereby "x.x" (two occurrences of the same
5649one-character name) typed from the commandline would sometimes fail
5650mysteriously.
5651
5652- The initialization of the readline function can now be invoked by a C
5653extension through PyOS_ReadlineInit().
5654
5655- There's now an externally visible pointer PyImport_FrozenModules which
5656can be changed by an embedding application.
5657
5658- The argument parsing functions now support a new format character 'D' to
5659specify complex numbers.
5660
5661- Various memory leaks plugged and bugs fixed.
5662
5663- Improved support for posix threads (now that real implementations are
5664beginning to apepar). Still no fully functioning semaphores.
5665
5666- Some various and sundry improvements and new entries in the Tools
5667directory.
5668
5669
5670=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +00005671==> Release 1.3 (13 October 1995) <==
5672=====================================
5673
5674Major change
5675============
5676
5677Two words: Keyword Arguments. See the first section of Chapter 12 of
5678the Tutorial.
5679
5680(The rest of this file is textually the same as the remaining sections
5681of that chapter.)
5682
5683
5684Changes to the WWW and Internet tools
5685=====================================
5686
5687The "htmllib" module has been rewritten in an incompatible fashion.
5688The new version is considerably more complete (HTML 2.0 except forms,
5689but including all ISO-8859-1 entity definitions), and easy to use.
5690Small changes to "sgmllib" have also been made, to better match the
5691tokenization of HTML as recognized by other web tools.
5692
5693A new module "formatter" has been added, for use with the new
5694"htmllib" module.
5695
5696The "urllib"and "httplib" modules have been changed somewhat to allow
5697overriding unknown URL types and to support authentication. They now
5698use "mimetools.Message" instead of "rfc822.Message" to parse headers.
5699The "endrequest()" method has been removed from the HTTP class since
5700it breaks the interaction with some servers.
5701
5702The "rfc822.Message" class has been changed to allow a flag to be
5703passed in that says that the file is unseekable.
5704
5705The "ftplib" module has been fixed to be (hopefully) more robust on
5706Linux.
5707
5708Several new operations that are optionally supported by servers have
5709been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
5710
5711Other Language Changes
5712======================
5713
5714The "raise" statement now takes an optional argument which specifies
5715the traceback to be used when printing the exception's stack trace.
5716This must be a traceback object, such as found in "sys.exc_traceback".
5717When omitted or given as "None", the old behavior (to generate a stack
5718trace entry for the current stack frame) is used.
5719
5720The tokenizer is now more tolerant of alien whitespace. Control-L in
5721the leading whitespace of a line resets the column number to zero,
5722while Control-R just before the end of the line is ignored.
5723
5724Changes to Built-in Operations
5725==============================
5726
5727For file objects, "f.read(0)" and "f.readline(0)" now return an empty
5728string rather than reading an unlimited number of bytes. For the
5729latter, omit the argument altogether or pass a negative value.
5730
5731A new system variable, "sys.platform", has been added. It specifies
5732the current platform, e.g. "sunos5" or "linux1".
5733
5734The built-in functions "input()" and "raw_input()" now use the GNU
5735readline library when it has been configured (formerly, only
5736interactive input to the interpreter itself was read using GNU
5737readline). The GNU readline library provides elaborate line editing
5738and history. The Python debugger ("pdb") is the first beneficiary of
5739this change.
5740
5741Two new built-in functions, "globals()" and "locals()", provide access
5742to dictionaries containming current global and local variables,
5743respectively. (These augment rather than replace "vars()", which
5744returns the current local variables when called without an argument,
5745and a module's global variables when called with an argument of type
5746module.)
5747
5748The built-in function "compile()" now takes a third possible value for
5749the kind of code to be compiled: specifying "'single'" generates code
5750for a single interactive statement, which prints the output of
5751expression statements that evaluate to something else than "None".
5752
5753Library Changes
5754===============
5755
5756There are new module "ni" and "ihooks" that support importing modules
5757with hierarchical names such as "A.B.C". This is enabled by writing
5758"import ni; ni.ni()" at the very top of the main program. These
5759modules are amply documented in the Python source.
5760
5761The module "rexec" has been rewritten (incompatibly) to define a class
5762and to use "ihooks".
5763
5764The "string.split()" and "string.splitfields()" functions are now the
5765same function (the presence or absence of the second argument
5766determines which operation is invoked); similar for "string.join()"
5767and "string.joinfields()".
5768
5769The "Tkinter" module and its helper "Dialog" have been revamped to use
5770keyword arguments. Tk 4.0 is now the standard. A new module
5771"FileDialog" has been added which implements standard file selection
5772dialogs.
5773
5774The optional built-in modules "dbm" and "gdbm" are more coordinated
5775--- their "open()" functions now take the same values for their "flag"
5776argument, and the "flag" and "mode" argument have default values (to
5777open the database for reading only, and to create the database with
5778mode "0666" minuse the umask, respectively). The memory leaks have
5779finally been fixed.
5780
5781A new dbm-like module, "bsddb", has been added, which uses the BSD DB
5782package's hash method.
5783
5784A portable (though slow) dbm-clone, implemented in Python, has been
5785added for systems where none of the above is provided. It is aptly
5786dubbed "dumbdbm".
5787
5788The module "anydbm" provides a unified interface to "bsddb", "gdbm",
5789"dbm", and "dumbdbm", choosing the first one available.
5790
5791A new extension module, "binascii", provides a variety of operations
5792for conversion of text-encoded binary data.
5793
5794There are three new or rewritten companion modules implemented in
5795Python that can encode and decode the most common such formats: "uu"
5796(uuencode), "base64" and "binhex".
5797
5798A module to handle the MIME encoding quoted-printable has also been
5799added: "quopri".
5800
5801The parser module (which provides an interface to the Python parser's
5802abstract syntax trees) has been rewritten (incompatibly) by Fred
5803Drake. It now lets you change the parse tree and compile the result!
5804
5805The \code{syslog} module has been upgraded and documented.
5806
5807Other Changes
5808=============
5809
5810The dynamic module loader recognizes the fact that different filenames
5811point to the same shared library and loads the library only once, so
5812you can have a single shared library that defines multiple modules.
5813(SunOS / SVR4 style shared libraries only.)
5814
5815Jim Fulton's ``abstract object interface'' has been incorporated into
5816the run-time API. For more detailes, read the files
5817"Include/abstract.h" and "Objects/abstract.c".
5818
5819The Macintosh version is much more robust now.
5820
5821Numerous things I have forgotten or that are so obscure no-one will
5822notice them anyway :-)
5823
5824
Guido van Rossumf456b6d1995-01-04 19:20:37 +00005825===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +00005826==> Release 1.2 (13 April 1995) <==
5827===================================
5828
5829- Changes to Misc/python-mode.el:
5830 - Wrapping and indentation within triple quote strings should work
5831 properly now.
5832 - `Standard' bug reporting mechanism (use C-c C-b)
5833 - py-mark-block was moved to C-c C-m
5834 - C-c C-v shows you the python-mode version
5835 - a basic python-font-lock-keywords has been added for Emacs 19
5836 font-lock colorizations.
5837 - proper interaction with pending-del and del-sel modes.
5838 - New py-electric-colon (:) command for improved outdenting. Also
5839 py-indent-line (TAB) should handle outdented lines better.
5840 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
5841
5842- The Library Reference has been restructured, and many new and
5843existing modules are now documented, in particular the debugger and
5844the profiler, as well as the persistency and the WWW/Internet support
5845modules.
5846
5847- All known bugs have been fixed. For example the pow(2,2,3L) bug on
5848Linux has been fixed. Also the re-entrancy problems with __del__ have
5849been fixed.
5850
5851- All known memory leaks have been fixed.
5852
5853- Phase 2 of the Great Renaming has been executed. The header files
5854now use the new names (PyObject instead of object, etc.). The linker
5855also sees the new names. Most source files still use the old names,
5856by virtue of the rename2.h header file. If you include Python.h, you
5857only see the new names. Dynamically linked modules have to be
5858recompiled. (Phase 3, fixing the rest of the sources, will be
5859executed gradually with the release later versions.)
5860
5861- The hooks for implementing "safe-python" (better called "restricted
5862execution") are in place. Specifically, the import statement is
5863implemented by calling the built-in function __import__, and the
5864built-in names used in a particular scope are taken from the
5865dictionary __builtins__ in that scope's global dictionary. See also
5866the new (unsupported, undocumented) module rexec.py.
5867
5868- The import statement now supports the syntax "import a.b.c" and
5869"from a.b.c import name". No officially supported implementation
5870exists, but one can be prototyped by replacing the built-in __import__
5871function. A proposal by Ken Manheimer is provided as newimp.py.
5872
5873- All machinery used by the import statement (or the built-in
5874__import__ function) is now exposed through the new built-in module
5875"imp" (see the library reference manual). All dynamic loading
5876machinery is moved to the new file importdl.c.
5877
5878- Persistent storage is supported through the use of the modules
5879"pickle" and "shelve" (implemented in Python). There's also a "copy"
5880module implementing deepcopy and normal (shallow) copy operations.
5881See the library reference manual.
5882
5883- Documentation strings for many objects types are accessible through
5884the __doc__ attribute. Modules, classes and functions support special
5885syntax to initialize the __doc__ attribute: if the first statement
5886consists of just a string literal, that string literal becomes the
5887value of the __doc__ attribute. The default __doc__ attribute is
5888None. Documentation strings are also supported for built-in
5889functions, types and modules; however this feature hasn't been widely
5890used yet. See the 'new' module for an example. (Basically, the type
5891object's tp_doc field contains the doc string for the type, and the
58924th member of the methodlist structure contains the doc string for the
5893method.)
5894
5895- The __coerce__ and __cmp__ methods for user-defined classes once
5896again work as expected. As an example, there's a new standard class
5897Complex in the library.
5898
5899- The functions posix.popen() and posix.fdopen() now have an optional
5900third argument to specify the buffer size, and default their second
5901(mode) argument to 'r' -- in analogy to the builtin open() function.
5902The same applies to posixfile.open() and the socket method makefile().
5903
5904- The thread.exit_thread() function now raises SystemExit so that
5905'finally' clauses are honored and a memory leak is plugged.
5906
5907- Improved X11 and Motif support, by Sjoerd Mullender. This extension
5908is being maintained and distributed separately.
5909
5910- Improved support for the Apple Macintosh, in part by Jack Jansen,
5911e.g. interfaces to (a few) resource mananger functions, get/set file
5912type and creator, gestalt, sound manager, speech manager, MacTCP, comm
5913toolbox, and the think C console library. This is being maintained
5914and distributed separately.
5915
5916- Improved version for Windows NT, by Mark Hammond. This is being
5917maintained and distributed separately.
5918
5919- Used autoconf 2.0 to generate the configure script. Adapted
5920configure.in to use the new features in autoconf 2.0.
5921
5922- It now builds on the NeXT without intervention, even on the 3.3
5923Sparc pre-release.
5924
5925- Characters passed to isspace() and friends are masked to nonnegative
5926values.
5927
5928- Correctly compute pow(-3.0, 3).
5929
5930- Fix portability problems with getopt (configure now checks for a
5931non-GNU getopt).
5932
5933- Don't add frozenmain.o to libPython.a.
5934
5935- Exceptions can now be classes. ALl built-in exceptions are still
5936string objects, but this will change in the future.
5937
5938- The socket module exports a long list of socket related symbols.
5939(More built-in modules will export their symbolic constants instead of
5940relying on a separately generated Python module.)
5941
5942- When a module object is deleted, it clears out its own dictionary.
5943This fixes a circularity in the references between functions and
5944their global dictionary.
5945
5946- Changed the error handling by [new]getargs() e.g. for "O&".
5947
5948- Dynamic loading of modules using shared libraries is supported for
5949several new platforms.
5950
5951- Support "O&", "[...]" and "{...}" in mkvalue().
5952
5953- Extension to findmethod(): findmethodinchain() (where a chain is a
5954linked list of methodlist arrays). The calling interface for
5955findmethod() has changed: it now gets a pointer to the (static!)
5956methodlist structure rather than just to the function name -- this
5957saves copying flags etc. into the (short-lived) method object.
5958
5959- The callable() function is now public.
5960
5961- Object types can define a few new operations by setting function
5962pointers in the type object structure: tp_call defines how an object
5963is called, and tp_str defines how an object's str() is computed.
5964
5965
5966===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +00005967==> Release 1.1.1 (10 Nov 1994) <==
5968===================================
5969
5970This is a pure bugfix release again. See the ChangeLog file for details.
5971
5972One exception: a few new features were added to tkinter.
5973
5974
5975=================================
5976==> Release 1.1 (11 Oct 1994) <==
5977=================================
5978
5979This release adds several new features, improved configuration and
5980portability, and fixes more bugs than I can list here (including some
5981memory leaks).
5982
5983The source compiles and runs out of the box on more platforms than
5984ever -- including Windows NT. Makefiles or projects for a variety of
5985non-UNIX platforms are provided.
5986
5987APOLOGY: some new features are badly documented or not at all. I had
5988the choice -- postpone the new release indefinitely, or release it
5989now, with working code but some undocumented areas. The problem with
5990postponing the release is that people continue to suffer from existing
5991bugs, and send me patches based on the previous release -- which I
5992can't apply directly because my own source has changed. Also, some
5993new modules (like signal) have been ready for release for quite some
5994time, and people are anxiously waiting for them. In the case of
5995signal, the interface is simple enough to figure out without
5996documentation (if you're anxious enough :-). In this case it was not
5997simple to release the module on its own, since it relies on many small
5998patches elsewhere in the source.
5999
6000For most new Python modules, the source code contains comments that
6001explain how to use them. Documentation for the Tk interface, written
6002by Matt Conway, is available as tkinter-doc.tar.gz from the Python
6003home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
6004new operator overloading facilities, have a look at Demo/classes:
6005Complex.py and Rat.py show how to implement a numeric type without and
6006with __coerce__ method. Also have a look at the end of the Tutorial
6007document (Doc/tut.tex). If you're still confused: use the newsgroup
6008or mailing list.
6009
6010
6011New language features:
6012
6013 - More flexible operator overloading for user-defined classes
6014 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
6015
6016 - Classes can define methods named __getattr__, __setattr__ and
6017 __delattr__ to trap attribute accesses. See end of tutorial.
6018
6019 - Classes can define method __call__ so instances can be called
6020 directly. See end of tutorial.
6021
6022
6023New support facilities:
6024
6025 - The Makefiles (for the base interpreter as well as for extensions)
6026 now support creating dynamically loadable modules if the platform
6027 supports shared libraries.
6028
6029 - Passing the interpreter a .pyc file as script argument will execute
6030 the code in that file. (On the Mac such files can be double-clicked!)
6031
6032 - New Freeze script, to create independently distributable "binaries"
6033 of Python programs -- look in Demo/freeze
6034
6035 - Improved h2py script (in Demo/scripts) follows #includes and
6036 supports macros with one argument
6037
6038 - New module compileall generates .pyc files for all modules in a
6039 directory (tree) without also executing them
6040
6041 - Threads should work on more platforms
6042
6043
6044New built-in modules:
6045
6046 - tkinter (support for Tcl's Tk widget set) is now part of the base
6047 distribution
6048
6049 - signal allows catching or ignoring UNIX signals (unfortunately still
6050 undocumented -- any taker?)
6051
6052 - termios provides portable access to POSIX tty settings
6053
6054 - curses provides an interface to the System V curses library
6055
6056 - syslog provides an interface to the (BSD?) syslog daemon
6057
6058 - 'new' provides interfaces to create new built-in object types
6059 (e.g. modules and functions)
6060
6061 - sybase provides an interface to SYBASE database
6062
6063
6064New/obsolete built-in methods:
6065
6066 - callable(x) tests whether x can be called
6067
6068 - sockets now have a setblocking() method
6069
6070 - sockets no longer have an allowbroadcast() method
6071
6072 - socket methods send() and sendto() return byte count
6073
6074
6075New standard library modules:
6076
6077 - types.py defines standard names for built-in types, e.g. StringType
6078
6079 - urlparse.py parses URLs according to the latest Internet draft
6080
6081 - uu.py does uuencode/uudecode (not the fastest in the world, but
6082 quicker than installing uuencode on a non-UNIX machine :-)
6083
6084 - New, faster and more powerful profile module.py
6085
6086 - mhlib.py provides interface to MH folders and messages
6087
6088
6089New facilities for extension writers (unfortunately still
6090undocumented):
6091
6092 - newgetargs() supports optional arguments and improved error messages
6093
6094 - O!, O& O? formats for getargs allow more versatile type checking of
6095 non-standard types
6096
6097 - can register pending asynchronous callback, to be called the next
6098 time the Python VM begins a new instruction (Py_AddPendingCall)
6099
6100 - can register cleanup routines to be called when Python exits
6101 (Py_AtExit)
6102
6103 - makesetup script understands C++ files in Setup file (use file.C
6104 or file.cc)
6105
6106 - Make variable OPT is passed on to sub-Makefiles
6107
6108 - An init<module>() routine may signal an error by not entering
6109 the module in the module table and raising an exception instead
6110
6111 - For long module names, instead of foobarbletchmodule.c you can
6112 use foobarbletch.c
6113
6114 - getintvalue() and getfloatvalue() try to convert any object
6115 instead of requiring an "intobject" or "floatobject"
6116
6117 - All the [new]getargs() formats that retrieve an integer value
6118 will now also work if a float is passed
6119
6120 - C function listtuple() converts list to tuple, fast
6121
6122 - You should now call sigcheck() instead of intrcheck();
6123 sigcheck() also sets an exception when it returns nonzero
6124
6125
Guido van Rossumaa253861994-10-06 17:18:57 +00006126====================================
6127==> Release 1.0.3 (14 July 1994) <==
6128====================================
6129
6130This release consists entirely of bug fixes to the C sources; see the
6131head of ../ChangeLog for a complete list. Most important bugs fixed:
6132
6133- Sometimes the format operator (string%expr) would drop the last
6134character of the format string
6135
6136- Tokenizer looped when last line did not end in \n
6137
6138- Bug when triple-quoted string ended in quote plus newline
6139
6140- Typo in socketmodule (listen) (== instead of =)
6141
6142- typing vars() at the >>> prompt would cause recursive output
6143
6144
6145==================================
6146==> Release 1.0.2 (4 May 1994) <==
6147==================================
6148
6149Overview of the most visible changes. Bug fixes are not listed. See
6150also ChangeLog.
6151
6152Tokens
6153------
6154
6155* String literals follow Standard C rules: they may be continued on
6156the next line using a backslash; adjacent literals are concatenated
6157at compile time.
6158
6159* A new kind of string literals, surrounded by triple quotes (""" or
6160'''), can be continued on the next line without a backslash.
6161
6162Syntax
6163------
6164
6165* Function arguments may have a default value, e.g. def f(a, b=1);
6166defaults are evaluated at function definition time. This also applies
6167to lambda.
6168
6169* The try-except statement has an optional else clause, which is
6170executed when no exception occurs in the try clause.
6171
6172Interpreter
6173-----------
6174
6175* The result of a statement-level expression is no longer printed,
6176except_ for expressions entered interactively. Consequently, the -k
6177command line option is gone.
6178
6179* The result of the last printed interactive expression is assigned to
6180the variable '_'.
6181
6182* Access to implicit global variables has been speeded up by removing
6183an always-failing dictionary lookup in the dictionary of local
6184variables (mod suggested by Steve Makewski and Tim Peters).
6185
6186* There is a new command line option, -u, to force stdout and stderr
6187to be unbuffered.
6188
6189* Incorporated Steve Majewski's mods to import.c for dynamic loading
6190under AIX.
6191
6192* Fewer chances of dumping core when trying to reload or re-import
6193static built-in, dynamically loaded built-in, or frozen modules.
6194
6195* Loops over sequences now don't ask for the sequence's length when
6196they start, but try to access items 0, 1, 2, and so on until they hit
6197an IndexError. This makes it possible to create classes that generate
6198infinite or indefinite sequences a la Steve Majewski. This affects
6199for loops, the (not) in operator, and the built-in functions filter(),
6200map(), max(), min(), reduce().
6201
6202Changed Built-in operations
6203---------------------------
6204
6205* The '%' operator on strings (printf-style formatting) supports a new
6206feature (adapted from a patch by Donald Beaudry) to allow
6207'%(<key>)<format>' % {...} to take values from a dictionary by name
6208instead of from a tuple by position (see also the new function
6209vars()).
6210
6211* The '%s' formatting operator is changed to accept any type and
6212convert it to a string using str().
6213
6214* Dictionaries with more than 20,000 entries can now be created
6215(thanks to Steve Kirsch).
6216
6217New Built-in Functions
6218----------------------
6219
6220* vars() returns a dictionary containing the local variables; vars(m)
6221returns a dictionary containing the variables of module m. Note:
6222dir(x) is now equivalent to vars(x).keys().
6223
6224Changed Built-in Functions
6225--------------------------
6226
6227* open() has an optional third argument to specify the buffer size: 0
6228for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
6229for default.
6230
6231* open()'s second argument is now optional; it defaults to "r".
6232
6233* apply() now checks that its second argument is indeed a tuple.
6234
6235New Built-in Modules
6236--------------------
6237
6238Changed Built-in Modules
6239------------------------
6240
6241The thread module no longer supports exit_prog().
6242
6243New Python Modules
6244------------------
6245
6246* Module addpack contains a standard interface to modify sys.path to
6247find optional packages (groups of related modules).
6248
6249* Module urllib contains a number of functions to access
6250World-Wide-Web files specified by their URL.
6251
6252* Module httplib implements the client side of the HTTP protocol used
6253by World-Wide-Web servers.
6254
6255* Module gopherlib implements the client side of the Gopher protocol.
6256
6257* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
6258style mailbox files.
6259
6260* Module random contains various random distributions, e.g. gauss().
6261
6262* Module lockfile locks and unlocks open files using fcntl (inspired
6263by a similar module by Andy Bensky).
6264
6265* Module ntpath (by Jaap Vermeulen) implements path operations for
6266Windows/NT.
6267
6268* Module test_thread (in Lib/test) contains a small test set for the
6269thread module.
6270
6271Changed Python Modules
6272----------------------
6273
6274* The string module's expandvars() function is now documented and is
6275implemented in Python (using regular expressions) instead of forking
6276off a shell process.
6277
6278* Module rfc822 now supports accessing the header fields using the
6279mapping/dictionary interface, e.g. h['subject'].
6280
6281* Module pdb now makes it possible to set a break on a function
6282(syntax: break <expression>, where <expression> yields a function
6283object).
6284
6285Changed Demos
6286-------------
6287
6288* The Demo/scripts/freeze.py script is working again (thanks to Jaap
6289Vermeulen).
6290
6291New Demos
6292---------
6293
6294* Demo/threads/Generator.py is a proposed interface for restartable
6295functions a la Tim Peters.
6296
6297* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
6298directory full of HTML pages which between them contain links to all
6299the newsgroups available on your server.
6300
6301* Demo/dns contains a DNS (Domain Name Server) client.
6302
6303* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
6304nice enhanced Python shell!!!).
6305
6306* Demo/turing contains a Turing machine by Amrit Prem.
6307
6308Documentation
6309-------------
6310
6311* Documented new language features mentioned above (but not all new
6312modules).
6313
6314* Added a chapter to the Tutorial describing recent additions to
6315Python.
6316
6317* Clarified some sentences in the reference manual,
6318e.g. break/continue, local/global scope, slice assignment.
6319
6320Source Structure
6321----------------
6322
6323* Moved Include/tokenizer.h to Parser/tokenizer.h.
6324
6325* Added Python/getopt.c for systems that don't have it.
6326
6327Emacs mode
6328----------
6329
6330* Indentation of continuated lines is done more intelligently;
6331consequently the variable py-continuation-offset is gone.
6332
6333========================================
6334==> Release 1.0.1 (15 February 1994) <==
6335========================================
6336
6337* Many portability fixes should make it painless to build Python on
6338several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
6339
6340* Fixed test for <stdarg.h> -- this broke on some platforms.
6341
6342* Fixed test for shared library dynalic loading -- this broke on SunOS
63434.x using the GNU loader.
6344
6345* Changed order and number of SVR4 networking libraries (it is now
6346-lsocket -linet -lnsl, if these libraries exist).
6347
6348* Installing the build intermediate stages with "make libainstall" now
6349also installs config.c.in, Setup and makesetup, which are used by the
6350new Extensions mechanism.
6351
6352* Improved README file contains more hints and new troubleshooting
6353section.
6354
6355* The built-in module strop now defines fast versions of three more
6356functions of the standard string module: atoi(), atol() and atof().
6357The strop versions of atoi() and atol() support an optional second
6358argument to specify the base (default 10). NOTE: you don't have to
6359explicitly import strop to use the faster versions -- the string
6360module contains code to let versions from stop override the default
6361versions.
6362
6363* There is now a working Lib/dospath.py for those who use Python under
6364DOS (or Windows). Thanks, Jaap!
6365
6366* There is now a working Modules/dosmodule.c for DOS (or Windows)
6367system calls.
6368
6369* Lib.os.py has been reorganized (making it ready for more operating
6370systems).
6371
6372* Lib/ospath.py is now obsolete (use os.path instead).
6373
6374* Many fixes to the tutorial to make it match Python 1.0. Thanks,
6375Tim!
6376
6377* Fixed Doc/Makefile, Doc/README and various scripts there.
6378
6379* Added missing description of fdopen to Doc/libposix.tex.
6380
6381* Made cleanup() global, for the benefit of embedded applications.
6382
6383* Added parsing of addresses and dates to Lib/rfc822.py.
6384
6385* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
6386them usable at all.
6387
6388* New module Lib/wave.py reads RIFF (*.wav) audio files.
6389
6390* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
6391belongs.
6392
6393* New options and comments for Modules/makesetup (used by new
6394Extension mechanism).
6395
6396* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
6397and elsewhere.
6398
6399* Fixed coredump in filter(None, 'abcdefg').
6400
6401
6402=======================================
6403==> Release 1.0.0 (26 January 1994) <==
6404=======================================
6405
6406As is traditional, so many things have changed that I can't pretend to
6407be complete in these release notes, but I'll try anyway :-)
6408
6409Note that the very last section is labeled "remaining bugs".
6410
6411
6412Source organization and build process
6413-------------------------------------
6414
6415* The sources have finally been split: instead of a single src
6416subdirectory there are now separate directories Include, Parser,
6417Grammar, Objects, Python and Modules. Other directories also start
6418with a capital letter: Misc, Doc, Lib, Demo.
6419
6420* A few extensions (notably Amoeba and X support) have been moved to a
6421separate subtree Extensions, which is no longer in the core
6422distribution, but separately ftp'able as extensions.tar.Z. (The
6423distribution contains a placeholder Ext-dummy with a description of
6424the Extensions subtree as well as the most recent versions of the
6425scripts used there.)
6426
6427* A few large specialized demos (SGI video and www) have been
6428moved to a separate subdirectory Demo2, which is no longer in the core
6429distribution, but separately ftp'able as demo2.tar.Z.
6430
6431* Parts of the standard library have been moved to subdirectories:
6432there are now standard subdirectories stdwin, test, sgi and sun4.
6433
6434* The configuration process has radically changed: I now use GNU
6435autoconf. This makes it much easier to build on new Unix flavors, as
6436well as fully supporting VPATH (if your Make has it). The scripts
6437Configure.py and Addmodule.sh are no longer needed. Many source files
6438have been adapted in order to work with the symbols that the configure
6439script generated by autoconf defines (or not); the resulting source is
6440much more portable to different C compilers and operating systems,
6441even non Unix systems (a Mac port was done in an afternoon). See the
6442toplevel README file for a description of the new build process.
6443
6444* GNU readline (a slightly newer version) is now a subdirectory of the
6445Python toplevel. It is still not automatically configured (being
6446totally autoconf-unaware :-). One problem has been solved: typing
6447Control-C to a readline prompt will now work. The distribution no
6448longer contains a "super-level" directory (above the python toplevel
6449directory), and dl, dl-dld and GNU dld are no longer part of the
6450Python distribution (you can still ftp them from
6451ftp.cwi.nl:/pub/dynload).
6452
6453* The DOS functions have been taken out of posixmodule.c and moved
6454into a separate file dosmodule.c.
6455
6456* There's now a separate file version.c which contains nothing but
6457the version number.
6458
6459* The actual main program is now contained in config.c (unless NO_MAIN
6460is defined); pythonmain.c now contains a function realmain() which is
6461called from config.c's main().
6462
6463* All files needed to use the built-in module md5 are now contained in
6464the distribution. The module has been cleaned up considerably.
6465
6466
6467Documentation
6468-------------
6469
6470* The library manual has been split into many more small latex files,
6471so it is easier to edit Doc/lib.tex file to create a custom library
6472manual, describing only those modules supported on your system. (This
6473is not automated though.)
6474
6475* A fourth manual has been added, titled "Extending and Embedding the
6476Python Interpreter" (Doc/ext.tex), which collects information about
6477the interpreter which was previously spread over several files in the
6478misc subdirectory.
6479
6480* The entire documentation is now also available on-line for those who
6481have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
6482"http://www.cwi.nl/~guido/Python.html".
6483
6484
6485Syntax
6486------
6487
6488* Strings may now be enclosed in double quotes as well as in single
6489quotes. There is no difference in interpretation. The repr() of
6490string objects will use double quotes if the string contains a single
6491quote and no double quotes. Thanks to Amrit Prem for these changes!
6492
6493* There is a new keyword 'exec'. This replaces the exec() built-in
6494function. If a function contains an exec statement, local variable
6495optimization is not performed for that particular function, thus
6496making assignment to local variables in exec statements less
6497confusing. (As a consequence, os.exec and python.exec have been
6498renamed to execv.)
6499
6500* There is a new keyword 'lambda'. An expression of the form
6501
6502 lambda <parameters> : <expression>
6503
6504yields an anonymous function. This is really only syntactic sugar;
6505you can just as well define a local function using
6506
6507 def some_temporary_name(<parameters>): return <expression>
6508
6509Lambda expressions are particularly useful in combination with map(),
6510filter() and reduce(), described below. Thanks to Amrit Prem for
6511submitting this code (as well as map(), filter(), reduce() and
6512xrange())!
6513
6514
6515Built-in functions
6516------------------
6517
6518* The built-in module containing the built-in functions is called
6519__builtin__ instead of builtin.
6520
6521* New built-in functions map(), filter() and reduce() perform standard
6522functional programming operations (though not lazily):
6523
6524- map(f, seq) returns a new sequence whose items are the items from
6525seq with f() applied to them.
6526
6527- filter(f, seq) returns a subsequence of seq consisting of those
6528items for which f() is true.
6529
6530- reduce(f, seq, initial) returns a value computed as follows:
6531 acc = initial
6532 for item in seq: acc = f(acc, item)
6533 return acc
6534
6535* New function xrange() creates a "range object". Its arguments are
6536the same as those of range(), and when used in a for loop a range
6537objects also behaves identical. The advantage of xrange() over
6538range() is that its representation (if the range contains many
6539elements) is much more compact than that of range(). The disadvantage
6540is that the result cannot be used to initialize a list object or for
6541the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
6542architectures, benchmarks have shown that "for i in range(...): ..."
6543actually executes *faster* than "for i in xrange(...): ...", but on
6544memory starved machines like PCs running DOS range(100000) may be just
6545too big to be represented at all...
6546
6547* Built-in function exec() has been replaced by the exec statement --
6548see above.
6549
6550
6551The interpreter
6552---------------
6553
6554* Syntax errors are now not printed to stderr by the parser, but
6555rather the offending line and other relevant information are packed up
6556in the SyntaxError exception argument. When the main loop catches a
6557SyntaxError exception it will print the error in the same format as
6558previously, but at the proper position in the stack traceback.
6559
6560* You can now set a maximum to the number of traceback entries
6561printed by assigning to sys.tracebacklimit. The default is 1000.
6562
6563* The version number in .pyc files has changed yet again.
6564
6565* It is now possible to have a .pyc file without a corresponding .py
6566file. (Warning: this may break existing installations if you have an
6567old .pyc file lingering around somewhere on your module search path
6568without a corresponding .py file, when there is a .py file for a
6569module of the same name further down the path -- the new interpreter
6570will find the first .pyc file and complain about it, while the old
6571interpreter would ignore it and use the .py file further down.)
6572
6573* The list sys.builtin_module_names is now sorted and also contains
6574the names of a few hardwired built-in modules (sys, __main__ and
6575__builtin__).
6576
6577* A module can now find its own name by accessing the global variable
6578__name__. Assigning to this variable essentially renames the module
6579(it should also be stored under a different key in sys.modules).
6580A neat hack follows from this: a module that wants to execute a main
6581program when called as a script no longer needs to compare
6582sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
6583
6584* When an object is printed by the print statement, its implementation
6585of str() is used. This means that classes can define __str__(self) to
6586direct how their instances are printed. This is different from
6587__repr__(self), which should define an unambigous string
6588representation of the instance. (If __str__() is not defined, it
6589defaults to __repr__().)
6590
6591* Functions and code objects can now be compared meaningfully.
6592
6593* On systems supporting SunOS or SVR4 style shared libraries, dynamic
6594loading of modules using shared libraries is automatically configured.
6595Thanks to Bill Jansen and Denis Severson for contributing this change!
6596
6597
6598Built-in objects
6599----------------
6600
6601* File objects have acquired a new method writelines() which is the
6602reverse of readlines(). (It does not actually write lines, just a
6603list of strings, but the symmetry makes the choice of name OK.)
6604
6605
6606Built-in modules
6607----------------
6608
6609* Socket objects no longer support the avail() method. Use the select
6610module instead, or use this function to replace it:
6611
6612 def avail(f):
6613 import select
6614 return f in select.select([f], [], [], 0)[0]
6615
6616* Initialization of stdwin is done differently. It actually modifies
6617sys.argv (taking out the options the X version of stdwin recognizes)
6618the first time it is imported.
6619
6620* A new built-in module parser provides a rudimentary interface to the
6621python parser. Corresponding standard library modules token and symbol
6622defines the numeric values of tokens and non-terminal symbols.
6623
6624* The posix module has aquired new functions setuid(), setgid(),
6625execve(), and exec() has been renamed to execv().
6626
6627* The array module is extended with 8-byte object swaps, the 'i'
6628format character, and a reverse() method. The read() and write()
6629methods are renamed to fromfile() and tofile().
6630
6631* The rotor module has freed of portability bugs. This introduces a
6632backward compatibility problem: strings encoded with the old rotor
6633module can't be decoded by the new version.
6634
6635* For select.select(), a timeout (4th) argument of None means the same
6636as leaving the timeout argument out.
6637
6638* Module strop (and hence standard library module string) has aquired
6639a new function: rindex(). Thanks to Amrit Prem!
6640
6641* Module regex defines a new function symcomp() which uses an extended
6642regular expression syntax: parenthesized subexpressions may be labeled
6643using the form "\(<labelname>...\)", and the group() method can return
6644sub-expressions by name. Thanks to Tracy Tims for these changes!
6645
6646* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
6647Mullender!
6648
6649
6650Standard library modules
6651------------------------
6652
6653* The library is now split in several subdirectories: all stuff using
6654stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
6655is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
6656test modules are in Lib/test. The default module search path will
6657include all relevant subdirectories by default.
6658
6659* Module os now knows about trying to import dos. It defines
6660functions execl(), execle(), execlp() and execvp().
6661
6662* New module dospath (should be attacked by a DOS hacker though).
6663
6664* All modules defining classes now define __init__() constructors
6665instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
6666
6667* Some minor changes and bugfixes module ftplib (mostly Steve
6668Majewski's suggestions); the debug() method is renamed to
6669set_debuglevel().
6670
6671* Some new test modules (not run automatically by testall though):
6672test_audioop, test_md5, test_rgbimg, test_select.
6673
6674* Module string now defines rindex() and rfind() in analogy of index()
6675and find(). It also defines atof() and atol() (and corresponding
6676exceptions) in analogy to atoi().
6677
6678* Added help() functions to modules profile and pdb.
6679
6680* The wdb debugger (now in Lib/stdwin) now shows class or instance
6681variables on a double click. Thanks to Sjoerd Mullender!
6682
6683* The (undocumented) module lambda has gone -- you couldn't import it
6684any more, and it was basically more a demo than a library module...
6685
6686
6687Multimedia extensions
6688---------------------
6689
6690* The optional built-in modules audioop and imageop are now standard
6691parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
6692for contributing this code!
6693
6694* There's a new operation in audioop: minmax().
6695
6696* There's a new built-in module called rgbimg which supports portable
6697efficient reading of SGI RCG image files. Thanks also to Paul
6698Haeberli for the original code! (Who will contribute a GIF reader?)
6699
6700* The module aifc is gone -- you should now always use aifc, which has
6701received a facelift.
6702
6703* There's a new module sunau., for reading Sun (and NeXT) audio files.
6704
6705* There's a new module audiodev which provides a uniform interface to
6706(SGI Indigo and Sun Sparc) audio hardware.
6707
6708* There's a new module sndhdr which recognizes various sound files by
6709looking in their header and checking for various magic words.
6710
6711
6712Optimizations
6713-------------
6714
6715* Most optimizations below can be configured by compile-time flags.
6716Thanks to Sjoerd Mullender for submitting these optimizations!
6717
6718* Small integers (default -1..99) are shared -- i.e. if two different
6719functions compute the same value it is possible (but not
6720guaranteed!!!) that they return the same *object*. Python programs
6721can detect this but should *never* rely on it.
6722
6723* Empty tuples (which all compare equal) are shared in the same
6724manner.
6725
6726* Tuples of size up to 20 (default) are put in separate free lists
6727when deallocated.
6728
6729* There is a compile-time option to cache a string's hash function,
6730but this appeared to have a negligeable effect, and as it costs 4
6731bytes per string it is disabled by default.
6732
6733
6734Embedding Python
6735----------------
6736
6737* The initialization interface has been simplified somewhat. You now
6738only call "initall()" to initialize the interpreter.
6739
6740* The previously announced renaming of externally visible identifiers
6741has not been carried out. It will happen in a later release. Sorry.
6742
6743
6744Miscellaneous bugs that have been fixed
6745---------------------------------------
6746
6747* All known portability bugs.
6748
6749* Version 0.9.9 dumped core in <listobject>.sort() which has been
6750fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
6751on the mailing list while I was away!
6752
6753* Core dump on a format string ending in '%', e.g. in the expression
6754'%' % None.
6755
6756* The array module yielded a bogus result for concatenation (a+b would
6757yield a+a).
6758
6759* Some serious memory leaks in strop.split() and strop.splitfields().
6760
6761* Several problems with the nis module.
6762
6763* Subtle problem when copying a class method from another class
6764through assignment (the method could not be called).
6765
6766
6767Remaining bugs
6768--------------
6769
6770* One problem with 64-bit machines remains -- since .pyc files are
6771portable and use only 4 bytes to represent an integer object, 64-bit
6772integer literals are silently truncated when written into a .pyc file.
6773Work-around: use eval('123456789101112').
6774
6775* The freeze script doesn't work any more. A new and more portable
6776one can probably be cooked up using tricks from Extensions/mkext.py.
6777
6778* The dos support hasn't been tested yet. (Really Soon Now we should
6779have a PC with a working C compiler!)
6780
6781
Guido van Rossuma7925f11994-01-26 10:20:16 +00006782===================================
6783==> Release 0.9.9 (29 Jul 1993) <==
6784===================================
6785
6786I *believe* these are the main user-visible changes in this release,
6787but there may be others. SGI users may scan the {src,lib}/ChangeLog
6788files for improvements of some SGI specific modules, e.g. aifc and
6789cl. Developers of extension modules should also read src/ChangeLog.
6790
6791
6792Naming of C symbols used by the Python interpreter
6793--------------------------------------------------
6794
6795* This is the last release using the current naming conventions. New
6796naming conventions are explained in the file misc/NAMING.
6797Summarizing, all externally visible symbols get (at least) a "Py"
6798prefix, and most functions are renamed to the standard form
6799PyModule_FunctionName.
6800
6801* Writers of extensions are urged to start using the new naming
6802conventions. The next release will use the new naming conventions
6803throughout (it will also have a different source directory
6804structure).
6805
6806* As a result of the preliminary work for the great renaming, many
6807functions that were accidentally global have been made static.
6808
6809
6810BETA X11 support
6811----------------
6812
6813* There are now modules interfacing to the X11 Toolkit Intrinsics, the
6814Athena widgets, and the Motif 1.1 widget set. These are not yet
6815documented except through the examples and README file in the demo/x11
6816directory. It is expected that this interface will be replaced by a
6817more powerful and correct one in the future, which may or may not be
6818backward compatible. In other words, this part of the code is at most
6819BETA level software! (Note: the rest of Python is rock solid as ever!)
6820
6821* I understand that the above may be a bit of a disappointment,
6822however my current schedule does not allow me to change this situation
6823before putting the release out of the door. By releasing it
6824undocumented and buggy, at least some of the (working!) demo programs,
6825like itr (my Internet Talk Radio browser) become available to a larger
6826audience.
6827
6828* There are also modules interfacing to SGI's "Glx" widget (a GL
6829window wrapped in a widget) and to NCSA's "HTML" widget (which can
6830format HyperText Markup Language, the document format used by the
6831World Wide Web).
6832
6833* I've experienced some problems when building the X11 support. In
6834particular, the Xm and Xaw widget sets don't go together, and it
6835appears that using X11R5 is better than using X11R4. Also the threads
6836module and its link time options may spoil things. My own strategy is
6837to build two Python binaries: one for use with X11 and one without
6838it, which can contain a richer set of built-in modules. Don't even
6839*think* of loading the X11 modules dynamically...
6840
6841
6842Environmental changes
6843---------------------
6844
6845* Compiled files (*.pyc files) created by this Python version are
6846incompatible with those created by the previous version. Both
6847versions detect this and silently create a correct version, but it
6848means that it is not a good idea to use the same library directory for
6849an old and a new interpreter, since they will start to "fight" over
6850the *.pyc files...
6851
6852* When a stack trace is printed, the exception is printed last instead
6853of first. This means that if the beginning of the stack trace
6854scrolled out of your window you can still see what exception caused
6855it.
6856
6857* Sometimes interrupting a Python operation does not work because it
6858hangs in a blocking system call. You can now kill the interpreter by
6859interrupting it three times. The second time you interrupt it, a
6860message will be printed telling you that the third interrupt will kill
6861the interpreter. The "sys.exitfunc" feature still makes limited
6862clean-up possible in this case.
6863
6864
6865Changes to the command line interface
6866-------------------------------------
6867
6868* The python usage message is now much more informative.
6869
6870* New option -i enters interactive mode after executing a script --
6871useful for debugging.
6872
6873* New option -k raises an exception when an expression statement
6874yields a value other than None.
6875
6876* For each option there is now also a corresponding environment
6877variable.
6878
6879
6880Using Python as an embedded language
6881------------------------------------
6882
6883* The distribution now contains (some) documentation on the use of
6884Python as an "embedded language" in other applications, as well as a
6885simple example. See the file misc/EMBEDDING and the directory embed/.
6886
6887
6888Speed improvements
6889------------------
6890
6891* Function local variables are now generally stored in an array and
6892accessed using an integer indexing operation, instead of through a
6893dictionary lookup. (This compensates the somewhat slower dictionary
6894lookup caused by the generalization of the dictionary module.)
6895
6896
6897Changes to the syntax
6898---------------------
6899
6900* Continuation lines can now *sometimes* be written without a
6901backslash: if the continuation is contained within nesting (), [] or
6902{} brackets the \ may be omitted. There's a much improved
6903python-mode.el in the misc directory which knows about this as well.
6904
6905* You can no longer use an empty set of parentheses to define a class
6906without base classes. That is, you no longer write this:
6907
6908 class Foo(): # syntax error
6909 ...
6910
6911You must write this instead:
6912
6913 class Foo:
6914 ...
6915
6916This was already the preferred syntax in release 0.9.8 but many
6917people seemed not to have picked it up. There's a Python script that
6918fixes old code: demo/scripts/classfix.py.
6919
6920* There's a new reserved word: "access". The syntax and semantics are
6921still subject of of research and debate (as well as undocumented), but
6922the parser knows about the keyword so you must not use it as a
6923variable, function, or attribute name.
6924
6925
6926Changes to the semantics of the language proper
6927-----------------------------------------------
6928
6929* The following compatibility hack is removed: if a function was
6930defined with two or more arguments, and called with a single argument
6931that was a tuple with just as many arguments, the items of this tuple
6932would be used as the arguments. This is no longer supported.
6933
6934
6935Changes to the semantics of classes and instances
6936-------------------------------------------------
6937
6938* Class variables are now also accessible as instance variables for
6939reading (assignment creates an instance variable which overrides the
6940class variable of the same name though).
6941
6942* If a class attribute is a user-defined function, a new kind of
6943object is returned: an "unbound method". This contains a pointer to
6944the class and can only be called with a first argument which is a
6945member of that class (or a derived class).
6946
6947* If a class defines a method __init__(self, arg1, ...) then this
6948method is called when a class instance is created by the classname()
6949construct. Arguments passed to classname() are passed to the
6950__init__() method. The __init__() methods of base classes are not
6951automatically called; the derived __init__() method must call these if
6952necessary (this was done so the derived __init__() method can choose
6953the call order and arguments for the base __init__() methods).
6954
6955* If a class defines a method __del__(self) then this method is called
6956when an instance of the class is about to be destroyed. This makes it
6957possible to implement clean-up of external resources attached to the
6958instance. As with __init__(), the __del__() methods of base classes
6959are not automatically called. If __del__ manages to store a reference
6960to the object somewhere, its destruction is postponed; when the object
6961is again about to be destroyed its __del__() method will be called
6962again.
6963
6964* Classes may define a method __hash__(self) to allow their instances
6965to be used as dictionary keys. This must return a 32-bit integer.
6966
6967
6968Minor improvements
6969------------------
6970
6971* Function and class objects now know their name (the name given in
6972the 'def' or 'class' statement that created them).
6973
6974* Class instances now know their class name.
6975
6976
6977Additions to built-in operations
6978--------------------------------
6979
6980* The % operator with a string left argument implements formatting
6981similar to sprintf() in C. The right argument is either a single
6982value or a tuple of values. All features of Standard C sprintf() are
6983supported except %p.
6984
6985* Dictionaries now support almost any key type, instead of just
6986strings. (The key type must be an immutable type or must be a class
6987instance where the class defines a method __hash__(), in order to
6988avoid losing track of keys whose value may change.)
6989
6990* Built-in methods are now compared properly: when comparing x.meth1
6991and y.meth2, if x is equal to y and the methods are defined by the
6992same function, x.meth1 compares equal to y.meth2.
6993
6994
6995Additions to built-in functions
6996-------------------------------
6997
6998* str(x) returns a string version of its argument. If the argument is
6999a string it is returned unchanged, otherwise it returns `x`.
7000
7001* repr(x) returns the same as `x`. (Some users found it easier to
7002have this as a function.)
7003
7004* round(x) returns the floating point number x rounded to an whole
7005number, represented as a floating point number. round(x, n) returns x
7006rounded to n digits.
7007
7008* hasattr(x, name) returns true when x has an attribute with the given
7009name.
7010
7011* hash(x) returns a hash code (32-bit integer) of an arbitrary
7012immutable object's value.
7013
7014* id(x) returns a unique identifier (32-bit integer) of an arbitrary
7015object.
7016
7017* compile() compiles a string to a Python code object.
7018
7019* exec() and eval() now support execution of code objects.
7020
7021
7022Changes to the documented part of the library (standard modules)
7023----------------------------------------------------------------
7024
7025* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
7026the border case '/foo/..' returns '/' instead of ''.
7027
7028* A new function string.find() is added with similar semantics to
7029string.index(); however when it does not find the given substring it
7030returns -1 instead of raising string.index_error.
7031
7032
7033Changes to built-in modules
7034---------------------------
7035
7036* New optional module 'array' implements operations on sequences of
7037integers or floating point numbers of a particular size. This is
7038useful to manipulate large numerical arrays or to read and write
7039binary files consisting of numerical data.
7040
7041* Regular expression objects created by module regex now support a new
7042method named group(), which returns one or more \(...\) groups by number.
7043The number of groups is increased from 10 to 100.
7044
7045* Function compile() in module regex now supports an optional mapping
7046argument; a variable casefold is added to the module which can be used
7047as a standard uppercase to lowercase mapping.
7048
7049* Module time now supports many routines that are defined in the
7050Standard C time interface (<time.h>): gmtime(), localtime(),
7051asctime(), ctime(), mktime(), as well as these variables (taken from
7052System V): timezone, altzone, daylight and tzname. (The corresponding
7053functions in the undocumented module calendar have been removed; the
7054undocumented and unfinished module tzparse is now obsolete and will
7055disappear in a future release.)
7056
7057* Module strop (the fast built-in version of standard module string)
7058now uses C's definition of whitespace instead of fixing it to space,
7059tab and newline; in practice this usually means that vertical tab,
7060form feed and return are now also considered whitespace. It exports
7061the string of characters that are considered whitespace as well as the
7062characters that are considered lowercase or uppercase.
7063
7064* Module sys now defines the variable builtin_module_names, a list of
7065names of modules built into the current interpreter (including not
7066yet imported, but excluding two special modules that always have to be
7067defined -- sys and builtin).
7068
7069* Objects created by module sunaudiodev now also support flush() and
7070close() methods.
7071
7072* Socket objects created by module socket now support an optional
7073flags argument for their methods sendto() and recvfrom().
7074
7075* Module marshal now supports dumping to and loading from strings,
7076through the functions dumps() and loads().
7077
7078* Module stdwin now supports some new functionality. You may have to
7079ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
7080
7081
7082Bugs fixed
7083----------
7084
7085* Fixed comparison of negative long integers.
7086
7087* The tokenizer no longer botches input lines longer than BUFSIZ.
7088
7089* Fixed several severe memory leaks in module select.
7090
7091* Fixed memory leaks in modules socket and sv.
7092
7093* Fixed memory leak in divmod() for long integers.
7094
7095* Problems with definition of floatsleep() on Suns fixed.
7096
7097* Many portability bugs fixed (and undoubtedly new ones added :-).
7098
7099
7100Changes to the build procedure
7101------------------------------
7102
7103* The Makefile supports some new targets: "make default" and "make
7104all". Both are by normally equivalent to "make python".
7105
7106* The Makefile no longer uses $> since it's not supported by all
7107versions of Make.
7108
7109* The header files now all contain #ifdef constructs designed to make
7110it safe to include the same header file twice, as well as support for
7111inclusion from C++ programs (automatic extern "C" { ... } added).
7112
7113
7114Freezing Python scripts
7115-----------------------
7116
7117* There is now some support for "freezing" a Python script as a
7118stand-alone executable binary file. See the script
7119demo/scripts/freeze.py. It will require some site-specific tailoring
7120of the script to get this working, but is quite worthwhile if you write
7121Python code for other who may not have built and installed Python.
7122
7123
7124MS-DOS
7125------
7126
7127* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
7128Marcel van der Peijl! This requires fewer compatibility hacks in
7129posixmodule.c. The executable is not yet available but will be soon
7130(check the mailing list).
7131
7132* The default PYTHONPATH has changed.
7133
7134
7135Changes for developers of extension modules
7136-------------------------------------------
7137
7138* Read src/ChangeLog for full details.
7139
7140
7141SGI specific changes
7142--------------------
7143
7144* Read src/ChangeLog for full details.
7145
Guido van Rossumaa253861994-10-06 17:18:57 +00007146
Guido van Rossuma7925f11994-01-26 10:20:16 +00007147==================================
7148==> Release 0.9.8 (9 Jan 1993) <==
7149==================================
7150
7151I claim no completeness here, but I've tried my best to scan the log
7152files throughout my source tree for interesting bits of news. A more
7153complete account of the changes is to be found in the various
7154ChangeLog files. See also "News for release 0.9.7beta" below if you're
7155still using release 0.9.6, and the file HISTORY if you have an even
7156older release.
7157
7158 --Guido
7159
7160
7161Changes to the language proper
7162------------------------------
7163
7164There's only one big change: the conformance checking for function
7165argument lists (of user-defined functions only) is stricter. Earlier,
7166you could get away with the following:
7167
7168 (a) define a function of one argument and call it with any
7169 number of arguments; if the actual argument count wasn't
7170 one, the function would receive a tuple containing the
7171 arguments arguments (an empty tuple if there were none).
7172
7173 (b) define a function of two arguments, and call it with more
7174 than two arguments; if there were more than two arguments,
7175 the second argument would be passed as a tuple containing
7176 the second and further actual arguments.
7177
7178(Note that an argument (formal or actual) that is a tuple is counted as
7179one; these rules don't apply inside such tuples, only at the top level
7180of the argument list.)
7181
7182Case (a) was needed to accommodate variable-length argument lists;
7183there is now an explicit "varargs" feature (precede the last argument
7184with a '*'). Case (b) was needed for compatibility with old class
7185definitions: up to release 0.9.4 a method with more than one argument
7186had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
7187Version 0.9.6 provide better ways to handle both casees, bot provided
7188backward compatibility; version 0.9.8 retracts the compatibility hacks
7189since they also cause confusing behavior if a function is called with
7190the wrong number of arguments.
7191
7192There's a script that helps converting classes that still rely on (b),
7193provided their methods' first argument is called "self":
7194demo/scripts/methfix.py.
7195
7196If this change breaks lots of code you have developed locally, try
7197#defining COMPAT_HACKS in ceval.c.
7198
7199(There's a third compatibility hack, which is the reverse of (a): if a
7200function is defined with two or more arguments, and called with a
7201single argument that is a tuple with just as many arguments, the items
7202of this tuple will be used as the arguments. Although this can (and
7203should!) be done using the built-in function apply() instead, it isn't
7204withdrawn yet.)
7205
7206
7207One minor change: comparing instance methods works like expected, so
7208that if x is an instance of a user-defined class and has a method m,
7209then (x.m==x.m) yields 1.
7210
7211
7212The following was already present in 0.9.7beta, but not explicitly
7213mentioned in the NEWS file: user-defined classes can now define types
7214that behave in almost allrespects like numbers. See
7215demo/classes/Rat.py for a simple example.
7216
7217
7218Changes to the build process
7219----------------------------
7220
7221The Configure.py script and the Makefile has been made somewhat more
7222bullet-proof, after reports of (minor) trouble on certain platforms.
7223
7224There is now a script to patch Makefile and config.c to add a new
7225optional built-in module: Addmodule.sh. Read the script before using!
7226
7227Useing Addmodule.sh, all optional modules can now be configured at
7228compile time using Configure.py, so there are no modules left that
7229require dynamic loading.
7230
7231The Makefile has been fixed to make it easier to use with the VPATH
7232feature of some Make versions (e.g. SunOS).
7233
7234
7235Changes affecting portability
7236-----------------------------
7237
7238Several minor portability problems have been solved, e.g. "malloc.h"
7239has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
7240the system now tolerates malloc(0) returning 0.
7241
7242For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
7243distributed with Python. This solves several minor problems, in
7244particular scripts invoked using #! can now use dynamic loading.
7245
7246
7247Changes to the interpreter interface
7248------------------------------------
7249
7250On popular demand, there's finally a "profile" feature for interactive
7251use of the interpreter. If the environment variable $PYTHONSTARTUP is
7252set to the name of an existing file, Python statements in this file
7253are executed when the interpreter is started in interactive mode.
7254
7255There is a new clean-up mechanism, complementing try...finally: if you
7256assign a function object to sys.exitfunc, it will be called when
7257Python exits or receives a SIGTERM or SIGHUP signal.
7258
7259The interpreter is now generally assumed to live in
7260/usr/local/bin/python (as opposed to /usr/local/python). The script
7261demo/scripts/fixps.py will update old scripts in place (you can easily
7262modify it to do other similar changes).
7263
7264Most I/O that uses sys.stdin/stdout/stderr will now use any object
7265assigned to those names as long as the object supports readline() or
7266write() methods.
7267
7268The parser stack has been increased to 500 to accommodate more
7269complicated expressions (7 levels used to be the practical maximum,
7270it's now about 38).
7271
7272The limit on the size of the *run-time* stack has completely been
7273removed -- this means that tuple or list displays can contain any
7274number of elements (formerly more than 50 would crash the
7275interpreter).
7276
7277
7278Changes to existing built-in functions and methods
7279--------------------------------------------------
7280
7281The built-in functions int(), long(), float(), oct() and hex() now
7282also apply to class instalces that define corresponding methods
7283(__int__ etc.).
7284
7285
7286New built-in functions
7287----------------------
7288
7289The new functions str() and repr() convert any object to a string.
7290The function repr(x) is in all respects equivalent to `x` -- some
7291people prefer a function for this. The function str(x) does the same
7292except if x is already a string -- then it returns x unchanged
7293(repr(x) adds quotes and escapes "funny" characters as octal escapes).
7294
7295The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
7296
7297
7298Changes to general built-in modules
7299-----------------------------------
7300
7301The time module's functions are more general: time() returns a
7302floating point number and sleep() accepts one. Their accuracies
7303depends on the precision of the system clock. Millisleep is no longer
7304needed (although it still exists for now), but millitimer is still
7305needed since on some systems wall clock time is only available with
7306seconds precision, while a source of more precise time exists that
7307isn't synchronized with the wall clock. (On UNIX systems that support
7308the BSD gettimeofday() function, time.time() is as time.millitimer().)
7309
7310The string representation of a file object now includes an address:
7311'<file 'filename', mode 'r' at #######>' where ###### is a hex number
7312(the object's address) to make it unique.
7313
7314New functions added to posix: nice(), setpgrp(), and if your system
7315supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
7316
7317Improvements to the socket module: socket objects have new methods
7318getpeername() and getsockname(), and the {get,set}sockopt methods can
7319now get/set any kind of option using strings built with the new struct
7320module. And there's a new function fromfd() which creates a socket
7321object given a file descriptor (useful for servers started by inetd,
7322which have a socket connected to stdin and stdout).
7323
7324
7325Changes to SGI-specific built-in modules
7326----------------------------------------
7327
7328The FORMS library interface (fl) now requires FORMS 2.1a. Some new
7329functions have been added and some bugs have been fixed.
7330
7331Additions to al (audio library interface): added getname(),
7332getdefault() and getminmax().
7333
7334The gl modules doesn't call "foreground()" when initialized (this
7335caused some problems) like it dit in 0.9.7beta (but not before).
7336There's a new gl function 'gversion() which returns a version string.
7337
7338The interface to sv (Indigo video interface) has totally changed.
7339(Sorry, still no documentation, but see the examples in
7340demo/sgi/{sv,video}.)
7341
7342
7343Changes to standard library modules
7344-----------------------------------
7345
7346Most functions in module string are now much faster: they're actually
7347implemented in C. The module containing the C versions is called
7348"strop" but you should still import "string" since strop doesn't
7349provide all the interfaces defined in string (and strop may be renamed
7350to string when it is complete in a future release).
7351
7352string.index() now accepts an optional third argument giving an index
7353where to start searching in the first argument, so you can find second
7354and further occurrences (this is similar to the regular expression
7355functions in regex).
7356
7357The definition of what string.splitfields(anything, '') should return
7358is changed for the last time: it returns a singleton list containing
7359its whole first argument unchanged. This is compatible with
7360regsub.split() which also ignores empty delimiter matches.
7361
7362posixpath, macpath: added dirname() and normpath() (and basename() to
7363macpath).
7364
7365The mainloop module (for use with stdwin) can now demultiplex input
7366from other sources, as long as they can be polled with select().
7367
7368
7369New built-in modules
7370--------------------
7371
7372Module struct defines functions to pack/unpack values to/from strings
7373representing binary values in native byte order.
7374
7375Module strop implements C versions of many functions from string (see
7376above).
7377
7378Optional module fcntl defines interfaces to fcntl() and ioctl() --
7379UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
7380
7381Optional module mpz defines an interface to an altaernative long
7382integer implementation, the GNU MPZ library.
7383
7384Optional module md5 uses the GNU MPZ library to calculate MD5
7385signatures of strings.
7386
7387There are also optional new modules specific to SGI machines: imageop
7388defines some simple operations to images represented as strings; sv
7389interfaces to the Indigo video board; cl interfaces to the (yet
7390unreleased) compression library.
7391
7392
7393New standard library modules
7394----------------------------
7395
7396(Unfortunately the following modules are not all documented; read the
7397sources to find out more about them!)
7398
7399autotest: run testall without showing any output unless it differs
7400from the expected output
7401
7402bisect: use bisection to insert or find an item in a sorted list
7403
7404colorsys: defines conversions between various color systems (e.g. RGB
7405<-> YUV)
7406
7407nntplib: a client interface to NNTP servers
7408
7409pipes: utility to construct pipeline from templates, e.g. for
7410conversion from one file format to another using several utilities.
7411
7412regsub: contains three functions that are more or less compatible with
7413awk functions of the same name: sub() and gsub() do string
7414substitution, split() splits a string using a regular expression to
7415define how separators are define.
7416
7417test_types: test operations on the built-in types of Python
7418
7419toaiff: convert various audio file formats to AIFF format
7420
7421tzparse: parse the TZ environment parameter (this may be less general
7422than it could be, let me know if you fix it).
7423
7424(Note that the obsolete module "path" no longer exists.)
7425
7426
7427New SGI-specific library modules
7428--------------------------------
7429
7430CL: constants for use with the built-in compression library interface (cl)
7431
7432Queue: a multi-producer, multi-consumer queue class implemented for
7433use with the built-in thread module
7434
7435SOCKET: constants for use with built-in module socket, e.g. to set/get
7436socket options. This is SGI-specific because the constants to be
7437passed are system-dependent. You can generate a version for your own
7438system by running the script demo/scripts/h2py.py with
7439/usr/include/sys/socket.h as input.
7440
7441cddb: interface to the database used the the CD player
7442
7443torgb: convert various image file types to rgb format (requires pbmplus)
7444
7445
7446New demos
7447---------
7448
7449There's an experimental interface to define Sun RPC clients and
7450servers in demo/rpc.
7451
7452There's a collection of interfaces to WWW, WAIS and Gopher (both
7453Python classes and program providing a user interface) in demo/www.
7454This includes a program texi2html.py which converts texinfo files to
7455HTML files (the format used hy WWW).
7456
7457The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
7458
7459For SGI systems, there's a whole collection of programs and classes
7460that make use of the Indigo video board in demo/sgi/{sv,video}. This
7461represents a significant amount of work that we're giving away!
7462
7463There are demos "rsa" and "md5test" that exercise the mpz and md5
7464modules, respectively. The rsa demo is a complete implementation of
7465the RSA public-key cryptosystem!
7466
7467A bunch of games and examples submitted by Stoffel Erasmus have been
7468included in demo/stoffel.
7469
7470There are miscellaneous new files in some existing demo
7471subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
7472sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
7473
7474There are also many minor changes to existing files, but I'm too lazy
7475to run a diff and note the differences -- you can do this yourself if
7476you save the old distribution's demos. One highlight: the
7477stdwin/python.py demo is much improved!
7478
7479
7480Changes to the documentation
7481----------------------------
7482
7483The LaTeX source for the library uses different macros to enable it to
7484be converted to texinfo, and from there to INFO or HTML format so it
7485can be browsed as a hypertext. The net result is that you can now
7486read the Python library documentation in Emacs info mode!
7487
7488
7489Changes to the source code that affect C extension writers
7490----------------------------------------------------------
7491
7492The function strdup() no longer exists (it was used only in one places
7493and is somewhat of a a portability problem sice some systems have the
7494same function in their C library.
7495
7496The functions NEW() and RENEW() allocate one spare byte to guard
7497against a NULL return from malloc(0) being taken for an error, but
7498this should not be relied upon.
7499
7500
7501=========================
7502==> Release 0.9.7beta <==
7503=========================
7504
7505
7506Changes to the language proper
7507------------------------------
7508
7509User-defined classes can now implement operations invoked through
7510special syntax, such as x[i] or `x` by defining methods named
7511__getitem__(self, i) or __repr__(self), etc.
7512
7513
7514Changes to the build process
7515----------------------------
7516
7517Instead of extensive manual editing of the Makefile to select
7518compile-time options, you can now run a Configure.py script.
7519The Makefile as distributed builds a minimal interpreter sufficient to
7520run Configure.py. See also misc/BUILD
7521
7522The Makefile now includes more "utility" targets, e.g. install and
7523tags/TAGS
7524
7525Using the provided strtod.c and strtol.c are now separate options, as
7526on the Sun the provided strtod.c dumps core :-(
7527
7528The regex module is now an option chosen by the Makefile, since some
7529(old) C compilers choke on regexpr.c
7530
7531
7532Changes affecting portability
7533-----------------------------
7534
7535You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
7536interface
7537
7538Dynamic loading is now supported for Sun (and other non-COFF systems)
7539throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
7540DL is out, 1.4)
7541
7542The system-dependent code for the use of the select() system call is
7543moved to one file: myselect.h
7544
7545Thanks to Jaap Vermeulen, the code should now port cleanly to the
7546SEQUENT
7547
7548
7549Changes to the interpreter interface
7550------------------------------------
7551
7552The interpretation of $PYTHONPATH in the environment is different: it
7553is inserted in front of the default path instead of overriding it
7554
7555
7556Changes to existing built-in functions and methods
7557--------------------------------------------------
7558
7559List objects now support an optional argument to their sort() method,
7560which is a comparison function similar to qsort(3) in C
7561
7562File objects now have a method fileno(), used by the new select module
7563(see below)
7564
7565
7566New built-in function
7567---------------------
7568
7569coerce(x, y): take two numbers and return a tuple containing them
7570both converted to a common type
7571
7572
7573Changes to built-in modules
7574---------------------------
7575
7576sys: fixed core dumps in settrace() and setprofile()
7577
7578socket: added socket methods setsockopt() and getsockopt(); and
7579fileno(), used by the new select module (see below)
7580
7581stdwin: added fileno() == connectionnumber(), in support of new module
7582select (see below)
7583
7584posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
7585
7586gl: added qgetfd()
7587
7588fl: added several new functions, fixed several obscure bugs, adapted
7589to FORMS 2.1
7590
7591
7592Changes to standard modules
7593---------------------------
7594
7595posixpath: changed implementation of ismount()
7596
7597string: atoi() no longer mistakes leading zero for octal number
7598
7599...
7600
7601
7602New built-in modules
7603--------------------
7604
7605Modules marked "dynamic only" are not configured at compile time but
7606can be loaded dynamically. You need to turn on the DL or DLD option in
7607the Makefile for support dynamic loading of modules (this requires
7608external code).
7609
7610select: interfaces to the BSD select() system call
7611
7612dbm: interfaces to the (new) dbm library (dynamic only)
7613
7614nis: interfaces to some NIS functions (aka yellow pages)
7615
7616thread: limited form of multiple threads (sgi only)
7617
7618audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
7619coding (dynamic only)
7620
7621cd: interface to Indigo SCSI CDROM player audio library (sgi only)
7622
7623jpeg: read files in JPEG format (dynamic only, sgi only; needs
7624external code)
7625
7626imgfile: read SGI image files (dynamic only, sgi only)
7627
7628sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
7629
7630sv: interface to Indigo video library (sgi only)
7631
7632pc: a minimal set of MS-DOS interfaces (MS-DOS only)
7633
7634rotor: encryption, by Lance Ellinghouse (dynamic only)
7635
7636
7637New standard modules
7638--------------------
7639
7640Not all these modules are documented. Read the source:
7641lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
7642additional documentation.
7643
7644imghdr: recognizes image file headers
7645
7646sndhdr: recognizes sound file headers
7647
7648profile: print run-time statistics of Python code
7649
7650readcd, cdplayer: companion modules for built-in module cd (sgi only)
7651
7652emacs: interface to Emacs using py-connect.el (see below).
7653
7654SOCKET: symbolic constant definitions for socket options
7655
7656SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
7657
7658SV: symbolic constat definitions for sv (sgi only)
7659
7660CD: symbolic constat definitions for cd (sgi only)
7661
7662
7663New demos
7664---------
7665
7666scripts/pp.py: execute Python as a filter with a Perl-like command
7667line interface
7668
7669classes/: examples using the new class features
7670
7671threads/: examples using the new thread module
7672
7673sgi/cd/: examples using the new cd module
7674
7675
7676Changes to the documentation
7677----------------------------
7678
7679The last-minute syntax changes of release 0.9.6 are now reflected
7680everywhere in the manuals
7681
7682The reference manual has a new section (3.2) on implementing new kinds
7683of numbers, sequences or mappings with user classes
7684
7685Classes are now treated extensively in the tutorial (chapter 9)
7686
7687Slightly restructured the system-dependent chapters of the library
7688manual
7689
7690The file misc/EXTENDING incorporates documentation for mkvalue() and
7691a new section on error handling
7692
7693The files misc/CLASSES and misc/ERRORS are no longer necessary
7694
7695The doc/Makefile now creates PostScript files automatically
7696
7697
7698Miscellaneous changes
7699---------------------
7700
7701Incorporated Tim Peters' changes to python-mode.el, it's now version
77021.06
7703
7704A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
7705program running in an Emacs buffer execute Emacs lisp code. The
7706necessary Python code is in lib/emacs.py. The Emacs code is
7707misc/py-connect.el (it needs some external Emacs lisp code)
7708
7709
7710Changes to the source code that affect C extension writers
7711----------------------------------------------------------
7712
7713New service function mkvalue() to construct a Python object from C
7714values according to a "format" string a la getargs()
7715
7716Most functions from pythonmain.c moved to new pythonrun.c which is
7717in libpython.a. This should make embedded versions of Python easier
7718
7719ceval.h is split in eval.h (which needs compile.h and only declares
7720eval_code) and ceval.h (which doesn't need compile.hand declares the
7721rest)
7722
7723ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
7724improve the parallellism of multi-threaded programs by letting other
7725Python code run when a blocking system call or something similar is
7726made)
7727
7728In structmember.[ch], new member types BYTE, CHAR and unsigned
7729variants have been added
7730
7731New file xxmodule.c is a template for new extension modules.
7732
Guido van Rossumaa253861994-10-06 17:18:57 +00007733
Guido van Rossuma7925f11994-01-26 10:20:16 +00007734==================================
7735==> RELEASE 0.9.6 (6 Apr 1992) <==
7736==================================
7737
7738Misc news in 0.9.6:
7739- Restructured the misc subdirectory
7740- Reference manual completed, library manual much extended (with indexes!)
7741- the GNU Readline library is now distributed standard with Python
7742- the script "../demo/scripts/classfix.py" fixes Python modules using old
7743 class syntax
7744- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
7745- Because of the GNU copyleft business I am not using the GNU regular
7746 expression implementation but a free re-implementation by Tatu Ylonen
7747 that recently appeared in comp.sources.misc (Bravo, Tatu!)
7748
7749New features in 0.9.6:
7750- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
7751- New module 'os' supplants modules 'mac' and 'posix' for most cases;
7752 module 'path' is replaced by 'os.path'
7753- os.path.split() return value differs from that of old path.split()
7754- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
7755 currently being handled
7756- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
7757 exception
7758- New function string.expandtabs() expands tabs in a string
7759- Added times() interface to posix (user & sys time of process & children)
7760- Added uname() interface to posix (returns OS type, hostname, etc.)
7761- New built-in function execfile() is like exec() but from a file
7762- Functions exec() and eval() are less picky about whitespace/newlines
7763- New built-in functions getattr() and setattr() access arbitrary attributes
7764- More generic argument handling in built-in functions (see "./EXTENDING")
7765- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
7766- Division and modulo for long and plain integers with negative operands
7767 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
7768 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
7769 (a/b, a%b) for integers. For floats, % is also changed, but of course
7770 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
7771- A function with explicit variable-length argument list can be declared
7772 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
7773- Code tracing and profiling features have been added, and two source
7774 code debuggers are provided in the library (pdb.py, tty-oriented,
7775 and wdb, window-oriented); you can now step through Python programs!
7776 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
7777- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
7778 a script that fixes old Python modules
7779- Plain integer right shift now uses sign extension
7780- Long integer shift/mask operations now simulate 2's complement
7781 to give more useful results for negative operands
7782- Changed/added range checks for long/plain integer shifts
7783- Options found after "-c command" are now passed to the command in sys.argv
7784 (note subtle incompatiblity with "python -c command -- -options"!)
7785- Module stdwin is better protected against touching objects after they've
7786 been closed; menus can now also be closed explicitly
7787- Stdwin now uses its own exception (stdwin.error)
7788
7789New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
7790- dictionary objects can now be compared properly; e.g., {}=={} is true
7791- new exception SystemExit causes termination if not caught;
7792 it is raised by sys.exit() so that 'finally' clauses can clean up,
7793 and it may even be caught. It does work interactively!
7794- new module "regex" implements GNU Emacs style regular expressions;
7795 module "regexp" is rewritten in Python for backward compatibility
7796- formal parameter lists may contain trailing commas
7797
7798Bugs fixed in 0.9.6:
7799- assigning to or deleting a list item with a negative index dumped core
7800- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
7801
7802Bugs fixed in 0.9.5:
7803- masking operations involving negative long integers gave wrong results
7804
7805
7806===================================
7807==> RELEASE 0.9.4 (24 Dec 1991) <==
7808===================================
7809
7810- new function argument handling (see below)
7811- built-in apply(func, args) means func(args[0], args[1], ...)
7812- new, more refined exceptions
7813- new exception string values (NameError = 'NameError' etc.)
7814- better checking for math exceptions
7815- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
7816- fixed list assignment bug: "a[1:1] = a" now works correctly
7817- new class syntax, without extraneous parentheses
7818- new 'global' statement to assign global variables from within a function
7819
7820
7821New class syntax
7822----------------
7823
7824You can now declare a base class as follows:
7825
7826 class B: # Was: class B():
7827 def some_method(self): ...
7828 ...
7829
7830and a derived class thusly:
7831
7832 class D(B): # Was: class D() = B():
7833 def another_method(self, arg): ...
7834
7835Multiple inheritance looks like this:
7836
7837 class M(B, D): # Was: class M() = B(), D():
7838 def this_or_that_method(self, arg): ...
7839
7840The old syntax is still accepted by Python 0.9.4, but will disappear
7841in Python 1.0 (to be posted to comp.sources).
7842
7843
7844New 'global' statement
7845----------------------
7846
7847Every now and then you have a global variable in a module that you
7848want to change from within a function in that module -- say, a count
7849of calls to a function, or an option flag, etc. Until now this was
7850not directly possible. While several kludges are known that
7851circumvent the problem, and often the need for a global variable can
7852be avoided by rewriting the module as a class, this does not always
7853lead to clearer code.
7854
7855The 'global' statement solves this dilemma. Its occurrence in a
7856function body means that, for the duration of that function, the
7857names listed there refer to global variables. For instance:
7858
7859 total = 0.0
7860 count = 0
7861
7862 def add_to_total(amount):
7863 global total, count
7864 total = total + amount
7865 count = count + 1
7866
7867'global' must be repeated in each function where it is needed. The
7868names listed in a 'global' statement must not be used in the function
7869before the statement is reached.
7870
7871Remember that you don't need to use 'global' if you only want to *use*
7872a global variable in a function; nor do you need ot for assignments to
7873parts of global variables (e.g., list or dictionary items or
7874attributes of class instances). This has not changed; in fact
7875assignment to part of a global variable was the standard workaround.
7876
7877
7878New exceptions
7879--------------
7880
7881Several new exceptions have been defined, to distinguish more clearly
7882between different types of errors.
7883
7884name meaning was
7885
7886AttributeError reference to non-existing attribute NameError
7887IOError unexpected I/O error RuntimeError
7888ImportError import of non-existing module or name NameError
7889IndexError invalid string, tuple or list index RuntimeError
7890KeyError key not in dictionary RuntimeError
7891OverflowError numeric overflow RuntimeError
7892SyntaxError invalid syntax RuntimeError
7893ValueError invalid argument value RuntimeError
7894ZeroDivisionError division by zero RuntimeError
7895
7896The string value of each exception is now its name -- this makes it
7897easier to experimentally find out which operations raise which
7898exceptions; e.g.:
7899
7900 >>> KeyboardInterrupt
7901 'KeyboardInterrupt'
7902 >>>
7903
7904
7905New argument passing semantics
7906------------------------------
7907
7908Off-line discussions with Steve Majewski and Daniel LaLiberte have
7909convinced me that Python's parameter mechanism could be changed in a
7910way that made both of them happy (I hope), kept me happy, fixed a
7911number of outstanding problems, and, given some backward compatibility
7912provisions, would only break a very small amount of existing code --
7913probably all mine anyway. In fact I suspect that most Python users
7914will hardly notice the difference. And yet it has cost me at least
7915one sleepless night to decide to make the change...
7916
7917Philosophically, the change is quite radical (to me, anyway): a
7918function is no longer called with either zero or one argument, which
7919is a tuple if there appear to be more arguments. Every function now
7920has an argument list containing 0, 1 or more arguments. This list is
7921always implemented as a tuple, and it is a (run-time) error if a
7922function is called with a different number of arguments than expected.
7923
7924What's the difference? you may ask. The answer is, very little unless
7925you want to write variadic functions -- functions that may be called
7926with a variable number of arguments. Formerly, you could write a
7927function that accepted one or more arguments with little trouble, but
7928writing a function that could be called with either 0 or 1 argument
7929(or more) was next to impossible. This is now a piece of cake: you
7930can simply declare an argument that receives the entire argument
7931tuple, and check its length -- it will be of size 0 if there are no
7932arguments.
7933
7934Another anomaly of the old system was the way multi-argument methods
7935(in classes) had to be declared, e.g.:
7936
7937 class Point():
7938 def init(self, (x, y, color)): ...
7939 def setcolor(self, color): ...
7940 dev moveto(self, (x, y)): ...
7941 def draw(self): ...
7942
7943Using the new scheme there is no need to enclose the method arguments
7944in an extra set of parentheses, so the above class could become:
7945
7946 class Point:
7947 def init(self, x, y, color): ...
7948 def setcolor(self, color): ...
7949 dev moveto(self, x, y): ...
7950 def draw(self): ...
7951
7952That is, the equivalence rule between methods and functions has
7953changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
7954while formerly it was equivalent to Point.moveto(p,(x,y)).
7955
7956A special backward compatibility rule makes that the old version also
7957still works: whenever a function with exactly two arguments (at the top
7958level) is called with more than two arguments, the second and further
7959arguments are packed into a tuple and passed as the second argument.
7960This rule is invoked independently of whether the function is actually a
7961method, so there is a slight chance that some erroneous calls of
7962functions expecting two arguments with more than that number of
7963arguments go undetected at first -- when the function tries to use the
7964second argument it may find it is a tuple instead of what was expected.
7965Note that this rule will be removed from future versions of the
7966language; it is a backward compatibility provision *only*.
7967
7968Two other rules and a new built-in function handle conversion between
7969tuples and argument lists:
7970
7971Rule (a): when a function with more than one argument is called with a
7972single argument that is a tuple of the right size, the tuple's items
7973are used as arguments.
7974
7975Rule (b): when a function with exactly one argument receives no
7976arguments or more than one, that one argument will receive a tuple
7977containing the arguments (the tuple will be empty if there were no
7978arguments).
7979
7980
7981A new built-in function, apply(), was added to support functions that
7982need to call other functions with a constructed argument list. The call
7983
7984 apply(function, tuple)
7985
7986is equivalent to
7987
7988 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
7989
7990
7991While no new argument syntax was added in this phase, it would now be
7992quite sensible to add explicit syntax to Python for default argument
7993values (as in C++ or Modula-3), or a "rest" argument to receive the
7994remaining arguments of a variable-length argument list.
7995
7996
7997========================================================
7998==> Release 0.9.3 (never made available outside CWI) <==
7999========================================================
8000
8001- string sys.version shows current version (also printed on interactive entry)
8002- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
8003- 'global' statement to declare module-global variables assigned in functions.
8004- new class declaration syntax: class C(Base1, Base2, ...): suite
8005 (the old syntax is still accepted -- be sure to convert your classes now!)
8006- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
8007- C comparison operators: == != (the old = and <> remain valid).
8008- floating point numbers may now start with a period (e.g., .14).
8009- definition of integer division tightened (always truncates towards zero).
8010- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
8011- new list method l.count(x) returns the number of occurrences of x in l.
8012- new SGI module: al (Indigo and 4D/35 audio library).
8013- the FORMS interface (modules fl and FL) now uses FORMS 2.0
8014- module gl: added lrect{read,write}, rectzoom and pixmode;
8015 added (non-GL) functions (un)packrect.
8016- new socket method: s.allowbroadcast(flag).
8017- many objects support __dict__, __methods__ or __members__.
8018- dir() lists anything that has __dict__.
8019- class attributes are no longer read-only.
8020- classes support __bases__, instances support __class__ (and __dict__).
8021- divmod() now also works for floats.
8022- fixed obscure bug in eval('1 ').
8023
8024
8025===================================
8026==> Release 0.9.2 (Autumn 1991) <==
8027===================================
8028
8029Highlights
8030----------
8031
8032- tutorial now (almost) complete; library reference reorganized
8033- new syntax: continue statement; semicolons; dictionary constructors;
8034 restrictions on blank lines in source files removed
8035- dramatically improved module load time through precompiled modules
8036- arbitrary precision integers: compute 2 to the power 1000 and more...
8037- arithmetic operators now accept mixed type operands, e.g., 3.14/4
8038- more operations on list: remove, index, reverse; repetition
8039- improved/new file operations: readlines, seek, tell, flush, ...
8040- process management added to the posix module: fork/exec/wait/kill etc.
8041- BSD socket operations (with example servers and clients!)
8042- many new STDWIN features (color, fonts, polygons, ...)
8043- new SGI modules: font manager and FORMS library interface
8044
8045
8046Extended list of changes in 0.9.2
8047---------------------------------
8048
8049Here is a summary of the most important user-visible changes in 0.9.2,
8050in somewhat arbitrary order. Changes in later versions are listed in
8051the "highlights" section above.
8052
8053
80541. Changes to the interpreter proper
8055
8056- Simple statements can now be separated by semicolons.
8057 If you write "if t: s1; s2", both s1 and s2 are executed
8058 conditionally.
8059- The 'continue' statement was added, with semantics as in C.
8060- Dictionary displays are now allowed on input: {key: value, ...}.
8061- Blank lines and lines bearing only a comment no longer need to
8062 be indented properly. (A completely empty line still ends a multi-
8063 line statement interactively.)
8064- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
8065- Option "-c command" to execute statements from the command line
8066- Compiled versions of modules are cached in ".pyc" files, giving a
8067 dramatic improvement of start-up time
8068- Other, smaller speed improvements, e.g., extracting characters from
8069 strings, looking up single-character keys, and looking up global
8070 variables
8071- Interrupting a print operation raises KeyboardInterrupt instead of
8072 only cancelling the print operation
8073- Fixed various portability problems (it now passes gcc with only
8074 warnings -- more Standard C compatibility will be provided in later
8075 versions)
8076- Source is prepared for porting to MS-DOS
8077- Numeric constants are now checked for overflow (this requires
8078 standard-conforming strtol() and strtod() functions; a correct
8079 strtol() implementation is provided, but the strtod() provided
8080 relies on atof() for everything, including error checking
8081
8082
80832. Changes to the built-in types, functions and modules
8084
8085- New module socket: interface to BSD socket primitives
8086- New modules pwd and grp: access the UNIX password and group databases
8087- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
8088- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
8089- New numeric type: long integer, for unlimited precision
8090 - integer constants suffixed with 'L' or 'l' are long integers
8091 - new built-in function long(x) converts int or float to long
8092 - int() and float() now also convert from long integers
8093- New built-in function:
8094 - pow(x, y) returns x to the power y
8095- New operation and methods for lists:
8096 - l*n returns a new list consisting of n concatenated copies of l
8097 - l.remove(x) removes the first occurrence of the value x from l
8098 - l.index(x) returns the index of the first occurrence of x in l
8099 - l.reverse() reverses l in place
8100- New operation for tuples:
8101 - t*n returns a tuple consisting of n concatenated copies of t
8102- Improved file handling:
8103 - f.readline() no longer restricts the line length, is faster,
8104 and isn't confused by null bytes; same for raw_input()
8105 - f.read() without arguments reads the entire (rest of the) file
8106 - mixing of print and sys.stdout.write() has different effect
8107- New methods for files:
8108 - f.readlines() returns a list containing the lines of the file,
8109 as read with f.readline()
8110 - f.flush(), f.tell(), f.seek() call their stdio counterparts
8111 - f.isatty() tests for "tty-ness"
8112- New posix functions:
8113 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
8114 - popen() returns a file object connected to a pipe
8115 - utime() replaces utimes() (the latter is not a POSIX name)
8116- New stdwin features, including:
8117 - font handling
8118 - color drawing
8119 - scroll bars made optional
8120 - polygons
8121 - filled and xor shapes
8122 - text editing objects now have a 'settext' method
8123
8124
81253. Changes to the standard library
8126
8127- Name change: the functions path.cat and macpath.cat are now called
8128 path.join and macpath.join
8129- Added new modules: formatter, mutex, persist, sched, mainloop
8130- Added some modules and functionality to the "widget set" (which is
8131 still under development, so please bear with me):
8132 DirList, FormSplit, TextEdit, WindowSched
8133- Fixed module testall to work non-interactively
8134- Module string:
8135 - added functions join() and joinfields()
8136 - fixed center() to work correct and make it "transitive"
8137- Obsolete modules were removed: util, minmax
8138- Some modules were moved to the demo directory
8139
8140
81414. Changes to the demonstration programs
8142
8143- Added new useful scipts: byteyears, eptags, fact, from, lfact,
8144 objgraph, pdeps, pi, primes, ptags, which
8145- Added a bunch of socket demos
8146- Doubled the speed of ptags
8147- Added new stdwin demos: microedit, miniedit
8148- Added a windowing interface to the Python interpreter: python (most
8149 useful on the Mac)
8150- Added a browser for Emacs info files: demo/stdwin/ibrowse
8151 (yes, I plan to put all STDWIN and Python documentation in texinfo
8152 form in the future)
8153
8154
81555. Other changes to the distribution
8156
8157- An Emacs Lisp file "python.el" is provided to facilitate editing
8158 Python programs in GNU Emacs (slightly improved since posted to
8159 gnu.emacs.sources)
8160- Some info on writing an extension in C is provided
8161- Some info on building Python on non-UNIX platforms is provided
8162
8163
8164=====================================
8165==> Release 0.9.1 (February 1991) <==
8166=====================================
8167
8168- Micro changes only
8169- Added file "patchlevel.h"
8170
8171
8172=====================================
8173==> Release 0.9.0 (February 1991) <==
8174=====================================
8175
8176Original posting to alt.sources.