@@ -3,8 +3,7 @@ What's new in this release?
33
44Below is a list of all relevant changes since the release 1.4, up till
55the release of 1.5a3. At the end is a list of changes made since
6- 1.5a3 that will be in 1.5a4; this list is not yet complete and will be
7- merged with the main list later.
6+ 1.5a3 up to the release of 1.5a4.
87
98A note on attributions: while I have sprinkled some names throughout
109here, I'm grateful to many more people who remain anonymous. You may
@@ -343,9 +342,10 @@ on platforms where this is not the native format. It uses uppercase
343342format codes for unsigned integers of various sizes (always using
344343Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
345344and 'p' for "Pascal strings" (with a leading length byte, included in
346- the size; blame Hannu Krosing). A prefix '>' forces big-endian data
347- and '<' forces little-endian data; these also select standard data
348- sizes and disable automatic alignment (use pad bytes as needed).
345+ the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
346+ big-endian data and '<' forces little-endian data; these also select
347+ standard data sizes and disable automatic alignment (use pad bytes as
348+ needed).
349349
350350- The array module supports uppercase format codes for unsigned data
351351formats (like the struct module).
@@ -971,12 +971,16 @@ make a separate announcement for the Mac specific source code and the
971971binary distribution(s) when these are ready.
972972
973973
974+ ======================================================================
975+
976+
974977Fixed after 1.5a3 was released
975978------------------------------
976979
977980The following changes have been made to the source base after the
978- release of 1.5a3. These need to be merged into their respective
979- categories for the next release.
981+ release of 1.5a3. They still need to be sorted. They also need to be
982+ merged into their respective categories for the final release, but
983+ it's useful to have them separately during the alpha test cycle.
980984
981985- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
982986feature; better install instructions; removed faqmain.py (which was an
@@ -991,6 +995,15 @@ function.
991995- urllib.py: close the socket and temp file in URLopener.retrieve() so
992996that multiple retrievals using the same connection work.
993997
998+ - All standard exceptions are now classes by default; use -X to make
999+ them strings (for backward compatibility only).
1000+
1001+ - There's a new standard exception hierarchy, defined in the standard
1002+ library module exceptions.py (which you never need to import
1003+ explicitly). See
1004+ http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
1005+ more info.
1006+
9941007- Three new C API functions:
9951008
9961009 - int PyErr_GivenExceptionMatches(obj1, obj2)
@@ -1017,8 +1030,9 @@ that multiple retrievals using the same connection work.
10171030 argument. If value is None, it uses an empty arg tuple, and if
10181031 the value is a tuple, it uses just that.
10191032
1020- - Demo/metaclasses: new demo subdir explains metaclasses (read
1021- index.html in a browser).
1033+ - Another new C API function: PyErr_NewException() creates a new
1034+ exception class derived from Exception; when -X is given, it creates a
1035+ new string exception.
10221036
10231037- core interpreter: remove the distinction between tuple and list
10241038unpacking; allow an arbitrary sequence on the right hand side of any
@@ -1153,3 +1167,253 @@ if it doesn't. The default defaults to None. This is quicker for
11531167some applications than using either has_key() or try:...except
11541168KeyError:....
11551169
1170+ - Tools/webchecker/: some small changes to webchecker.py; added
1171+ websucker.py (a simple web site mirroring script).
1172+
1173+ - Dictionary objects now have a get() method (also in UserDict.py).
1174+ dict.get(key, default) returns dict[key] if it exists and default
1175+ otherwise; default defaults to None.
1176+
1177+ - Tools/scripts/logmerge.py: print the author, too.
1178+
1179+ - Changes to import: support for "import a.b.c" is now built in. See
1180+ http://grail.cnri.reston.va.us/python/essays/packages.html
1181+ for more info. Most important deviations from "ni.py": __init__.py is
1182+ executed in the package's namespace instead of as a submodule; and
1183+ there's no support for "__" or "__domain__". Note that "ni.py" is not
1184+ changed to match this -- it is simply declared obsolete (while at the
1185+ same time, it is documented...:-( ).
1186+ Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1187+ for an example implementation of hierarchical module import written in
1188+ Python).
1189+
1190+ - More changes to import: the site.py module is now imported by
1191+ default when Python is initialized; use -S to disable it. The site.py
1192+ module extends the path with several more directories: site-packages
1193+ inside the lib/python1.5/ directory, site-python in the lib/
1194+ directory, and pathnames mentioned in *.pth files found in either of
1195+ those directories. See
1196+ http://grail.cnri.reston.va.us/python/essays/packages.html
1197+ for more info.
1198+
1199+ - Changes to standard library subdirectory names: those subdirectories
1200+ that are not packages have been renamed with a hypen in their name,
1201+ e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1202+ The test suite is now a package -- to run a test, you must now use
1203+ "import test.test_foo".
1204+
1205+ - A completely new re.py module is provided (thanks to Andrew
1206+ Kuchling) which uses Philip Hazel's "pcre" re compiler and engine.
1207+ For a while, the "old" re.py (which was new in 1.5a3!) will be kept
1208+ around as re1.py. The "old" regex module and underlying parser and
1209+ engine are still present -- while regex is now officially obsolete, it
1210+ will probably take several major release cycles before it can be
1211+ removed.
1212+
1213+ - The posix module now has a strerror() function which translates an
1214+ error code to a string.
1215+
1216+ - The emacs.py module (which was long obsolete) has been removed.
1217+
1218+ - The universal makefile Misc/Makefile.pre.in now features an
1219+ "install" target. By default, installed shared libraries go into
1220+ $exec_prefix/lib/python$VERSION/site-packages/.
1221+
1222+ - The install-sh script is installed with the other configuration
1223+ specific files (in the config/ subdirectory).
1224+
1225+ - It turns out whatsound.py and sndhdr.py were identical modules.
1226+ Since there's also an imghdr.py file, I propose to make sndhdr.py the
1227+ official one. For compatibility, whatsound.py imports * from
1228+ sndhdr.py.
1229+
1230+ - Class objects have a new attribute, __module__, giving the name of
1231+ the module in which they were declared. This is useful for pickle and
1232+ for printing the full name of a class exception.
1233+
1234+ - Many extension modules no longer issue a fatal error when their
1235+ initialization fails; the importing code now checks whether an error
1236+ occurred during module initialization, and correctly propagates the
1237+ exception to the import statement.
1238+
1239+ - Most extension modules now raise class-based exceptions (except when
1240+ -X is used).
1241+
1242+ - Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1243+ thread state -- just don't manipulate the lock if it isn't there.
1244+
1245+ - Fixed a bug in Python/getopt.c that made it do the wrong thing when
1246+ an option was a single '-'. Thanks to Andrew Kuchling.
1247+
1248+ - New module mimetypes.py will guess a MIME type from a filename's
1249+ extension.
1250+
1251+ - Windows: the DLL version is now settable via a resource rather than
1252+ being hardcoded. This can be used for "branding" a binary Python
1253+ distribution.
1254+
1255+ - urllib.py is now threadsafe -- it now uses re instead of regex, and
1256+ sys.exc_info() instead of sys.exc_{type,value}.
1257+
1258+ - Many other library modules that used to use
1259+ sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1260+ using sys.exc_info().
1261+
1262+ - The functions in popen2 have an optional buffer size parameter.
1263+ Also, the command argument can now be either a string (passed to the
1264+ shell) or a list of arguments (passed directly to execv).
1265+
1266+ - The thread support for _tkinter.c now works. The bad news is that
1267+ it requires a modified version of a file in the standard Tcl
1268+ distribution, which you must compile with a -I option pointing to the
1269+ standard Tcl source tree. For this reason, the thread support is
1270+ disabled by default.
1271+
1272+ - The errno extension module adds two tables: errorcode maps errno
1273+ numbers to errno names (e.g. EINTR), and errorcode maps them to
1274+ message strings. (The latter is redundant because the new call
1275+ posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1276+
1277+ - The readline extension module now provides some interfaces to
1278+ internal readline routines that make it possible to write a completer
1279+ in Python. An example completer, rlcompleter.py, is provided.
1280+
1281+ When completing a simple identifier, it completes keywords,
1282+ built-ins and globals in __main__; when completing
1283+ NAME.NAME..., it evaluates (!) the expression up to the last
1284+ dot and completes its attributes.
1285+
1286+ It's very cool to do "import string" type "string.", hit the
1287+ completion key (twice), and see the list of names defined by
1288+ the string module!
1289+
1290+ Tip: to use the tab key as the completion key, call
1291+
1292+ readline.parse_and_bind("tab: complete")
1293+
1294+ - The traceback.py module has a new function tb_lineno() by Marc-Andre
1295+ Lemburg which extracts the line number from the linenumber table in
1296+ the code object. Apparently the traceback object doesn't contains the
1297+ right linenumber when -O is used. Rather than guessing whether -O is
1298+ on or off, the module itself uses tb_lineno() unconditionally.
1299+
1300+ - Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1301+ to tag_bind() so it works again.
1302+
1303+ - The pystone script is now a standard library module. Example use:
1304+ "import test.pystone; test.pystone.main()".
1305+
1306+ - The import of the readline module in interactive mode is now also
1307+ attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1308+ Lemburg, who asked for this. :-)
1309+
1310+ - rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1311+ Mullender, to be closer to the standard. This fixes the getaddr()
1312+ method. Unfortunately, getaddrlist() is as broken as ever, since it
1313+ splits on commas without regard for RFC 822 quoting conventions.
1314+
1315+ - pprint.py: correctly emit trailing "," in singleton tuples.
1316+
1317+ - _tkinter.c: export names for its type objects, TkappType and
1318+ TkttType.
1319+
1320+ - pickle.py: use __module__ when defined; fix a particularly hard to
1321+ reproduce bug that confuses the memo when temporary objects are
1322+ returned by custom pickling interfaces; and a semantic change: when
1323+ unpickling the instance variables of an instance, use
1324+ inst.__dict__.update(value) instead of a for loop with setattr() over
1325+ the value.keys(). This is more consistent (the pickling doesn't use
1326+ getattr() either but pickles inst.__dict__) and avoids problems with
1327+ instances that have a __setattr__ hook. But it *is* a semantic change
1328+ (because the setattr hook is no longer used). So beware!
1329+
1330+ - config.h is now installed (at last) in
1331+ $exec_prefix/include/python1.5/. For most sites, this means that it
1332+ is actually in $prefix/include/python1.5/, with all the other Python
1333+ include files, since $prefix and $exec_prefix are the same by
1334+ default.
1335+
1336+ - The imp module now supports parts of the functionality to implement
1337+ import of hierarchical module names. It now supports find_module()
1338+ and load_module() for all types of modules. Docstrings have been
1339+ added for those functions in the built-in impo module that are still
1340+ relevant (some old interfaces are obsolete). For a sample
1341+ implementation of hierarchical module import in Python, see the new
1342+ library module knee.py.
1343+
1344+ - The % operator on string objects now allows arbitrary nested parens
1345+ in a %(...)X style format. (Brad Howes)
1346+
1347+ - Reverse the order in which Setup and Setup.local are passed to the
1348+ makesetup script. This allows variable definitions in Setup.local to
1349+ override definitions in Setup. (But you'll still have to edit Setup
1350+ if you want to disable modules that are enabled by default, or if such
1351+ modules need non-standard options.)
1352+
1353+ - Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1354+ is like PyImport_ImporModule(name) but receives the globals and locals
1355+ dict and the fromlist arguments as well. (The name is a char*; the
1356+ others are PyObject*s).
1357+
1358+ - The 'p' format in the struct extension module alloded to above is
1359+ new in 1.5a4.
1360+
1361+ - The xlib extension module has been debugged and improved.
1362+
1363+ - The types.py module now uses try-except in a few places to make it
1364+ more likely that it can be imported in restricted mode. Some type
1365+ names are undefined in that case, e.g. CodeType (inaccessible),
1366+ FileType (not always accessible), and TracebackType and FrameType
1367+ (inaccessible).
1368+
1369+ - In urllib.py: added separate administration of temporary files
1370+ created y URLopener.retrieve() so cleanup() can properly remove them.
1371+ The old code removed everything in tempcache which was a bad idea if
1372+ the user had passed a non-temp file into it. Also, in basejoin(),
1373+ interpret relative paths starting in "../". This is necessary if the
1374+ server uses symbolic links.
1375+
1376+ - The Windows build procedure and project files are now based on
1377+ Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1378+ directory. It is much more robust, and properly builds separate Debug
1379+ and Release versions. (The installer will be added shortly.)
1380+
1381+ - Added casts and changed some return types in regexpr.c to avoid
1382+ compiler warnings or errors on some platforms.
1383+
1384+ - The AIX build tools for shared libraries now supports VPATH. (Donn
1385+ Cave)
1386+
1387+ - By default, disable the "portable" multimedia modules audioop,
1388+ imageop, and rgbimg, since they don't work on 64-bit platforms.
1389+
1390+ - Fixed a nasty bug in cStringIO.c when code was actually using the
1391+ close() method (the destructors would try to free certain fields a
1392+ second time).
1393+
1394+ - For those who think they need it, there's a "user.py" module. This
1395+ is *not* imported by default, but can be imported to run user-specific
1396+ setup commands, ~/.pythonrc.py.
1397+
1398+ - Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1399+ Vladimir Marangozov, and others.
1400+
1401+ - Added os.altsep; this is '/' on DOS/Windows, and None on systems
1402+ with a sane filename syntax.
1403+
1404+ - os.py: Write out the dynamic OS choice, to avoid exec statements.
1405+ Adding support for a new OS is now a bit more work, but I bet that
1406+ 'dos' or 'nt' will cover most situations...
1407+
1408+ - The obsolete exception AccessError is now really gone.
1409+
1410+ - Tools/faqwiz/: New installation instructions show how to maintain
1411+ multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
1412+ Added instructions to bootstrap script, too. Version bumped to 0.8.
1413+ Added <html>...</html> feature suggested by Skip Montanaro. Added
1414+ leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1415+ default SRCDIR.
1416+
1417+ - Documentation for the relatively new modules "keyword" and "symbol"
1418+ has been added (to the end of the section on the parser extension
1419+ module).
0 commit comments