home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / pythonwin / python.exe / NEWS < prev    next >
Encoding:
Text File  |  2003-10-02  |  106.1 KB  |  2,558 lines

  1. +++++++++++
  2. Python News
  3. +++++++++++
  4.  
  5. (editors: check NEWS.help for information about editing NEWS using ReST.)
  6.  
  7. What's New in Python 2.3.2 (final)?
  8. ===================================
  9.  
  10. *Release date: 03-Oct-2003*
  11.  
  12. Core and builtins
  13. -----------------
  14.  
  15. - A workaround for an OpenBSD compiler bug that meant python failed to
  16.   detect floating point overflow in some cases.
  17.  
  18. Tools/Demos
  19. -----------
  20.  
  21. - Tools/scripts/md5sum.py opens files in binary mode by default. Opening
  22.   in text mode is almost certainly not what you want.
  23.  
  24. Extension modules
  25. -----------------
  26.  
  27. - The documentation for bsddb now warns strongly about using the legacy
  28.   API in multi-threaded applications.
  29.  
  30. What's New in Python 2.3.2c1?
  31. =============================
  32.  
  33. *Release date: 30-Sep-2003*
  34.  
  35. Build
  36. -----
  37.  
  38. - A bug in the autoconf machinery meant that os.fsync was never available.
  39.  
  40. - A bug in autoconf meant a bunch of symbols were undefined on HP/UX.
  41.  
  42. Mac
  43. ---
  44.  
  45. - The Framework build now identifies itself as 2.3.2.
  46.  
  47. What's New in Python 2.3.1?
  48. ===========================
  49.  
  50. *Release date: 23-Sep-2003*
  51.  
  52. Core and builtins
  53. -----------------
  54.  
  55. - Patch #805613: Fix usage of the PTH library.
  56.  
  57. - Fixed a bug in the cache of length-one Unicode strings that could
  58.   lead to a seg fault.  The specific problem occurred when an earlier,
  59.   non-fatal error left an uninitialized Unicode object in the
  60.   freelist.
  61.  
  62. - Fixed a leak in class objects defining a comparison but not a hash
  63.   function.
  64.  
  65. - Bug #789402, fixed memory leak when opening a file object.
  66.  
  67. - Fixed a leak when new code objects are instantiated.
  68.  
  69. - Bug #800796: slice(1).__hash__() now raises a TypeError, unhashable type.
  70.  
  71. - Bug #603724: Pass an explicit buffer to setvbuf in PyFile_SetBufSize().
  72.  
  73. - Bug #795506:  The % formatting operator did not support '%F' as
  74.   had been documented.
  75.  
  76. - Bug #775985: Only set stdout.encoding if a codec is available.
  77.  
  78. Extension modules
  79. -----------------
  80.  
  81. - The _bsddb module now supports Berkeley DB 4.2.
  82.  
  83. - Bug #698282: Add __file__ to dynamic modules in multiple interpreters.
  84.  
  85. - Patch #798145: Return correct information from nl_langinfo(RADIXCHAR).
  86.  
  87. - Bug #797447: Correct confusing error message for unsupported locales.
  88.  
  89. - Patch #798534:  fixed memory leak in os.popen().
  90.  
  91. - Bug #793826:  re-ordered the reference counting code in
  92.   itertools.izip() to prevent re-entrancy anomalies.  Also,
  93.   if given zero arguments, it now returns an empty iterator
  94.   rather than raising a type error.
  95.  
  96. - Bug #770485: cStringIO did not support the f.closed attribute.
  97.  
  98. - Patch #781722: Gracefully reject AF_INET6 in socket.inet_pton
  99.   if IPv6 is disabled.
  100.  
  101. - Bug #783312: Release host name memory in socket calls.
  102.  
  103. Library
  104. -------
  105.  
  106. - Bug #709491: Reset __starttext_tag in sgmllib.
  107.  
  108. - The bsddb module and dbhash module now support the iterator and
  109.   mapping protocols. 
  110.  
  111. - Bug #711632: Reset all state members in HTMLParser.reset.
  112.  
  113. - Bug #792649:  logging.ConfigStreamHandler had an uninitialized variable
  114.  
  115. - The csv module's DictReader and DictWriter classes now accept keyword
  116.   arguments.  This was an omission in the initial implementation.
  117.  
  118. - Bug #453515:  filecmp.dircmp() can now make case insensitive
  119.   filename comparisons.
  120.  
  121. - Bug #798254:  doctest.py can now handle unbound methods.
  122.  
  123. - Bug #797650:  textwrap.py now avoids an infinite loop when one of the
  124.   indent arguments is set longer than the total width.
  125.  
  126. - Bug #796149: time.strptime() now handles having parentheses in the
  127.   format string properly.
  128.  
  129. - The email package handles some RFC 2231 parameters with missing
  130.   CHARSET fields better.  It also includes a patch to parameter
  131.   parsing when semicolons appear inside quotes.
  132.  
  133. - sets.py now runs under Py2.2.  In addition, the argument restrictions
  134.   for most set methods (but not the operators) have been relaxed to
  135.   allow any iterable.
  136.  
  137. - Bug #801342:  random.sample() now accepts a Set as a possible argument.
  138.   Previously, it insisted that the population argument be indexable.
  139.  
  140. - Bug #778964:  random.seed() now uses fractional seconds so that
  141.   rapid successive, seeding calls will produce different sequences.
  142.  
  143. - Bug #777664: Add Tkconstants.HIDDEN.
  144.  
  145. - Bug #781065: test_normalization is updated to the current
  146.   URL of the Unicode 3.2 normalization file.
  147.  
  148. - Bug #782369:  fix memory leak in array module.
  149.  
  150. - Caching in _strptime.py has been re-introduced.  This leads to a large
  151.   performance boost at the cost of not being thread-safe from locale
  152.   changes while executing time.strptime() .
  153.  
  154. - Bug #783952: time.strptime() now properly handles issue of
  155.   time.tzname[0] == time.tzname[1] while time.daylight is set to be
  156.   true.
  157.  
  158. IDLE
  159. ----
  160.  
  161. - Bug #788378: Handle locale.error.
  162.  
  163. - Bug #774680: IDLE now does not fail to save the file anymore
  164.   if the Tk buffer is not a Unicode string, yet eol_convention is.
  165.  
  166. - Bug #782510: The idna codec would fail to support names with a
  167.   trailing full-stop.
  168.  
  169. Tools/Demos
  170. -----------
  171.  
  172. - Patch #713645: Fix typo in checkextensions_win32.
  173.  
  174. - Pynche was fixed to not crash when there is no ~/.pynche file and no
  175.   -d option was given.
  176.  
  177. - texcheck.py now checks for double word errors and erroneous spacing markup.
  178.  
  179. Build
  180. -----
  181.  
  182. - patch #762934: improve detection of broken implementations of tzset().
  183.  
  184. - Patch #798202: detect redhat9 Tcl/Tk in configure script.
  185.  
  186. Windows
  187. -------
  188.  
  189. - The _ssl extension module was built using openssl-0.9.7b.
  190.  
  191. - The Windows installer includes documentation in HTMLHelp format
  192.   instead of single HTML pages.
  193.  
  194.  
  195. What's New in Python 2.3 final?
  196. ===============================
  197.  
  198. *Release date: 29-Jul-2003*
  199.  
  200. IDLE
  201. ----
  202.  
  203. - Bug 778400:  IDLE hangs when selecting "Edit with IDLE" from explorer.
  204.   This was unique to Windows, and was fixed by adding an -n switch to
  205.   the command the Windows installer creates to execute "Edit with IDLE"
  206.   context-menu actions.
  207.  
  208. - IDLE displays a new message upon startup:  some "personal firewall"
  209.   kinds of programs (for example, ZoneAlarm) open a dialog of their
  210.   own when any program opens a socket.  IDLE does use sockets, talking
  211.   on the computer's internal loopback interface.  This connection is not
  212.   visible on any external interface and no data is sent to or received
  213.   from the Internet.  So, if you get such a dialog when opening IDLE,
  214.   asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
  215.   and rest assured no communication external to your machine is taking
  216.   place.  If you don't allow it, IDLE won't be able to start.
  217.  
  218.  
  219. What's New in Python 2.3 release candidate 2?
  220. =============================================
  221.  
  222. *Release date: 24-Jul-2003*
  223.  
  224. Core and builtins
  225. -----------------
  226.  
  227. - It is now possible to import from zipfiles containing additional
  228.   data bytes before the zip compatible archive.  Zipfiles containing a
  229.   comment at the end are still unsupported.
  230.  
  231. Extension modules
  232. -----------------
  233.  
  234. - A longstanding bug in the parser module's initialization could cause
  235.   fatal internal refcount confusion when the module got initialized more
  236.   than once.  This has been fixed.
  237.  
  238. - Fixed memory leak in pyexpat; using the parser's ParseFile() method
  239.   with open files that aren't instances of the standard file type
  240.   caused an instance of the bound .read() method to be leaked on every
  241.   call.
  242.  
  243. - Fixed some leaks in the locale module.
  244.  
  245. Library
  246. -------
  247.  
  248. - Lib/encodings/rot_13.py when used as a script, now more properly
  249.   uses the first Python interpreter on your path.
  250.  
  251. - Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
  252.   fix a locale related bug in the test suite.  Although another patch
  253.   was needed to actually fix the problem, the cache code was not
  254.   restored.
  255.  
  256. IDLE
  257. ----
  258.  
  259. - Calltips patches.
  260.  
  261. Build
  262. -----
  263.  
  264. - For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
  265.   on Panther (OSX 10.3).
  266.  
  267. Windows
  268. -------
  269.  
  270. - The tempfile module could do insane imports on Windows if PYTHONCASEOK
  271.   was set, making temp file creation impossible.  Repaired.
  272.  
  273. - Add a patch to workaround pthread_sigmask() bugs in Cygwin.
  274.  
  275. Mac
  276. ---
  277.  
  278. - Various fixes to pimp.
  279.  
  280. - Scripts runs with pythonw no longer had full window manager access.
  281.  
  282. - Don't force boot-disk-only install, for reasons unknown it causes
  283.   more problems than it solves.
  284.  
  285.  
  286. What's New in Python 2.3 release candidate 1?
  287. =============================================
  288.  
  289. *Release date: 18-Jul-2003*
  290.  
  291. Core and builtins
  292. -----------------
  293.  
  294. - The new function sys.getcheckinterval() returns the last value set
  295.   by sys.setcheckinterval().
  296.  
  297. - Several bugs in the symbol table phase of the compiler have been
  298.   fixed.  Errors could be lost and compilation could fail without
  299.   reporting an error.  SF patch 763201.
  300.  
  301. - The interpreter is now more robust about importing the warnings
  302.   module.  In an executable generated by freeze or similar programs,
  303.   earlier versions of 2.3 would fail if the warnings module could
  304.   not be found on the file system.  Fixes SF bug 771097.
  305.  
  306. - A warning about assignments to module attributes that shadow
  307.   builtins, present in earlier releases of 2.3, has been removed.
  308.  
  309. - It is not possible to create subclasses of builtin types like str
  310.   and tuple that define an itemsize.  Earlier releases of Python 2.3
  311.   allowed this by mistake, leading to crashes and other problems.
  312.  
  313. - The thread_id is now initialized to 0 in a non-thread build.  SF bug
  314.   770247.
  315.  
  316. - SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
  317.  
  318. Extension modules
  319. -----------------
  320.  
  321. - weakref.proxy() can now handle "del obj[i]" for proxy objects
  322.   defining __delitem__.  Formerly, it generated a SystemError.
  323.  
  324. - SSL no longer crashes the interpreter when the remote side disconnects.
  325.  
  326. - On Unix the mmap module can again be used to map device files.
  327.  
  328. - time.strptime now exclusively uses the Python implementation
  329.   contained within the _strptime module.
  330.  
  331. - The print slot of weakref proxy objects was removed, because it was
  332.   not consistent with the object's repr slot.
  333.  
  334. - The mmap module only checks file size for regular files, not
  335.   character or block devices.  SF patch 708374.
  336.  
  337. - The cPickle Pickler garbage collection support was fixed to traverse
  338.   the find_class attribute, if present.
  339.  
  340. - There are several fixes for the bsddb3 wrapper module.
  341.  
  342.   bsddb3 no longer crashes if an environment is closed before a cursor
  343.   (SF bug 763298).
  344.  
  345.   The DB and DBEnv set_get_returns_none function was extended to take
  346.   a level instead of a boolean flag.  The new level 2 means that in
  347.   addition, cursor.set()/.get() methods return None instead of raising
  348.   an exception.
  349.  
  350.   A typo was fixed in DBCursor.join_item(), preventing a crash.
  351.  
  352. Library
  353. -------
  354.  
  355. - distutils now supports MSVC 7.1
  356.  
  357. - doctest now examines all docstrings by default.  Previously, it would
  358.   skip over functions with private names (as indicated by the underscore
  359.   naming convention).  The old default created too much of a risk that
  360.   user tests were being skipped inadvertently.  Note, this change could
  361.   break code in the unlikely case that someone had intentionally put
  362.   failing tests in the docstrings of private functions.  The breakage
  363.   is easily fixable by specifying the old behavior when calling testmod()
  364.   or Tester().
  365.  
  366. - There were several fixes to the way dumbdbms are closed.  It's vital
  367.   that a dumbdbm database be closed properly, else the on-disk data
  368.   and directory files can be left in mutually inconsistent states.
  369.   dumbdbm.py's _Database.__del__() method attempted to close the
  370.   database properly, but a shutdown race in _Database._commit() could
  371.   prevent this from working, so that a program trusting __del__() to
  372.   get the on-disk files in synch could be badly surprised.  The race
  373.   has been repaired.  A sync() method was also added so that shelve
  374.   can guarantee data is written to disk.
  375.  
  376.   The close() method can now be called more than once without complaint.
  377.  
  378. - The classes in threading.py are now new-style classes.  That they
  379.   weren't before was an oversight.
  380.  
  381. - The urllib2 digest authentication handlers now define the correct
  382.   auth_header.  The earlier versions would fail at runtime.
  383.  
  384. - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
  385.   when there are no lines.
  386.  
  387. - SF bug 763637: fix exception in Tkinter with after_cancel
  388.   which could occur with Tk 8.4
  389.  
  390. - SF bug 770601: CGIHTTPServer.py now passes the entire environment
  391.   to child processes.
  392.  
  393. - SF bug 765238: add filter to fnmatch's __all__.
  394.  
  395. - SF bug 748201: make time.strptime() error messages more helpful.
  396.  
  397. - SF patch 764470: Do not dump the args attribute of a Fault object in
  398.   xmlrpclib.
  399.  
  400. - SF patch 549151: urllib and urllib2 now redirect POSTs on 301
  401.   responses.
  402.  
  403. - SF patch 766650: The whichdb module was fixed to recognize dbm files
  404.   generated by gdbm on OS/2 EMX.
  405.  
  406. - SF bugs 763047 and 763052: fixes bug of timezone value being left as
  407.   -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
  408.   is true when it should only when time.daylight is true.
  409.  
  410. - SF bug 764548: re now allows subclasses of str and unicode to be
  411.   used as patterns.
  412.  
  413. - SF bug 763637: In Tkinter, change after_cancel() to handle tuples
  414.   of varying sizes.  Tk 8.4 returns a different number of values
  415.   than Tk 8.3.
  416.  
  417. - SF bug 763023: difflib.ratio() did not catch zero division.
  418.  
  419. - The Queue module now has an __all__ attribute.
  420.  
  421. Tools/Demos
  422. -----------
  423.  
  424. - See Lib/idlelib/NEWS.txt for IDLE news.
  425.  
  426. - SF bug 753592: webchecker/wsgui now handles user supplied directories.
  427.  
  428. - The trace.py script has been removed.  It is now in the standard library.
  429.  
  430. Build
  431. -----
  432.  
  433. - Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
  434.  
  435. - The socket module compiles on IRIX 6.5.10.
  436.  
  437. - An irix64 system is treated the same way as an irix6 system (SF
  438.   patch 764560).
  439.  
  440. - Several definitions were missing on FreeBSD 5.x unless the
  441.   __BSD_VISIBLE symbol was defined.  configure now defines it as
  442.   needed.
  443.  
  444. C API
  445. -----
  446.  
  447. - Unicode objects now support mbcs as a built-in encoding, so the C
  448.   API can use it without deferring to the encodings package.
  449.  
  450. Windows
  451. -------
  452.  
  453. - The Windows implementation of PyThread_start_new_thread() never
  454.   checked error returns from Windows functions correctly.  As a result,
  455.   it could claim to start a new thread even when the Microsoft
  456.   _beginthread() function failed (due to "too many threads" -- this is
  457.   on the order of thousands when it happens).  In these cases, the
  458.   Python exception ::
  459.  
  460.       thread.error: can't start new thread
  461.  
  462.   is raised now.
  463.  
  464. - SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
  465.   use.  The interpreter now calls WSACleanup() from Py_Finalize()
  466.   instead of from DLL teardown.
  467.  
  468. Mac
  469. ---
  470.  
  471. - Bundlebuilder now inherits default values in the right way.  It was
  472.   previously possible for app bundles to get a type of "BNDL" instead
  473.   of "APPL."  Other improvements include, a --build-id option to
  474.   specify the CFBundleIdentifier and using the --python option to set
  475.   the executable in the bundle.
  476.  
  477. - Fixed two bugs in MacOSX framework handling.
  478.  
  479. - pythonw did not allow user interaction in 2.3rc1, this has been fixed.
  480.  
  481. - Python is now compiled with -mno-fused-madd, making all tests pass
  482.   on Panther.
  483.  
  484. What's New in Python 2.3 beta 2?
  485. ================================
  486.  
  487. *Release date: 29-Jun-2003*
  488.  
  489. Core and builtins
  490. -----------------
  491.  
  492. - A program can now set the environment variable PYTHONINSPECT to some
  493.   string value in Python, and cause the interpreter to enter the
  494.   interactive prompt at program exit, as if Python had been invoked
  495.   with the -i option.
  496.  
  497. - list.index() now accepts optional start and stop arguments.  Similar
  498.   changes were made to UserList.index(). SF feature request 754014.
  499.  
  500. - SF patch 751998 fixes an unwanted side effect of the previous fix
  501.   for SF bug 742860 (the next item).
  502.  
  503. - SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys".  This
  504.   wasn't threadsafe, was very inefficient (expected time O(len(dict))
  505.   instead of O(1)), and could raise a spurious RuntimeError if another
  506.   thread mutated the dict during __delitem__, or if a comparison function
  507.   mutated it.  It also neglected to raise KeyError when the key wasn't
  508.   present; didn't raise TypeError when the key wasn't of a weakly
  509.   referencable type; and broke various more-or-less obscure dict
  510.   invariants by using a sequence of equality comparisons over the whole
  511.   set of dict keys instead of computing the key's hash code to narrow
  512.   the search to those keys with the same hash code.  All of these are
  513.   considered to be bugs.  A new implementation of __delitem__ repairs all
  514.   that, but note that fixing these bugs may change visible behavior in
  515.   code relying (whether intentionally or accidentally) on old behavior.
  516.  
  517. - SF bug 734869: Fixed a compiler bug that caused a fatal error when
  518.   compiling a list comprehension that contained another list comprehension
  519.   embedded in a lambda expression.
  520.  
  521. - SF bug 705231:  builtin pow() no longer lets the platform C pow()
  522.   raise -1.0 to integer powers, because (at least) glibc gets it wrong
  523.   in some cases.  The result should be -1.0 if the power is odd and 1.0
  524.   if the power is even, and any float with a sufficiently large exponent
  525.   is (mathematically) an exact even integer.
  526.  
  527. - SF bug 759227: A new-style class that implements __nonzero__() must
  528.   return a bool or int (but not an int subclass) from that method.  This
  529.   matches the restriction on classic classes.
  530.  
  531. - The encoding attribute has been added for file objects, and set to
  532.   the terminal encoding on Unix and Windows.
  533.  
  534. - The softspace attribute of file objects became read-only by oversight.
  535.   It's writable again.
  536.  
  537. - Reverted a 2.3 beta 1 change to iterators for subclasses of list and
  538.   tuple.  By default, the iterators now access data elements directly
  539.   instead of going through __getitem__.  If __getitem__ access is
  540.   preferred, then __iter__ can be overridden.
  541.  
  542. - SF bug 735247: The staticmethod and super types participate in
  543.   garbage collection. Before this change, it was possible for leaks to
  544.   occur in functions with non-global free variables that used these types.
  545.  
  546. Extension modules
  547. -----------------
  548.  
  549. - the socket module has a new exception, socket.timeout, to allow
  550.   timeouts to be handled separately from other socket errors.
  551.  
  552. - SF bug 751276: cPickle has fixed to propagate exceptions raised in
  553.   user code.  In earlier versions, cPickle caught and ignored any
  554.   exception when it performed operations that it expected to raise
  555.   specific exceptions like AttributeError.
  556.  
  557. - cPickle Pickler and Unpickler objects now participate in garbage
  558.   collection.
  559.  
  560. - mimetools.choose_boundary() could return duplicate strings at times,
  561.   especially likely on Windows.  The strings returned are now guaranteed
  562.   unique within a single program run.
  563.  
  564. - thread.interrupt_main() raises KeyboardInterrupt in the main thread.
  565.   dummy_thread has also been modified to try to simulate the behavior.
  566.  
  567. - array.array.insert() now treats negative indices as being relative
  568.   to the end of the array, just like list.insert() does. (SF bug #739313)
  569.  
  570. - The datetime module classes datetime, time, and timedelta are now
  571.   properly subclassable.
  572.  
  573. - _tkinter.{get|set}busywaitinterval was added.
  574.  
  575. - itertools.islice() now accepts stop=None as documented.
  576.   Fixes SF bug #730685.
  577.  
  578. - the bsddb185 module is built in one restricted instance -
  579.   /usr/include/db.h exists and defines HASHVERSION to be 2.  This is true
  580.   for many BSD-derived systems.
  581.  
  582.  
  583. Library
  584. -------
  585.  
  586. - Some happy doctest extensions from Jim Fulton have been added to
  587.   doctest.py.  These are already being used in Zope3.  The two
  588.   primary ones:
  589.  
  590.   doctest.debug(module, name) extracts the doctests from the named object
  591.   in the given module, puts them in a temp file, and starts pdb running
  592.   on that file.  This is great when a doctest fails.
  593.  
  594.   doctest.DocTestSuite(module=None) returns a synthesized unittest
  595.   TestSuite instance, to be run by the unittest framework, which
  596.   runs all the doctests in the module.  This allows writing tests in
  597.   doctest style (which can be clearer and shorter than writing tests
  598.   in unittest style), without losing unittest's powerful testing
  599.   framework features (which doctest lacks).
  600.  
  601. - For compatibility with doctests created before 2.3, if an expected
  602.   output block consists solely of "1" and the actual output block
  603.   consists solely of "True", it's accepted as a match; similarly
  604.   for "0" and "False".  This is quite un-doctest-like, but is practical.
  605.   The behavior can be disabled by passing the new doctest module
  606.   constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
  607.   argument.
  608.  
  609. - ZipFile.testzip() now only traps BadZipfile exceptions.  Previously,
  610.   a bare except caught to much and reported all errors as a problem
  611.   in the archive.
  612.  
  613. - The logging module now has a new function, makeLogRecord() making
  614.   LogHandler easier to interact with DatagramHandler and SocketHandler.
  615.  
  616. - The cgitb module has been extended to support plain text display (SF patch
  617.   569574).
  618.  
  619. - A brand new version of IDLE (from the IDLEfork project at
  620.   SourceForge) is now included as Lib/idlelib.  The old Tools/idle is
  621.   no more.
  622.  
  623. - Added a new module: trace (documentation missing).  This module used
  624.   to be distributed in Tools/scripts.  It uses sys.settrace() to trace
  625.   code execution -- either function calls or individual lines.  It can
  626.   generate tracing output during execution or a post-mortem report of
  627.   code coverage.
  628.  
  629. - The threading module has new functions settrace() and setprofile()
  630.   that cooperate with the functions of the same name in the sys
  631.   module.  A function registered with the threading module will
  632.   be used for all threads it creates.  The new trace module uses this
  633.   to provide tracing for code running in threads.
  634.  
  635. - copy.py: applied SF patch 707900, fixing bug 702858, by Steven
  636.   Taschuk.  Copying a new-style class that had a reference to itself
  637.   didn't work.  (The same thing worked fine for old-style classes.)
  638.   Builtin functions are now treated as atomic, fixing bug #746304.
  639.  
  640. - difflib.py has two new functions:  context_diff() and unified_diff().
  641.  
  642. - More fixes to urllib (SF 549151): (a) When redirecting, always use
  643.   GET.  This is common practice and more-or-less sanctioned by the
  644.   HTTP standard. (b) Add a handler for 307 redirection, which becomes
  645.   an error for POST, but a regular redirect for GET and HEAD
  646.  
  647. - Added optional 'onerror' argument to os.walk(), to control error
  648.   handling.
  649.  
  650. - inspect.is{method|data}descriptor was added, to allow pydoc display
  651.   __doc__ of data descriptors.
  652.  
  653. - Fixed socket speed loss caused by use of the _socketobject wrapper class
  654.   in socket.py.
  655.  
  656. - timeit.py now checks the current directory for imports.
  657.  
  658. - urllib2.py now knows how to order proxy classes, so the user doesn't
  659.   have to insert it in front of other classes, nor do dirty tricks like
  660.   inserting a "dummy" HTTPHandler after a ProxyHandler when building an
  661.   opener with proxy support.
  662.  
  663. - Iterators have been added for dbm keys.
  664.  
  665. - random.Random objects can now be pickled.
  666.  
  667. Tools/Demos
  668. -----------
  669.  
  670. - pydoc now offers help on keywords and topics.
  671.  
  672. - Tools/idle is gone; long live Lib/idlelib.
  673.  
  674. - diff.py prints file diffs in context, unified, or ndiff formats,
  675.   providing a command line interface to difflib.py.
  676.  
  677. - texcheck.py is a new script for making a rough validation of Python LaTeX
  678.   files.
  679.  
  680. Build
  681. -----
  682.  
  683. - Setting DESTDIR during 'make install' now allows specifying a
  684.   different root directory.
  685.  
  686. C API
  687. -----
  688.  
  689. - PyType_Ready():  If a type declares that it participates in gc
  690.   (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
  691.   tp_free slot is the default _PyObject_Del, and type does not define
  692.   a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
  693.   Previously _PyObject_Del was inherited, which could at best lead to a
  694.   segfault.  In addition, if even after this magic the type's tp_free
  695.   slot is _PyObject_Del or NULL, and the type is a base type
  696.   (Py_TPFLAGS_BASETYPE), TypeError is raised:  since the type is a base
  697.   type, its dealloc function must call type->tp_free, and since the type
  698.   is gc'able, tp_free must not be NULL or _PyObject_Del.
  699.  
  700. - PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
  701.   from C) to interrupt a thread by sending it an exception.  It is
  702.   intentional that you have to write your own C extension to call it
  703.   from Python.
  704.  
  705.  
  706. New platforms
  707. -------------
  708.  
  709. None this time.
  710.  
  711. Tests
  712. -----
  713.  
  714. - test_imp rewritten so that it doesn't raise RuntimeError if run as a
  715.   side effect of being imported ("import test.autotest").
  716.  
  717. Windows
  718. -------
  719.  
  720. - The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
  721.  
  722. - The installer always suggested that Python be installed on the C:
  723.   drive, due to a hardcoded "C:" generated by the Wise installation
  724.   wizard.  People with machines where C: is not the system drive
  725.   usually want Python installed on whichever drive is their system drive
  726.   instead.  We removed the hardcoded "C:", and two testers on machines
  727.   where C: is not the system drive report that the installer now
  728.   suggests their system drive.  Note that you can always select the
  729.   directory you want in the "Select Destination Directory" dialog --
  730.   that's what it's for.
  731.  
  732. Mac
  733. ---
  734.  
  735. - There's a new module called "autoGIL", which offers a mechanism to
  736.   automatically release the Global Interpreter Lock when an event loop
  737.   goes to sleep, allowing other threads to run. It's currently only
  738.   supported on OSX, in the Mach-O version.
  739. - The OSA modules now allow direct access to properties of the
  740.   toplevel application class (in AppleScript terminology).
  741. - The Package Manager can now update itself.
  742.  
  743. SourceForge Bugs and Patches Applied
  744. ------------------------------------
  745.  
  746. 430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
  747. 598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
  748. 622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
  749. 661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
  750. 683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
  751. 697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
  752. 713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
  753. 724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
  754. 727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
  755. 729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
  756. 730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
  757. 731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
  758. 732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
  759. 733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
  760. 735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
  761. 740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
  762. 744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
  763. 745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
  764. 747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
  765. 749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
  766. 751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
  767. 753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
  768. 755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
  769. 757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
  770. 760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
  771.  
  772.  
  773. What's New in Python 2.3 beta 1?
  774. ================================
  775.  
  776. *Release date: 25-Apr-2003*
  777.  
  778. Core and builtins
  779. -----------------
  780.  
  781. - New format codes B, H, I, k and K have been implemented for
  782.   PyArg_ParseTuple and PyBuild_Value.
  783.  
  784. - New builtin function sum(seq, start=0) returns the sum of all the
  785.   items in iterable object seq, plus start (items are normally numbers,
  786.   and cannot be strings).
  787.  
  788. - bool() called without arguments now returns False rather than
  789.   raising an exception.  This is consistent with calling the
  790.   constructors for the other builtin types -- called without argument
  791.   they all return the false value of that type.  (SF patch #724135)
  792.  
  793. - In support of PEP 269 (making the pgen parser generator accessible
  794.   from Python), some changes to the pgen code structure were made; a
  795.   few files that used to be linked only with pgen are now linked with
  796.   Python itself.
  797.  
  798. - The repr() of a weakref object now shows the __name__ attribute of
  799.   the referenced object, if it has one.
  800.  
  801. - super() no longer ignores data descriptors, except __class__.  See
  802.   the thread started at
  803.   http://mail.python.org/pipermail/python-dev/2003-April/034338.html
  804.  
  805. - list.insert(i, x) now interprets negative i as it would be
  806.   interpreted by slicing, so negative values count from the end of the
  807.   list.  This was the only place where such an interpretation was not
  808.   placed on a list index.
  809.  
  810. - range() now works even if the arguments are longs with magnitude
  811.   larger than sys.maxint, as long as the total length of the sequence
  812.   fits.  E.g., range(2**100, 2**101, 2**100) is the following list:
  813.   [1267650600228229401496703205376L].  (SF patch #707427.)
  814.  
  815. - Some horridly obscure problems were fixed involving interaction
  816.   between garbage collection and old-style classes with "ambitious"
  817.   getattr hooks.  If an old-style instance didn't have a __del__ method,
  818.   but did have a __getattr__ hook, and the instance became reachable
  819.   only from an unreachable cycle, and the hook resurrected or deleted
  820.   unreachable objects when asked to resolve "__del__", anything up to
  821.   a segfault could happen.  That's been repaired.
  822.  
  823. - dict.pop now takes an optional argument specifying a default
  824.   value to return if the key is not in the dict.  If a default is not
  825.   given and the key is not found, a KeyError will still be raised.
  826.   Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
  827.   [SF patch #693753] (contributed by Michael Stone.)
  828.  
  829. - sys.getfilesystemencoding() was added to expose
  830.   Py_FileSystemDefaultEncoding.
  831.  
  832. - New function sys.exc_clear() clears the current exception.  This is
  833.   rarely needed, but can sometimes be useful to release objects
  834.   referenced by the traceback held in sys.exc_info()[2].  (SF patch
  835.   #693195.)
  836.  
  837. - On 64-bit systems, a dictionary could contain duplicate long/int keys
  838.   if the key value was larger than 2**32.  See SF bug #689659.
  839.  
  840. - Fixed SF bug #663074. The codec system was using global static
  841.   variables to store internal data. As a result, any attempts to use the
  842.   unicode system with multiple active interpreters, or successive
  843.   interpreter executions, would fail.
  844.  
  845. - "%c" % u"a" now returns a unicode string instead of raising a
  846.   TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
  847.   of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
  848.  
  849. Extension modules
  850. -----------------
  851.  
  852. - The socket module now provides the functions inet_pton and inet_ntop
  853.   for converting between string and packed representation of IP
  854.   addresses.  There is also a new module variable, has_ipv6, which is
  855.   True iff the current Python has IPv6 support.  See SF patch #658327.
  856.  
  857. - Tkinter wrappers around Tcl variables now pass objects directly
  858.   to Tcl, instead of first converting them to strings.
  859.  
  860. - The .*? pattern in the re module is now special-cased to avoid the
  861.   recursion limit.  (SF patch #720991 -- many thanks to Gary Herron
  862.   and Greg Chapman.)
  863.  
  864. - New function sys.call_tracing() allows pdb to debug code
  865.   recursively.
  866.  
  867. - New function gc.get_referents(obj) returns a list of objects
  868.   directly referenced by obj.  In effect, it exposes what the object's
  869.   tp_traverse slot does, and can be helpful when debugging memory
  870.   leaks.
  871.  
  872. - The iconv module has been removed from this release.
  873.  
  874. - The platform-independent routines for packing floats in IEEE formats
  875.   (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
  876.   pickling of floats) ignored that rounding can cause a carry to
  877.   propagate.  The worst consequence was that, in rare cases, <f and >f
  878.   could produce strings that, when unpacked again, were a factor of 2
  879.   away from the original float.  This has been fixed.  See SF bug
  880.   #705836.
  881.  
  882. - New function time.tzset() provides access to the C library tzset()
  883.   function, if supported.  (SF patch #675422.)
  884.  
  885. - Using createfilehandler, deletefilehandler, createtimerhandler functions
  886.   on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
  887.   See SF bug #692416.
  888.  
  889. - Modified the fcntl.ioctl() function to allow modification of a passed
  890.   mutable buffer (for details see the reference documentation).
  891.  
  892. - Made user requested changes to the itertools module.
  893.   Subsumed the times() function into repeat().
  894.   Added chain() and cycle().
  895.  
  896. - The rotor module is now deprecated; the encryption algorithm it uses
  897.   is not believed to be secure, and including crypto code with Python
  898.   has implications for exporting and importing it in various countries.
  899.  
  900. - The socket module now always uses the _socketobject wrapper class, even on
  901.   platforms which have dup(2).  The makefile() method is built directly
  902.   on top of the socket without duplicating the file descriptor, allowing
  903.   timeouts to work properly.
  904.  
  905. Library
  906. -------
  907.  
  908. - New generator function os.walk() is an easy-to-use alternative to
  909.   os.path.walk().  See os module docs for details.  os.path.walk()
  910.   isn't deprecated at this time, but may become deprecated in a
  911.   future release.
  912.  
  913. - Added new module "platform" which provides a wide range of tools
  914.   for querying platform dependent features.
  915.  
  916. - netrc now allows ASCII punctuation characters in passwords.
  917.  
  918. - shelve now supports the optional writeback argument, and exposes
  919.   pickle protocol versions.
  920.  
  921. - Several methods of nntplib.NNTP have grown an optional file argument
  922.   which specifies a file where to divert the command's output
  923.   (already supported by the body() method).  (SF patch #720468)
  924.  
  925. - The self-documenting XML server library DocXMLRPCServer was added.
  926.  
  927. - Support for internationalized domain names has been added through
  928.   the 'idna' and 'punycode' encodings, the 'stringprep' module, the
  929.   'mkstringprep' tool, and enhancements to the socket and httplib
  930.   modules.
  931.  
  932. - htmlentitydefs has two new dictionaries: name2codepoint maps
  933.   HTML entity names to Unicode codepoints (as integers).
  934.   codepoint2name is the reverse mapping. See SF patch #722017.
  935.  
  936. - pdb has a new command, "debug", which lets you step through
  937.   arbitrary code from the debugger's (pdb) prompt.
  938.  
  939. - unittest.failUnlessEqual and its equivalent unittest.assertEqual now
  940.   return 'not a == b' rather than 'a != b'.  This gives the desired
  941.   result for classes that define __eq__ without defining __ne__.
  942.  
  943. - sgmllib now supports SGML marked sections, in particular the
  944.   MS Office extensions.
  945.  
  946. - The urllib module now offers support for the iterator protocol.
  947.   SF patch 698520 contributed by Brett Cannon.
  948.  
  949. - New module timeit provides a simple framework for timing the
  950.   execution speed of expressions and statements.
  951.  
  952. - sets.Set objects now support mixed-type __eq__ and __ne__, instead
  953.   of raising TypeError.  If x is a Set object and y is a non-Set object,
  954.   x == y is False, and x != y is True.  This is akin to the change made
  955.   for mixed-type comparisons of datetime objects in 2.3a2; more info
  956.   about the rationale is in the NEWS entry for that.  See also SF bug
  957.   report <http://www.python.org/sf/693121>.
  958.  
  959. - On Unix platforms, if os.listdir() is called with a Unicode argument,
  960.   it now returns Unicode strings.  (This behavior was added earlier
  961.   to the Windows NT/2k/XP version of os.listdir().)
  962.  
  963. - Distutils: both 'py_modules' and 'packages' keywords can now be specified
  964.   in core.setup().  Previously you could supply one or the other, but
  965.   not both of them.  (SF patch #695090 from Bernhard Herzog)
  966.  
  967. - New csv package makes it easy to read/write CSV files.
  968.  
  969. - Module shlex has been extended to allow posix-like shell parsings,
  970.   including a split() function for easy spliting of quoted strings and
  971.   commands. An iterator interface was also implemented.
  972.  
  973. Tools/Demos
  974. -----------
  975.  
  976. - New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
  977.   See the module docstring for details.
  978.  
  979. Build
  980. -----
  981.  
  982. - Fix problem building on OSF1 because the compiler only accepted
  983.   preprocessor directives that start in column 1.  (SF bug #691793.)
  984.  
  985. C API
  986. -----
  987.  
  988. - Added PyGC_Collect(), equivalent to calling gc.collect().
  989.  
  990. - PyThreadState_GetDict() was changed not to raise an exception or
  991.   issue a fatal error when no current thread state is available.  This
  992.   makes it possible to print dictionaries when no thread is active.
  993.  
  994. - LONG_LONG was renamed to PY_LONG_LONG.  Extensions that use this and
  995.   need compatibility with previous versions can use this:
  996.  
  997.     #ifndef  PY_LONG_LONG
  998.     #define  PY_LONG_LONG  LONG_LONG
  999.     #endif
  1000.  
  1001. - Added PyObject_SelfIter() to fill the tp_iter slot for the
  1002.   typical case where the method returns its self argument.
  1003.  
  1004. - The extended type structure used for heap types (new-style
  1005.   classes defined by Python code using a class statement) is now
  1006.   exported from object.h as PyHeapTypeObject.  (SF patch #696193.)
  1007.  
  1008. New platforms
  1009. -------------
  1010.  
  1011. None this time.
  1012.  
  1013. Tests
  1014. -----
  1015.  
  1016. - test_timeout now requires -u network to be passed to regrtest to run.
  1017.   See SF bug #692988.
  1018.  
  1019. Windows
  1020. -------
  1021.  
  1022. - os.fsync() now exists on Windows, and calls the Microsoft _commit()
  1023.   function.
  1024.  
  1025. - New function winsound.MessageBeep() wraps the Win32 API
  1026.   MessageBeep().
  1027.  
  1028. Mac
  1029. ---
  1030.  
  1031. - os.listdir() now returns Unicode strings on MacOS X when called with
  1032.   a Unicode argument. See the general news item under "Library".
  1033.  
  1034. - A new method MacOS.WMAvailable() returns true if it is safe to access
  1035.   the window manager, false otherwise.
  1036.  
  1037. - EasyDialogs dialogs are now movable-modal, and if the application is
  1038.   currently in the background they will ask to be moved to the foreground
  1039.   before displaying.
  1040.  
  1041. - OSA Scripting support has improved a lot, and gensuitemodule.py can now
  1042.   be used by mere mortals. The documentation is now also more or less
  1043.   complete.
  1044.  
  1045. - The IDE (in a framework build) now includes introductory documentation
  1046.   in Apple Help Viewer format.
  1047.  
  1048.  
  1049. What's New in Python 2.3 alpha 2?
  1050. =================================
  1051.  
  1052. *Release date: 19-Feb-2003*
  1053.  
  1054. Core and builtins
  1055. -----------------
  1056.  
  1057. - Negative positions returned from PEP 293 error callbacks are now
  1058.   treated as being relative to the end of the input string. Positions
  1059.   that are out of bounds raise an IndexError.
  1060.  
  1061. - sys.path[0] (the directory from which the script is loaded) is now
  1062.   turned into an absolute pathname, unless it is the empty string.
  1063.   (SF patch #664376.)
  1064.  
  1065. - Finally fixed the bug in compile() and exec where a string ending
  1066.   with an indented code block but no newline would raise SyntaxError.
  1067.   This would have been a four-line change in parsetok.c...  Except
  1068.   codeop.py depends on this behavior, so a compilation flag had to be
  1069.   invented that causes the tokenizer to revert to the old behavior;
  1070.   this required extra changes to 2 .h files, 2 .c files, and 2 .py
  1071.   files.  (Fixes SF bug #501622.)
  1072.  
  1073. - If a new-style class defines neither __new__ nor __init__, its
  1074.   constructor would ignore all arguments.  This is changed now: the
  1075.   constructor refuses arguments in this case.  This might break code
  1076.   that worked under Python 2.2.  The simplest fix is to add a no-op
  1077.   __init__: ``def __init__(self, *args, **kw): pass``.
  1078.  
  1079. - Through a bytecode optimizer bug (and I bet you didn't even know
  1080.   Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
  1081.   with a leading minus sign would come out with the wrong sign.
  1082.   ("Unsigned" hex/oct constants are those with a face value in the
  1083.   range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
  1084.   always been interpreted as negative numbers through sign folding.)
  1085.   E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
  1086.   come out as -4294967295.  This was the case in Python 2.2 through
  1087.   2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
  1088.   value, but according to PEP 237 it really needs to be 1 now.  This
  1089.   will be backported to Python 2.2.3 a well.  (SF #660455)
  1090.  
  1091. - int(s, base) sometimes sign-folds hex and oct constants; it only
  1092.   does this when base is 0 and s.strip() starts with a '0'.  When the
  1093.   sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
  1094.   machine, which returns -1, a FutureWarning is now issued; in Python
  1095.   2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
  1096.   int("0xffffffff", 16) right now.  (PEP 347)
  1097.  
  1098. - super(X, x): x may now be a proxy for an X instance, i.e.
  1099.   issubclass(x.__class__, X) but not issubclass(type(x), X).
  1100.  
  1101. - isinstance(x, X): if X is a new-style class, this is now equivalent
  1102.   to issubclass(type(x), X) or issubclass(x.__class__, X).  Previously
  1103.   only type(x) was tested.  (For classic classes this was already the
  1104.   case.)
  1105.  
  1106. - compile(), eval() and the exec statement now fully support source code
  1107.   passed as unicode strings.
  1108.  
  1109. - int subclasses can be initialized with longs if the value fits in an int.
  1110.   See SF bug #683467.
  1111.  
  1112. - long(string, base) takes time linear in len(string) when base is a power
  1113.   of 2 now.  It used to take time quadratic in len(string).
  1114.  
  1115. - filter returns now Unicode results for Unicode arguments.
  1116.  
  1117. - raw_input can now return Unicode objects.
  1118.  
  1119. - List objects' sort() method now accepts None as the comparison function.
  1120.   Passing None is semantically identical to calling sort() with no
  1121.   arguments.
  1122.  
  1123. - Fixed crash when printing a subclass of str and __str__ returned self.
  1124.   See SF bug #667147.
  1125.  
  1126. - Fixed an invalid RuntimeWarning and an undetected error when trying
  1127.   to convert a long integer into a float which couldn't fit.
  1128.   See SF bug #676155.
  1129.  
  1130. - Function objects now have a __module__ attribute that is bound to
  1131.   the name of the module in which the function was defined.  This
  1132.   applies for C functions and methods as well as functions and methods
  1133.   defined in Python.  This attribute is used by pickle.whichmodule(),
  1134.   which changes the behavior of whichmodule slightly.  In Python 2.2
  1135.   whichmodule() returns "__main__" for functions that are not defined
  1136.   at the top-level of a module (examples: methods, nested functions).
  1137.   Now whichmodule() will return the proper module name.
  1138.  
  1139. Extension modules
  1140. -----------------
  1141.  
  1142. - operator.isNumberType() now checks that the object has a nb_int or
  1143.   nb_float slot, rather than simply checking whether it has a non-NULL
  1144.   tp_as_number pointer.
  1145.  
  1146. - The imp module now has ways to acquire and release the "import
  1147.   lock": imp.acquire_lock() and imp.release_lock().  Note: this is a
  1148.   reentrant lock, so releasing the lock only truly releases it when
  1149.   this is the last release_lock() call.  You can check with
  1150.   imp.lock_held().  (SF bug #580952 and patch #683257.)
  1151.  
  1152. - Change to cPickle to match pickle.py (see below and PEP 307).
  1153.  
  1154. - Fix some bugs in the parser module.  SF bug #678518.
  1155.  
  1156. - Thanks to Scott David Daniels, a subtle bug in how the zlib
  1157.   extension implemented flush() was fixed.  Scott also rewrote the
  1158.   zlib test suite using the unittest module.  (SF bug #640230 and
  1159.   patch #678531.)
  1160.  
  1161. - Added an itertools module containing high speed, memory efficient
  1162.   looping constructs inspired by tools from Haskell and SML.
  1163.  
  1164. - The SSL module now handles sockets with a timeout set correctly (SF
  1165.   patch #675750, fixing SF bug #675552).
  1166.  
  1167. - os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
  1168.  
  1169. - Fixed broken threadstate swap in readline that could cause fatal
  1170.   errors when a readline hook was being invoked while a background
  1171.   thread was active.  (SF bugs #660476 and #513033.)
  1172.  
  1173. - fcntl now exposes the strops.h I_* constants.
  1174.  
  1175. - Fix a crash on Solaris that occurred when calling close() on
  1176.   an mmap'ed file which was already closed.  (SF patch #665913)
  1177.  
  1178. - Fixed several serious bugs in the zipimport implementation.
  1179.  
  1180. - datetime changes:
  1181.  
  1182.   The date class is now properly subclassable.  (SF bug #720908)
  1183.  
  1184.   The datetime and datetimetz classes have been collapsed into a single
  1185.   datetime class, and likewise the time and timetz classes into a single
  1186.   time class.  Previously, a datetimetz object with tzinfo=None acted
  1187.   exactly like a datetime object, and similarly for timetz.  This wasn't
  1188.   enough of a difference to justify distinct classes, and life is simpler
  1189.   now.
  1190.  
  1191.   today() and now() now round system timestamps to the closest
  1192.   microsecond <http://www.python.org/sf/661086>.  This repairs an
  1193.   irritation most likely seen on Windows systems.
  1194.  
  1195.   In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
  1196.   ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
  1197.   as 0 instead, but a tzinfo subclass wishing to participate in
  1198.   time zone conversion has to take a stand on whether it supports
  1199.   DST; if you don't care about DST, then code dst() to return 0 minutes,
  1200.   meaning that DST is never in effect).
  1201.  
  1202.   The tzinfo methods utcoffset() and dst() must return a timedelta object
  1203.   (or None) now.  In 2.3a1 they could also return an int or long, but that
  1204.   was an unhelpfully redundant leftover from an earlier version wherein
  1205.   they couldn't return a timedelta.  TOOWTDI.
  1206.  
  1207.   The example tzinfo class for local time had a bug.  It was replaced
  1208.   by a later example coded by Guido.
  1209.  
  1210.   datetime.astimezone(tz) no longer raises an exception when the
  1211.   input datetime has no UTC equivalent in tz.  For typical "hybrid" time
  1212.   zones (a single tzinfo subclass modeling both standard and daylight
  1213.   time), this case can arise one hour per year, at the hour daylight time
  1214.   ends.  See new docs for details.  In short, the new behavior mimics
  1215.   the local wall clock's behavior of repeating an hour in local time.
  1216.  
  1217.   dt.astimezone() can no longer be used to convert between naive and aware
  1218.   datetime objects.  If you merely want to attach, or remove, a tzinfo
  1219.   object, without any conversion of date and time members, use
  1220.   dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
  1221.   tzinfo subclass instance.
  1222.  
  1223.   A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
  1224.   to give complete control over how a UTC time is to be converted to
  1225.   a local time.  The default astimezone() implementation calls fromutc()
  1226.   as its last step, so a tzinfo subclass can affect that too by overriding
  1227.   fromutc().  It's expected that the default fromutc() implementation will
  1228.   be suitable as-is for "almost all" time zone subclasses, but the
  1229.   creativity of political time zone fiddling appears unbounded -- fromutc()
  1230.   allows the highly motivated to emulate any scheme expressible in Python.
  1231.  
  1232.   datetime.now():  The optional tzinfo argument was undocumented (that's
  1233.   repaired), and its name was changed to tz ("tzinfo" is overloaded enough
  1234.   already).  With a tz argument, now(tz) used to return the local date
  1235.   and time, and attach tz to it, without any conversion of date and time
  1236.   members.  This was less than useful.  Now now(tz) returns the current
  1237.   date and time as local time in tz's time zone, akin to ::
  1238.  
  1239.       tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
  1240.  
  1241.   where "utc" is an instance of a tzinfo subclass modeling UTC.  Without
  1242.   a tz argument, now() continues to return the current local date and time,
  1243.   as a naive datetime object.
  1244.  
  1245.   datetime.fromtimestamp():  Like datetime.now() above, this had less than
  1246.   useful behavior when the optional tinzo argument was specified.  See
  1247.   also SF bug report <http://www.python.org/sf/660872>.
  1248.  
  1249.   date and datetime comparison:  In order to prevent comparison from
  1250.   falling back to the default compare-object-addresses strategy, these
  1251.   raised TypeError whenever they didn't understand the other object type.
  1252.   They still do, except when the other object has a "timetuple" attribute,
  1253.   in which case they return NotImplemented now.  This gives other
  1254.   datetime objects (e.g., mxDateTime) a chance to intercept the
  1255.   comparison.
  1256.  
  1257.   date, time, datetime and timedelta comparison:  When the exception
  1258.   for mixed-type comparisons in the last paragraph doesn't apply, if
  1259.   the comparison is == then False is returned, and if the comparison is
  1260.   != then True is returned.  Because dict lookup and the "in" operator
  1261.   only invoke __eq__, this allows, for example, ::
  1262.  
  1263.       if some_datetime in some_sequence:
  1264.  
  1265.   and ::
  1266.  
  1267.       some_dict[some_timedelta] = whatever
  1268.  
  1269.   to work as expected, without raising TypeError just because the
  1270.   sequence is heterogeneous, or the dict has mixed-type keys.  [This
  1271.   seems like a good idea to implement for all mixed-type comparisons
  1272.   that don't want to allow falling back to address comparison.]
  1273.  
  1274.   The constructors building a datetime from a timestamp could raise
  1275.   ValueError if the platform C localtime()/gmtime() inserted "leap
  1276.   seconds".  Leap seconds are ignored now.  On such platforms, it's
  1277.   possible to have timestamps that differ by a second, yet where
  1278.   datetimes constructed from them are equal.
  1279.  
  1280.   The pickle format of date, time and datetime objects has changed
  1281.   completely.  The undocumented pickler and unpickler functions no
  1282.   longer exist.  The undocumented __setstate__() and __getstate__()
  1283.   methods no longer exist either.
  1284.  
  1285. Library
  1286. -------
  1287.  
  1288. - The logging module was updated slightly; the WARN level was renamed
  1289.   to WARNING, and the matching function/method warn() to warning().
  1290.  
  1291. - The pickle and cPickle modules were updated with a new pickling
  1292.   protocol (documented by pickletools.py, see below) and several
  1293.   extensions to the pickle customization API (__reduce__, __setstate__
  1294.   etc.).  The copy module now uses more of the pickle customization
  1295.   API to copy objects that don't implement __copy__ or __deepcopy__.
  1296.   See PEP 307 for details.
  1297.  
  1298. - The distutils "register" command now uses http://www.python.org/pypi
  1299.   as the default repository.  (See PEP 301.)
  1300.  
  1301. - the platform dependent path related variables sep, altsep, extsep,
  1302.   pathsep, curdir, pardir and defpath are now defined in the platform
  1303.   dependent path modules (e.g. ntpath.py) rather than os.py, so these
  1304.   variables are now available via os.path.  They continue to be
  1305.   available from the os module.
  1306.   (see <http://www.python.org/sf/680789>).
  1307.  
  1308. - array.array was added to the types repr.py knows about (see
  1309.   <http://www.python.org/sf/680789>).
  1310.  
  1311. - The new pickletools.py contains lots of documentation about pickle
  1312.   internals, and supplies some helpers for working with pickles, such as
  1313.   a symbolic pickle disassembler.
  1314.  
  1315. - Xmlrpclib.py now supports the builtin boolean type.
  1316.  
  1317. - py_compile has a new 'doraise' flag and a new PyCompileError
  1318.   exception.
  1319.  
  1320. - SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
  1321.   class.
  1322.  
  1323. - The sets module now raises TypeError in __cmp__, to clarify that
  1324.   sets are not intended to be three-way-compared; the comparison
  1325.   operators are overloaded as subset/superset tests.
  1326.  
  1327. - Bastion.py and rexec.py are disabled.  These modules are not safe in
  1328.   Python 2.2. or 2.3.
  1329.  
  1330. - realpath is now exported when doing ``from poxixpath import *``.
  1331.   It is also exported for ntpath, macpath, and os2emxpath.
  1332.   See SF bug #659228.
  1333.  
  1334. - New module tarfile from Lars GustΣbel provides a comprehensive interface
  1335.   to tar archive files with transparent gzip and bzip2 compression.
  1336.   See SF patch #651082.
  1337.  
  1338. - urlparse can now parse imap:// URLs.  See SF feature request #618024.
  1339.  
  1340. - Tkinter.Canvas.scan_dragto() provides an optional parameter to support
  1341.   the gain value which is passed to Tk.  SF bug# 602259.
  1342.  
  1343. - Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
  1344.   See SF patch #642974.
  1345.  
  1346. - The dospath module was deleted.  Use the ntpath module when manipulating
  1347.   DOS paths from other platforms.
  1348.  
  1349. Tools/Demos
  1350. -----------
  1351.  
  1352. - Two new scripts (db2pickle.py and pickle2db.py) were added to the
  1353.   Tools/scripts directory to facilitate conversion from the old bsddb module
  1354.   to the new one.  While the user-visible API of the new module is
  1355.   compatible with the old one, it's likely that the version of the
  1356.   underlying database library has changed.  To convert from the old library,
  1357.   run the db2pickle.py script using the old version of Python to convert it
  1358.   to a pickle file.  After upgrading Python, run the pickle2db.py script
  1359.   using the new version of Python to reconstitute your database.  For
  1360.   example:
  1361.  
  1362.     % python2.2 db2pickle.py -h some.db > some.pickle
  1363.     % python2.3 pickle2db.py -h some.db.new < some.pickle
  1364.  
  1365.   Run the scripts without any args to get a usage message.
  1366.  
  1367.  
  1368. Build
  1369. -----
  1370.  
  1371. - The audio driver tests (test_ossaudiodev.py and
  1372.   test_linuxaudiodev.py) are no longer run by default.  This is
  1373.   because they don't always work, depending on your hardware and
  1374.   software.  To run these tests, you must use an invocation like ::
  1375.  
  1376.     ./python Lib/test/regrtest.py -u audio test_ossaudiodev
  1377.  
  1378. - On systems which build using the configure script, compiler flags which
  1379.   used to be lumped together using the OPT flag have been split into two
  1380.   groups, OPT and BASECFLAGS.  OPT is meant to carry just optimization- and
  1381.   debug-related flags like "-g" and "-O3".  BASECFLAGS is meant to carry
  1382.   compiler flags that are required to get a clean compile.  On some
  1383.   platforms (many Linux flavors in particular) BASECFLAGS will be empty by
  1384.   default.  On others, such as Mac OS X and SCO, it will contain required
  1385.   flags.  This change allows people building Python to override OPT without
  1386.   fear of clobbering compiler flags which are required to get a clean build.
  1387.  
  1388. - On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
  1389.   relevant search lists in setup.py.  This allows users building Python to
  1390.   take advantage of the many packages available from the fink project
  1391.   <http://fink.sf.net/>.
  1392.  
  1393. - A new Makefile target, scriptsinstall, installs a number of useful scripts
  1394.   from the Tools/scripts directory.
  1395.  
  1396. C API
  1397. -----
  1398.  
  1399. - PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
  1400.   instead of a plain ``PyObject *``.  (SF patch #686601.)
  1401.  
  1402. - PyNumber_Check() now checks that the object has a nb_int or nb_float
  1403.   slot, rather than simply checking whether it has a non-NULL
  1404.   tp_as_number pointer.
  1405.  
  1406. - A C type that inherits from a base type that defines tp_as_buffer
  1407.   will now inherit the tp_as_buffer pointer if it doesn't define one.
  1408.   (SF #681367)
  1409.  
  1410. - The PyArg_Parse functions now issue a DeprecationWarning if a float
  1411.   argument is provided when an integer is specified (this affects the 'b',
  1412.   'B', 'h', 'H', 'i', and 'l' codes).  Future versions of Python will
  1413.   raise a TypeError.
  1414.  
  1415. Tests
  1416. -----
  1417.  
  1418. - Several tests weren't being run from regrtest.py (test_timeout.py,
  1419.   test_tarfile.py, test_netrc.py, test_multifile.py,
  1420.   test_importhooks.py and test_imp.py).  Now they are.  (Note to
  1421.   developers: please read Lib/test/README when creating a new test, to
  1422.   make sure to do it right!  All tests need to use either unittest or
  1423.   pydoc.)
  1424.  
  1425. - Added test_posix.py, a test suite for the posix module.
  1426.  
  1427. - Added test_hexoct.py, a test suite for hex/oct constant folding.
  1428.  
  1429. Windows
  1430. -------
  1431.  
  1432. - The timeout code for socket connect() didn't work right; this has
  1433.   now been fixed.  test_timeout.py should pass (at least most of the
  1434.   time).
  1435.  
  1436. - distutils' msvccompiler class now passes the preprocessor options to
  1437.   the resource compiler.  See SF patch #669198.
  1438.  
  1439. - The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
  1440.   release without strong cryptography.
  1441.  
  1442. - sys.path[0], if it contains a directory name, is now always an
  1443.   absolute pathname. (SF patch #664376.)
  1444.  
  1445. - The new logging package is now installed by the Windows installer.  It
  1446.   wasn't in 2.3a1 due to oversight.
  1447.  
  1448. Mac
  1449. ---
  1450.  
  1451. - There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
  1452.   and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
  1453.  
  1454. - Most of the standard library now uses pathnames or FSRefs in preference
  1455.   of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
  1456.   in stead of macfs. macfs will probably be deprecated in the future.
  1457.  
  1458. - Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
  1459.   This also makes macfs.FSSpec.SetDates() work again.
  1460.  
  1461. - There is a new module pimp, the package install manager for Python, and
  1462.   accompanying applet PackageManager. These allow you to easily download
  1463.   and install pretested extension packages either in source or binary
  1464.   form. Only in MacPython-OSX.
  1465.  
  1466. - Applets are now built with bundlebuilder in MacPython-OSX, which should make
  1467.   them more robust and also provides a path towards BuildApplication. The
  1468.   downside of this change is that applets can no longer be run from the
  1469.   Terminal window, this will hopefully be fixed in the 2.3b1.
  1470.  
  1471.  
  1472. What's New in Python 2.3 alpha 1?
  1473. =================================
  1474.  
  1475. *Release date: 31-Dec-2002*
  1476.  
  1477. Type/class unification and new-style classes
  1478. --------------------------------------------
  1479.  
  1480. - One can now assign to __bases__ and __name__ of new-style classes.
  1481.  
  1482. - dict() now accepts keyword arguments so that dict(one=1, two=2)
  1483.   is the equivalent of {"one": 1, "two": 2}.  Accordingly,
  1484.   the existing (but undocumented) 'items' keyword argument has
  1485.   been eliminated.  This means that dict(items=someMapping) now has
  1486.   a different meaning than before.
  1487.  
  1488. - int() now returns a long object if the argument is outside the
  1489.   integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
  1490.   all return long objects instead of raising an OverflowError.
  1491.  
  1492. - Assignment to __class__ is disallowed if either the old or the new
  1493.   class is a statically allocated type object (such as defined by an
  1494.   extension module).  This prevents anomalies like 2.__class__ = bool.
  1495.  
  1496. - New-style object creation and deallocation have been sped up
  1497.   significantly; they are now faster than classic instance creation
  1498.   and deallocation.
  1499.  
  1500. - The __slots__ variable can now mention "private" names, and the
  1501.   right thing will happen (e.g. __slots__ = ["__foo"]).
  1502.  
  1503. - The built-ins slice() and buffer() are now callable types.  The
  1504.   types classobj (formerly class), code, function, instance, and
  1505.   instancemethod (formerly instance-method), which have no built-in
  1506.   names but are accessible through the types module, are now also
  1507.   callable.  The type dict-proxy is renamed to dictproxy.
  1508.  
  1509. - Cycles going through the __class__ link of a new-style instance are
  1510.   now detected by the garbage collector.
  1511.  
  1512. - Classes using __slots__ are now properly garbage collected.
  1513.   [SF bug 519621]
  1514.  
  1515. - Tightened the __slots__ rules: a slot name must be a valid Python
  1516.   identifier.
  1517.  
  1518. - The constructor for the module type now requires a name argument and
  1519.   takes an optional docstring argument.  Previously, this constructor
  1520.   ignored its arguments.  As a consequence, deriving a class from a
  1521.   module (not from the module type) is now illegal; previously this
  1522.   created an unnamed module, just like invoking the module type did.
  1523.   [SF bug 563060]
  1524.  
  1525. - A new type object, 'basestring', is added.  This is a common base type
  1526.   for 'str' and 'unicode', and can be used instead of
  1527.   types.StringTypes, e.g. to test whether something is "a string":
  1528.   isinstance(x, basestring) is True for Unicode and 8-bit strings.  This
  1529.   is an abstract base class and cannot be instantiated directly.
  1530.  
  1531. - Changed new-style class instantiation so that when C's __new__
  1532.   method returns something that's not a C instance, its __init__ is
  1533.   not called.  [SF bug #537450]
  1534.  
  1535. - Fixed super() to work correctly with class methods.  [SF bug #535444]
  1536.  
  1537. - If you try to pickle an instance of a class that has __slots__ but
  1538.   doesn't define or override __getstate__, a TypeError is now raised.
  1539.   This is done by adding a bozo __getstate__ to the class that always
  1540.   raises TypeError.  (Before, this would appear to be pickled, but the
  1541.   state of the slots would be lost.)
  1542.  
  1543. Core and builtins
  1544. -----------------
  1545.  
  1546. - Import from zipfiles is now supported.  The name of a zipfile placed
  1547.   on sys.path causes the import statement to look for importable Python
  1548.   modules (with .py, pyc and .pyo extensions) and packages inside the
  1549.   zipfile.  The zipfile import follows the specification (though not
  1550.   the sample implementation) of PEP 273.  The semantics of __path__ are
  1551.   compatible with those that have been implemented in Jython since
  1552.   Jython 2.1.
  1553.  
  1554. - PEP 302 has been accepted.  Although it was initially developed to
  1555.   support zipimport, it offers a new, general import hook mechanism.
  1556.   Several new variables have been added to the sys module:
  1557.   sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
  1558.   make extending the import statement much more convenient than
  1559.   overriding the __import__ built-in function.  For a description of
  1560.   these, see PEP 302.
  1561.  
  1562. - A frame object's f_lineno attribute can now be written to from a
  1563.   trace function to change which line will execute next.  A command to
  1564.   exploit this from pdb has been added.  [SF patch #643835]
  1565.  
  1566. - The _codecs support module for codecs.py was turned into a builtin
  1567.   module to assure that at least the builtin codecs are available
  1568.   to the Python parser for source code decoding according to PEP 263.
  1569.  
  1570. - issubclass now supports a tuple as the second argument, just like
  1571.   isinstance does. ``issubclass(X, (A, B))`` is equivalent to
  1572.   ``issubclass(X, A) or issubclass(X, B)``.
  1573.  
  1574. - Thanks to Armin Rigo, the last known way to provoke a system crash
  1575.   by cleverly arranging for a comparison function to mutate a list
  1576.   during a list.sort() operation has been fixed.  The effect of
  1577.   attempting to mutate a list, or even to inspect its contents or
  1578.   length, while a sort is in progress, is not defined by the language.
  1579.   The C implementation of Python 2.3 attempts to detect mutations,
  1580.   and raise ValueError if one occurs, but there's no guarantee that
  1581.   all mutations will be caught, or that any will be caught across
  1582.   releases or implementations.
  1583.  
  1584. - Unicode file name processing for Windows (PEP 277) is implemented.
  1585.   All platforms now have an os.path.supports_unicode_filenames attribute,
  1586.   which is set to True on Windows NT/2000/XP, and False elsewhere.
  1587.  
  1588. - Codec error handling callbacks (PEP 293) are implemented.
  1589.   Error handling in unicode.encode or str.decode can now be customized.
  1590.  
  1591. - A subtle change to the semantics of the built-in function intern():
  1592.   interned strings are no longer immortal.  You must keep a reference
  1593.   to the return value intern() around to get the benefit.
  1594.  
  1595. - Use of 'None' as a variable, argument or attribute name now
  1596.   issues a SyntaxWarning.  In the future, None may become a keyword.
  1597.  
  1598. - SET_LINENO is gone.  co_lnotab is now consulted to determine when to
  1599.   call the trace function.  C code that accessed f_lineno should call
  1600.   PyCode_Addr2Line instead (f_lineno is still there, but only kept up
  1601.   to date when there is a trace function set).
  1602.  
  1603. - There's a new warning category, FutureWarning.  This is used to warn
  1604.   about a number of situations where the value or sign of an integer
  1605.   result will change in Python 2.4 as a result of PEP 237 (integer
  1606.   unification).  The warnings implement stage B0 mentioned in that
  1607.   PEP.  The warnings are about the following situations:
  1608.  
  1609.     - Octal and hex literals without 'L' prefix in the inclusive range
  1610.       [0x80000000..0xffffffff]; these are currently negative ints, but
  1611.       in Python 2.4 they will be positive longs with the same bit
  1612.       pattern.
  1613.  
  1614.     - Left shifts on integer values that cause the outcome to lose
  1615.       bits or have a different sign than the left operand.  To be
  1616.       precise: x<<n where this currently doesn't yield the same value
  1617.       as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
  1618.  
  1619.     - Conversions from ints to string that show negative values as
  1620.       unsigned ints in the inclusive range [0x80000000..0xffffffff];
  1621.       this affects the functions hex() and oct(), and the string
  1622.       formatting codes %u, %o, %x, and %X.  In Python 2.4, these will
  1623.       show signed values (e.g. hex(-1) currently returns "0xffffffff";
  1624.       in Python 2.4 it will return "-0x1").
  1625.  
  1626. - The bits manipulated under the cover by sys.setcheckinterval() have
  1627.   been changed.  Both the check interval and the ticker used to be
  1628.   per-thread values.  They are now just a pair of global variables.
  1629.   In addition, the default check interval was boosted from 10 to 100
  1630.   bytecode instructions.  This may have some effect on systems that
  1631.   relied on the old default value.  In particular, in multi-threaded
  1632.   applications which try to be highly responsive, response time will
  1633.   increase by some (perhaps imperceptible) amount.
  1634.  
  1635. - When multiplying very large integers, a version of the so-called
  1636.   Karatsuba algorithm is now used.  This is most effective if the
  1637.   inputs have roughly the same size.  If they both have about N digits,
  1638.   Karatsuba multiplication has O(N**1.58) runtime (the exponent is
  1639.   log_base_2(3)) instead of the previous O(N**2).  Measured results may
  1640.   be better or worse than that, depending on platform quirks.  Besides
  1641.   the O() improvement in raw instruction count, the Karatsuba algorithm
  1642.   appears to have much better cache behavior on extremely large integers
  1643.   (starting in the ballpark of a million bits).  Note that this is a
  1644.   simple implementation, and there's no intent here to compete with,
  1645.   e.g., GMP.  It gives a very nice speedup when it applies, but a package
  1646.   devoted to fast large-integer arithmetic should run circles around it.
  1647.  
  1648. - u'%c' will now raise a ValueError in case the argument is an
  1649.   integer outside the valid range of Unicode code point ordinals.
  1650.  
  1651. - The tempfile module has been overhauled for enhanced security.  The
  1652.   mktemp() function is now deprecated; new, safe replacements are
  1653.   mkstemp() (for files) and mkdtemp() (for directories), and the
  1654.   higher-level functions NamedTemporaryFile() and TemporaryFile().
  1655.   Use of some global variables in this module is also deprecated; the
  1656.   new functions have keyword arguments to provide the same
  1657.   functionality.  All Lib, Tools and Demo modules that used the unsafe
  1658.   interfaces have been updated to use the safe replacements.  Thanks
  1659.   to Zack Weinberg!
  1660.  
  1661. - When x is an object whose class implements __mul__ and __rmul__,
  1662.   1.0*x would correctly invoke __rmul__, but 1*x would erroneously
  1663.   invoke __mul__.  This was due to the sequence-repeat code in the int
  1664.   type.  This has been fixed now.
  1665.  
  1666. - Previously, "str1 in str2" required str1 to be a string of length 1.
  1667.   This restriction has been relaxed to allow str1 to be a string of
  1668.   any length.  Thus "'el' in 'hello world'" returns True now.
  1669.  
  1670. - File objects are now their own iterators.  For a file f, iter(f) now
  1671.   returns f (unless f is closed), and f.next() is similar to
  1672.   f.readline() when EOF is not reached; however, f.next() uses a
  1673.   readahead buffer that messes up the file position, so mixing
  1674.   f.next() and f.readline() (or other methods) doesn't work right.
  1675.   Calling f.seek() drops the readahead buffer, but other operations
  1676.   don't.  It so happens that this gives a nice additional speed boost
  1677.   to "for line in file:"; the xreadlines method and corresponding
  1678.   module are now obsolete.  Thanks to Oren Tirosh!
  1679.  
  1680. - Encoding declarations (PEP 263, phase 1) have been implemented.  A
  1681.   comment of the form "# -*- coding: <encodingname> -*-" in the first
  1682.   or second line of a Python source file indicates the encoding.
  1683.  
  1684. - list.sort() has a new implementation.  While cross-platform results
  1685.   may vary, and in data-dependent ways, this is much faster on many
  1686.   kinds of partially ordered lists than the previous implementation,
  1687.   and reported to be just as fast on randomly ordered lists on
  1688.   several major platforms.  This sort is also stable (if A==B and A
  1689.   precedes B in the list at the start, A precedes B after the sort too),
  1690.   although the language definition does not guarantee stability.  A
  1691.   potential drawback is that list.sort() may require temp space of
  1692.   len(list)*2 bytes (``*4`` on a 64-bit machine).  It's therefore possible
  1693.   for list.sort() to raise MemoryError now, even if a comparison function
  1694.   does not.  See <http://www.python.org/sf/587076> for full details.
  1695.  
  1696. - All standard iterators now ensure that, once StopIteration has been
  1697.   raised, all future calls to next() on the same iterator will also
  1698.   raise StopIteration.  There used to be various counterexamples to
  1699.   this behavior, which could caused confusion or subtle program
  1700.   breakage, without any benefits.  (Note that this is still an
  1701.   iterator's responsibility; the iterator framework does not enforce
  1702.   this.)
  1703.  
  1704. - Ctrl+C handling on Windows has been made more consistent with
  1705.   other platforms.  KeyboardInterrupt can now reliably be caught,
  1706.   and Ctrl+C at an interactive prompt no longer terminates the
  1707.   process under NT/2k/XP (it never did under Win9x).  Ctrl+C will
  1708.   interrupt time.sleep() in the main thread, and any child processes
  1709.   created via the popen family (on win2k; we can't make win9x work
  1710.   reliably) are also interrupted (as generally happens on for Linux/Unix.)
  1711.   [SF bugs 231273, 439992 and 581232]
  1712.  
  1713. - sys.getwindowsversion() has been added on Windows.  This
  1714.   returns a tuple with information about the version of Windows
  1715.   currently running.
  1716.  
  1717. - Slices and repetitions of buffer objects now consistently return
  1718.   a string.  Formerly, strings would be returned most of the time,
  1719.   but a buffer object would be returned when the repetition count
  1720.   was one or when the slice range was all inclusive.
  1721.  
  1722. - Unicode objects in sys.path are no longer ignored but treated
  1723.   as directory names.
  1724.  
  1725. - Fixed string.startswith and string.endswith builtin methods
  1726.   so they accept negative indices.  [SF bug 493951]
  1727.  
  1728. - Fixed a bug with a continue inside a try block and a yield in the
  1729.   finally clause.  [SF bug 567538]
  1730.  
  1731. - Most builtin sequences now support "extended slices", i.e. slices
  1732.   with a third "stride" parameter.  For example, "hello world"[::-1]
  1733.   gives "dlrow olleh".
  1734.  
  1735. - A new warning PendingDeprecationWarning was added to provide
  1736.   direction on features which are in the process of being deprecated.
  1737.   The warning will not be printed by default.  To see the pending
  1738.   deprecations, use -Walways::PendingDeprecationWarning::
  1739.   as a command line option or warnings.filterwarnings() in code.
  1740.  
  1741. - Deprecated features of xrange objects have been removed as
  1742.   promised.  The start, stop, and step attributes and the tolist()
  1743.   method no longer exist.  xrange repetition and slicing have been
  1744.   removed.
  1745.  
  1746. - New builtin function enumerate(x), from PEP 279.  Example:
  1747.   enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  1748.   The argument can be an arbitrary iterable object.
  1749.  
  1750. - The assert statement no longer tests __debug__ at runtime.  This means
  1751.   that assert statements cannot be disabled by assigning a false value
  1752.   to __debug__.
  1753.  
  1754. - A method zfill() was added to str and unicode, that fills a numeric
  1755.   string to the left with zeros.  For example,
  1756.   "+123".zfill(6) -> "+00123".
  1757.  
  1758. - Complex numbers supported divmod() and the // and % operators, but
  1759.   these make no sense.  Since this was documented, they're being
  1760.   deprecated now.
  1761.  
  1762. - String and unicode methods lstrip(), rstrip() and strip() now take
  1763.   an optional argument that specifies the characters to strip.  For
  1764.   example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
  1765.  
  1766. - There's a new dictionary constructor (a class method of the dict
  1767.   class), dict.fromkeys(iterable, value=None).  It constructs a
  1768.   dictionary with keys taken from the iterable and all values set to a
  1769.   single value.  It can be used for building sets and for removing
  1770.   duplicates from sequences.
  1771.  
  1772. - Added a new dict method pop(key).  This removes and returns the
  1773.   value corresponding to key.  [SF patch #539949]
  1774.  
  1775. - A new built-in type, bool, has been added, as well as built-in
  1776.   names for its two values, True and False.  Comparisons and sundry
  1777.   other operations that return a truth value have been changed to
  1778.   return a bool instead.  Read PEP 285 for an explanation of why this
  1779.   is backward compatible.
  1780.  
  1781. - Fixed two bugs reported as SF #535905: under certain conditions,
  1782.   deallocating a deeply nested structure could cause a segfault in the
  1783.   garbage collector, due to interaction with the "trashcan" code;
  1784.   access to the current frame during destruction of a local variable
  1785.   could access a pointer to freed memory.
  1786.  
  1787. - The optional object allocator ("pymalloc") has been enabled by
  1788.   default.  The recommended practice for memory allocation and
  1789.   deallocation has been streamlined.  A header file is included,
  1790.   Misc/pymemcompat.h, which can be bundled with 3rd party extensions
  1791.   and lets them use the same API with Python versions from 1.5.2
  1792.   onwards.
  1793.  
  1794. - PyErr_Display will provide file and line information for all exceptions
  1795.   that have an attribute print_file_and_line, not just SyntaxErrors.
  1796.  
  1797. - The UTF-8 codec will now encode and decode Unicode surrogates
  1798.   correctly and without raising exceptions for unpaired ones.
  1799.  
  1800. - Universal newlines (PEP 278) is implemented.  Briefly, using 'U'
  1801.   instead of 'r' when opening a text file for reading changes the line
  1802.   ending convention so that any of '\r', '\r\n', and '\n' is
  1803.   recognized (even mixed in one file); all three are converted to
  1804.   '\n', the standard Python line end character.
  1805.  
  1806. - file.xreadlines() now raises a ValueError if the file is closed:
  1807.   Previously, an xreadlines object was returned which would raise
  1808.   a ValueError when the xreadlines.next() method was called.
  1809.  
  1810. - sys.exit() inadvertently allowed more than one argument.
  1811.   An exception will now be raised if more than one argument is used.
  1812.  
  1813. - Changed evaluation order of dictionary literals to conform to the
  1814.   general left to right evaluation order rule. Now {f1(): f2()} will
  1815.   evaluate f1 first.
  1816.  
  1817. - Fixed bug #521782: when a file was in non-blocking mode, file.read()
  1818.   could silently lose data or wrongly throw an unknown error.
  1819.  
  1820. - The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
  1821.   slots are now always tried after trying the corresponding nb_* slots.
  1822.   This fixes a number of minor bugs (see bug #624807).
  1823.  
  1824. - Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
  1825.  
  1826. Extension modules
  1827. -----------------
  1828.  
  1829. - Added three operators to the operator module:
  1830.     operator.pow(a,b) which is equivalent to:  a**b.
  1831.     operator.is_(a,b) which is equivalent to:  a is b.
  1832.     operator.is_not(a,b) which is equivalent to:  a is not b.
  1833.  
  1834. - posix.openpty now works on all systems that have /dev/ptmx.
  1835.  
  1836. - A module zipimport exists to support importing code from zip
  1837.   archives.
  1838.  
  1839. - The new datetime module supplies classes for manipulating dates and
  1840.   times.  The basic design came from the Zope "fishbowl process", and
  1841.   favors practical commercial applications over calendar esoterica.  See
  1842.  
  1843.       http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
  1844.  
  1845. - _tkinter now returns Tcl objects, instead of strings. Objects which
  1846.   have Python equivalents are converted to Python objects, other objects
  1847.   are wrapped. This can be configured through the wantobjects method,
  1848.   or Tkinter.wantobjects.
  1849.  
  1850. - The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
  1851.   been added as the package bsddb.  The traditional bsddb module is
  1852.   still available in source code, but not built automatically anymore,
  1853.   and is now named bsddb185.  This supports Berkeley DB versions from
  1854.   3.0 to 4.1.  For help converting your databases from the old module (which
  1855.   probably used an obsolete version of Berkeley DB) to the new module, see
  1856.   the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
  1857.   section above.
  1858.  
  1859. - unicodedata was updated to Unicode 3.2. It supports normalization
  1860.   and names for Hangul syllables and CJK unified ideographs.
  1861.  
  1862. - resource.getrlimit() now returns longs instead of ints.
  1863.  
  1864. - readline now dynamically adjusts its input/output stream if
  1865.   sys.stdin/stdout changes.
  1866.  
  1867. - The _tkinter module (and hence Tkinter) has dropped support for
  1868.   Tcl/Tk 8.0 and 8.1.  Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
  1869.   supported.
  1870.  
  1871. - cPickle.BadPickleGet is now a class.
  1872.  
  1873. - The time stamps in os.stat_result are floating point numbers
  1874.   after stat_float_times has been called.
  1875.  
  1876. - If the size passed to mmap.mmap() is larger than the length of the
  1877.   file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
  1878.  
  1879. - The xreadlines module is slated for obsolescence.
  1880.  
  1881. - The strptime function in the time module is now always available (a
  1882.   Python implementation is used when the C library doesn't define it).
  1883.  
  1884. - The 'new' module is no longer an extension, but a Python module that
  1885.   only exists for backwards compatibility.  Its contents are no longer
  1886.   functions but callable type objects.
  1887.  
  1888. - The bsddb.*open functions can now take 'None' as a filename.
  1889.   This will create a temporary in-memory bsddb that won't be
  1890.   written to disk.
  1891.  
  1892. - posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
  1893.   posix.getpgid have been added where available.
  1894.  
  1895. - The locale module now exposes the C library's gettext interface. It
  1896.   also has a new function getpreferredencoding.
  1897.  
  1898. - A security hole ("double free") was found in zlib-1.1.3, a popular
  1899.   third party compression library used by some Python modules.  The
  1900.   hole was quickly plugged in zlib-1.1.4, and the Windows build of
  1901.   Python now ships with zlib-1.1.4.
  1902.  
  1903. - pwd, grp, and resource return enhanced tuples now, with symbolic
  1904.   field names.
  1905.  
  1906. - array.array is now a type object. A new format character
  1907.   'u' indicates Py_UNICODE arrays. For those, .tounicode and
  1908.   .fromunicode methods are available. Arrays now support __iadd__
  1909.   and __imul__.
  1910.  
  1911. - dl now builds on every system that has dlfcn.h.  Failure in case
  1912.   of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
  1913.   is called.
  1914.  
  1915. - The sys module acquired a new attribute, api_version, which evaluates
  1916.   to the value of the PYTHON_API_VERSION macro with which the
  1917.   interpreter was compiled.
  1918.  
  1919. - Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
  1920.   when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
  1921.   returns (None, None, 'ab'), as expected. Also fixed handling of
  1922.   lastindex/lastgroup match attributes in similar cases. For example,
  1923.   when running the expression r'(a)(b)?b' over 'ab', lastindex must be
  1924.   1, not 2.
  1925.  
  1926. - Fixed bug #581080: sre scanner was not checking the buffer limit
  1927.   before increasing the current pointer. This was creating an infinite
  1928.   loop in the search function, once the pointer exceeded the buffer
  1929.   limit.
  1930.  
  1931. - The os.fdopen function now enforces a file mode starting with the
  1932.   letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
  1933.   bug #623464.
  1934.  
  1935. - The linuxaudiodev module is now deprecated; it is being replaced by
  1936.   ossaudiodev.  The interface has been extended to cover a lot more of
  1937.   OSS (see www.opensound.com), including most DSP ioctls and the
  1938.   OSS mixer API.  Documentation forthcoming in 2.3a2.
  1939.  
  1940. Library
  1941. -------
  1942.  
  1943. - imaplib.py now supports SSL (Tino Lange and Piers Lauder).
  1944.  
  1945. - Freeze's modulefinder.py has been moved to the standard library;
  1946.   slightly improved so it will issue less false missing submodule
  1947.   reports (see sf path #643711 for details).  Documentation will follow
  1948.   with Python 2.3a2.
  1949.  
  1950. - os.path exposes getctime.
  1951.  
  1952. - unittest.py now has two additional methods called assertAlmostEqual()
  1953.   and failIfAlmostEqual().  They implement an approximate comparison
  1954.   by rounding the difference between the two arguments and comparing
  1955.   the result to zero.  Approximate comparison is essential for
  1956.   unit tests of floating point results.
  1957.  
  1958. - calendar.py now depends on the new datetime module rather than
  1959.   the time module.  As a result, the range of allowable dates
  1960.   has been increased.
  1961.  
  1962. - pdb has a new 'j(ump)' command to select the next line to be
  1963.   executed.
  1964.  
  1965. - The distutils created windows installers now can run a
  1966.   postinstallation script.
  1967.  
  1968. - doctest.testmod can now be called without argument, which means to
  1969.   test the current module.
  1970.  
  1971. - When canceling a server that implemented threading with a keyboard
  1972.   interrupt, the server would shut down but not terminate (waiting on
  1973.   client threads). A new member variable, daemon_threads, was added to
  1974.   the ThreadingMixIn class in SocketServer.py to make it explicit that
  1975.   this behavior needs to be controlled.
  1976.  
  1977. - A new module, optparse, provides a fancy alternative to getopt for
  1978.   command line parsing.  It is a slightly modified version of Greg
  1979.   Ward's Optik package.
  1980.  
  1981. - UserDict.py now defines a DictMixin class which defines all dictionary
  1982.   methods for classes that already have a minimum mapping interface.
  1983.   This greatly simplifies writing classes that need to be substitutable
  1984.   for dictionaries (such as the shelve module).
  1985.  
  1986. - shelve.py now subclasses from UserDict.DictMixin.  Now shelve supports
  1987.   all dictionary methods.  This eases the transition to persistent
  1988.   storage for scripts originally written with dictionaries in mind.
  1989.  
  1990. - shelve.open and the various classes in shelve.py now accept an optional
  1991.   binary flag, which defaults to False.  If True, the values stored in the
  1992.   shelf are binary pickles.
  1993.  
  1994. - A new package, logging, implements the logging API defined by PEP
  1995.   282.  The code is written by Vinay Sajip.
  1996.  
  1997. - StreamReader, StreamReaderWriter and StreamRecoder in the codecs
  1998.   modules are iterators now.
  1999.  
  2000. - gzip.py now handles files exceeding 2GB.  Files over 4GB also work
  2001.   now (provided the OS supports it, and Python is configured with large
  2002.   file support), but in that case the underlying gzip file format can
  2003.   record only the least-significant 32 bits of the file size, so that
  2004.   some tools working with gzipped files may report an incorrect file
  2005.   size.
  2006.  
  2007. - xml.sax.saxutils.unescape has been added, to replace entity references
  2008.   with their entity value.
  2009.  
  2010. - Queue.Queue.{put,get} now support an optional timeout argument.
  2011.  
  2012. - Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
  2013.   option of tkFileDialog is exposed as function askopenfile{,name}s.
  2014.  
  2015. - Various configure methods of Tkinter have been stream-lined, so that
  2016.   tag_configure, image_configure, window_configure now return a
  2017.   dictionary when invoked with no argument.
  2018.  
  2019. - Importing the readline module now no longer has the side effect of
  2020.   calling setlocale(LC_CTYPE, "").  The initial "C" locale, or
  2021.   whatever locale is explicitly set by the user, is preserved.  If you
  2022.   want repr() of 8-bit strings in your preferred encoding to preserve
  2023.   all printable characters of that encoding, you have to add the
  2024.   following code to your $PYTHONSTARTUP file or to your application's
  2025.   main():
  2026.  
  2027.     import locale
  2028.     locale.setlocale(locale.LC_CTYPE, "")
  2029.  
  2030. - shutil.move was added. shutil.copytree now reports errors as an
  2031.   exception at the end, instead of printing error messages.
  2032.  
  2033. - Encoding name normalization was generalized to not only
  2034.   replace hyphens with underscores, but also all other non-alphanumeric
  2035.   characters (with the exception of the dot which is used for Python
  2036.   package names during lookup). The aliases.py mapping was updated
  2037.   to the new standard.
  2038.  
  2039. - mimetypes has two new functions: guess_all_extensions() which
  2040.   returns a list of all known extensions for a mime type, and
  2041.   add_type() which adds one mapping between a mime type and
  2042.   an extension to the database.
  2043.  
  2044. - New module: sets, defines the class Set that implements a mutable
  2045.   set type using the keys of a dict to represent the set.  There's
  2046.   also a class ImmutableSet which is useful when you need sets of sets
  2047.   or when you need to use sets as dict keys, and a class BaseSet which
  2048.   is the base class of the two.
  2049.  
  2050. - Added random.sample(population,k) for random sampling without replacement.
  2051.   Returns a k length list of unique elements chosen from the population.
  2052.  
  2053. - random.randrange(-sys.maxint-1, sys.maxint) no longer raises
  2054.   OverflowError.  That is, it now accepts any combination of 'start'
  2055.   and 'stop' arguments so long as each is in the range of Python's
  2056.   bounded integers.
  2057.  
  2058. - Thanks to Raymond Hettinger, random.random() now uses a new core
  2059.   generator.  The Mersenne Twister algorithm is implemented in C,
  2060.   threadsafe, faster than the previous generator, has an astronomically
  2061.   large period (2**19937-1), creates random floats to full 53-bit
  2062.   precision, and may be the most widely tested random number generator
  2063.   in existence.
  2064.  
  2065.   The random.jumpahead(n) method has different semantics for the new
  2066.   generator.  Instead of jumping n steps ahead, it uses n and the
  2067.   existing state to create a new state.  This means that jumpahead()
  2068.   continues to support multi-threaded code needing generators of
  2069.   non-overlapping sequences.  However, it will break code which relies
  2070.   on jumpahead moving a specific number of steps forward.
  2071.  
  2072.   The attributes random.whseed and random.__whseed have no meaning for
  2073.   the new generator.  Code using these attributes should switch to a
  2074.   new class, random.WichmannHill which is provided for backward
  2075.   compatibility and to make an alternate generator available.
  2076.  
  2077. - New "algorithms" module: heapq, implements a heap queue.  Thanks to
  2078.   Kevin O'Connor for the code and Franτois Pinard for an entertaining
  2079.   write-up explaining the theory and practical uses of heaps.
  2080.  
  2081. - New encoding for the Palm OS character set: palmos.
  2082.  
  2083. - binascii.crc32() and the zipfile module had problems on some 64-bit
  2084.   platforms.  These have been fixed.  On a platform with 8-byte C longs,
  2085.   crc32() now returns a signed-extended 4-byte result, so that its value
  2086.   as a Python int is equal to the value computed a 32-bit platform.
  2087.  
  2088. - xml.dom.minidom.toxml and toprettyxml now take an optional encoding
  2089.   argument.
  2090.  
  2091. - Some fixes in the copy module: when an object is copied through its
  2092.   __reduce__ method, there was no check for a __setstate__ method on
  2093.   the result [SF patch 565085]; deepcopy should treat instances of
  2094.   custom metaclasses the same way it treats instances of type 'type'
  2095.   [SF patch 560794].
  2096.  
  2097. - Sockets now support timeout mode.  After s.settimeout(T), where T is
  2098.   a float expressing seconds, subsequent operations raise an exception
  2099.   if they cannot be completed within T seconds.  To disable timeout
  2100.   mode, use s.settimeout(None).  There's also a module function,
  2101.   socket.setdefaulttimeout(T), which sets the default for all sockets
  2102.   created henceforth.
  2103.  
  2104. - getopt.gnu_getopt was added.  This supports GNU-style option
  2105.   processing, where options can be mixed with non-option arguments.
  2106.  
  2107. - Stop using strings for exceptions.  String objects used for
  2108.   exceptions are now classes deriving from Exception.  The objects
  2109.   changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
  2110.   tabnanny.NannyNag, and xdrlib.Error.
  2111.  
  2112. - Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
  2113.   BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
  2114.   Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
  2115.   big endian systems were added to the codecs module. The old names
  2116.   BOM32_* and BOM64_* were off by a factor of 2.
  2117.  
  2118. - Added conversion functions math.degrees() and math.radians().
  2119.  
  2120. - math.log() now takes an optional argument:  math.log(x[, base]).
  2121.  
  2122. - ftplib.retrlines() now tests for callback is None rather than testing
  2123.   for False.  Was causing an error when given a callback object which
  2124.   was callable but also returned len() as zero.  The change may
  2125.   create new breakage if the caller relied on the undocumented behavior
  2126.   and called with callback set to [] or some other False value not
  2127.   identical to None.
  2128.  
  2129. - random.gauss() uses a piece of hidden state used by nothing else,
  2130.   and the .seed() and .whseed() methods failed to reset it.  In other
  2131.   words, setting the seed didn't completely determine the sequence of
  2132.   results produced by random.gauss().  It does now.  Programs repeatedly
  2133.   mixing calls to a seed method with calls to gauss() may see different
  2134.   results now.
  2135.  
  2136. - The pickle.Pickler class grew a clear_memo() method to mimic that
  2137.   provided by cPickle.Pickler.
  2138.  
  2139. - difflib's SequenceMatcher class now does a dynamic analysis of
  2140.   which elements are so frequent as to constitute noise.  For
  2141.   comparing files as sequences of lines, this generally works better
  2142.   than the IS_LINE_JUNK function, and function ndiff's linejunk
  2143.   argument defaults to None now as a result.  A happy benefit is
  2144.   that SequenceMatcher may run much faster now when applied
  2145.   to large files with many duplicate lines (for example, C program
  2146.   text with lots of repeated "}" and "return NULL;" lines).
  2147.  
  2148. - New Text.dump() method in Tkinter module.
  2149.  
  2150. - New distutils commands for building packagers were added to
  2151.   support pkgtool on Solaris and swinstall on HP-UX.
  2152.  
  2153. - distutils now has a new abstract binary packager base class
  2154.   command/bdist_packager, which simplifies writing packagers.
  2155.   This will hopefully provide the missing bits to encourage
  2156.   people to submit more packagers, e.g. for Debian, FreeBSD
  2157.   and other systems.
  2158.  
  2159. - The UTF-16, -LE and -BE stream readers now raise a
  2160.   NotImplementedError for all calls to .readline(). Previously, they
  2161.   used to just produce garbage or fail with an encoding error --
  2162.   UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
  2163.   work well with these.
  2164.  
  2165. - compileall now supports quiet operation.
  2166.  
  2167. - The BaseHTTPServer now implements optional HTTP/1.1 persistent
  2168.   connections.
  2169.  
  2170. - socket module: the SSL support was broken out of the main
  2171.   _socket module C helper and placed into a new _ssl helper
  2172.   which now gets imported by socket.py if available and working.
  2173.  
  2174. - encodings package: added aliases for all supported IANA character
  2175.   sets
  2176.  
  2177. - ftplib: to safeguard the user's privacy, anonymous login will use
  2178.   "anonymous@" as default password, rather than the real user and host
  2179.   name.
  2180.  
  2181. - webbrowser: tightened up the command passed to os.system() so that
  2182.   arbitrary shell code can't be executed because a bogus URL was
  2183.   passed in.
  2184.  
  2185. - gettext.translation has an optional fallback argument, and
  2186.   gettext.find an optional all argument. Translations will now fallback
  2187.   on a per-message basis. The module supports plural forms, by means
  2188.   of gettext.[d]ngettext and Translation.[u]ngettext.
  2189.  
  2190. - distutils bdist commands now offer a --skip-build option.
  2191.  
  2192. - warnings.warn now accepts a Warning instance as first argument.
  2193.  
  2194. - The xml.sax.expatreader.ExpatParser class will no longer create
  2195.   circular references by using itself as the locator that gets passed
  2196.   to the content handler implementation.  [SF bug #535474]
  2197.  
  2198. - The email.Parser.Parser class now properly parses strings regardless
  2199.   of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
  2200.   or CRLF).  Also, the Header class's constructor default arguments
  2201.   has changed slightly so that an explicit maxlinelen value is always
  2202.   honored, and so unicode conversion error handling can be specified.
  2203.  
  2204. - distutils' build_ext command now links C++ extensions with the C++
  2205.   compiler available in the Makefile or CXX environment variable, if
  2206.   running under \*nix.
  2207.  
  2208. - New module bz2: provides a comprehensive interface for the bz2 compression
  2209.   library.  It implements a complete file interface, one-shot (de)compression
  2210.   functions, and types for sequential (de)compression.
  2211.  
  2212. - New pdb command 'pp' which is like 'p' except that it pretty-prints
  2213.   the value of its expression argument.
  2214.  
  2215. - Now bdist_rpm distutils command understands a verify_script option in
  2216.   the config file, including the contents of the referred filename in
  2217.   the "%verifyscript" section of the rpm spec file.
  2218.  
  2219. - Fixed bug #495695: webbrowser module would run graphic browsers in a
  2220.   unix environment even if DISPLAY was not set. Also, support for
  2221.   skipstone browser was included.
  2222.  
  2223. - Fixed bug #636769: rexec would run unallowed code if subclasses of
  2224.   strings were used as parameters for certain functions.
  2225.  
  2226. Tools/Demos
  2227. -----------
  2228.  
  2229. - pygettext.py now supports globbing on Windows, and accepts module
  2230.   names in addition to accepting file names.
  2231.  
  2232. - The SGI demos (Demo/sgi) have been removed.  Nobody thought they
  2233.   were interesting any more.  (The SGI library modules and extensions
  2234.   are still there; it is believed that at least some of these are
  2235.   still used and useful.)
  2236.  
  2237. - IDLE supports the new encoding declarations (PEP 263); it can also
  2238.   deal with legacy 8-bit files if they use the locale's encoding. It
  2239.   allows non-ASCII strings in the interactive shell and executes them
  2240.   in the locale's encoding.
  2241.  
  2242. - freeze.py now produces binaries which can import shared modules,
  2243.   unlike before when this failed due to missing symbol exports in
  2244.   the generated binary.
  2245.  
  2246. Build
  2247. -----
  2248.  
  2249. - On Unix, IDLE is now installed automatically.
  2250.  
  2251. - The fpectl module is not built by default; it's dangerous or useless
  2252.   except in the hands of experts.
  2253.  
  2254. - The public Python C API will generally be declared using PyAPI_FUNC
  2255.   and PyAPI_DATA macros, while Python extension module init functions
  2256.   will be declared with PyMODINIT_FUNC.  DL_EXPORT/DL_IMPORT macros
  2257.   are deprecated.
  2258.  
  2259. - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
  2260.   get into infinite loops, when a new-style class got garbage-collected.
  2261.   Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
  2262.   that new-style classes be immortal in COUNT_ALLOCS builds.  Note that
  2263.   COUNT_ALLOCS is not enabled by default, in either release or debug
  2264.   builds, and that new-style classes are immortal only in COUNT_ALLOCS
  2265.   builds.
  2266.  
  2267. - Compiling out the cyclic garbage collector is no longer an option.
  2268.   The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
  2269.   that it's always defined (for the benefit of any extension modules
  2270.   that may be conditionalizing on it).  A bonus is that any extension
  2271.   type participating in cyclic gc can choose to participate in the
  2272.   Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
  2273.   to require editing the core to teach the trashcan mechanism about the
  2274.   new type.
  2275.  
  2276. - According to Annex F of the current C standard,
  2277.  
  2278.     The Standard C macro HUGE_VAL and its float and long double analogs,
  2279.     HUGE_VALF and HUGE_VALL, expand to expressions whose values are
  2280.     positive infinities.
  2281.  
  2282.   Python only uses the double HUGE_VAL, and only to #define its own symbol
  2283.   Py_HUGE_VAL.  Some platforms have incorrect definitions for HUGE_VAL.
  2284.   pyport.h used to try to worm around that, but the workarounds triggered
  2285.   other bugs on other platforms, so we gave up.  If your platform defines
  2286.   HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
  2287.   that works on your platform.  The only instance of this I'm sure about
  2288.   is on an unknown subset of Cray systems, described here:
  2289.  
  2290.   http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
  2291.  
  2292.   Presumably 2.3a1 breaks such systems.  If anyone uses such a system, help!
  2293.  
  2294. - The configure option --without-doc-strings can be used to remove the
  2295.   doc strings from the builtin functions and modules; this reduces the
  2296.   size of the executable.
  2297.  
  2298. - The universal newlines option (PEP 278) is on by default.  On Unix
  2299.   it can be disabled by passing --without-universal-newlines to the
  2300.   configure script.  On other platforms, remove
  2301.   WITH_UNIVERSAL_NEWLINES from pyconfig.h.
  2302.  
  2303. - On Unix, a shared libpython2.3.so can be created with --enable-shared.
  2304.  
  2305. - All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
  2306.   preprocessor symbols were eliminated.  The internal decisions they
  2307.   controlled stopped being experimental long ago.
  2308.  
  2309. - The tools used to build the documentation now work under Cygwin as
  2310.   well as Unix.
  2311.  
  2312. - The bsddb and dbm module builds have been changed to try and avoid version
  2313.   skew problems and disable linkage with Berkeley DB 1.85 unless the
  2314.   installer knows what s/he's doing.  See the section on building these
  2315.   modules in the README file for details.
  2316.  
  2317. C API
  2318. -----
  2319.  
  2320. - PyNumber_Check() now returns true for string and unicode objects.
  2321.   This is a result of these types having a partially defined
  2322.   tp_as_number slot.  (This is not a feature, but an indication that
  2323.   PyNumber_Check() is not very useful to determine numeric behavior.
  2324.   It may be deprecated.)
  2325.  
  2326. - The string object's layout has changed: the pointer member
  2327.   ob_sinterned has been replaced by an int member ob_sstate.  On some
  2328.   platforms (e.g. most 64-bit systems) this may change the offset of
  2329.   the ob_sval member, so as a precaution the API_VERSION has been
  2330.   incremented.  The apparently unused feature of "indirect interned
  2331.   strings", supported by the ob_sinterned member, is gone.  Interned
  2332.   strings are now usually mortal; there is a new API,
  2333.   PyString_InternImmortal() that creates immortal interned strings.
  2334.   (The ob_sstate member can only take three values; however, while
  2335.   making it a char saves a few bytes per string object on average, in
  2336.   it also slowed things down a bit because ob_sval was no longer
  2337.   aligned.)
  2338.  
  2339. - The Py_InitModule*() functions now accept NULL for the 'methods'
  2340.   argument.  Modules without global functions are becoming more common
  2341.   now that factories can be types rather than functions.
  2342.  
  2343. - New C API PyUnicode_FromOrdinal() which exposes unichr() at C
  2344.   level.
  2345.  
  2346. - New functions PyErr_SetExcFromWindowsErr() and
  2347.   PyErr_SetExcFromWindowsErrWithFilename(). Similar to
  2348.   PyErr_SetFromWindowsErrWithFilename() and
  2349.   PyErr_SetFromWindowsErr(), but they allow to specify
  2350.   the exception type to raise. Available on Windows.
  2351.  
  2352. - Py_FatalError() is now declared as taking a const char* argument.  It
  2353.   was previously declared without const.  This should not affect working
  2354.   code.
  2355.  
  2356. - Added new macro PySequence_ITEM(o, i) that directly calls
  2357.   sq_item without rechecking that o is a sequence and without
  2358.   adjusting for negative indices.
  2359.  
  2360. - PyRange_New() now raises ValueError if the fourth argument is not 1.
  2361.   This is part of the removal of deprecated features of the xrange
  2362.   object.
  2363.  
  2364. - PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
  2365.   coercion if both arguments have the same type but this type has the
  2366.   CHECKTYPES flag set.  This is to better support proxies.
  2367.  
  2368. - The type of tp_free has been changed from "``void (*)(PyObject *)``" to
  2369.   "``void (*)(void *)``".
  2370.  
  2371. - PyObject_Del, PyObject_GC_Del are now functions instead of macros.
  2372.  
  2373. - A type can now inherit its metatype from its base type.  Previously,
  2374.   when PyType_Ready() was called, if ob_type was found to be NULL, it
  2375.   was always set to &PyType_Type; now it is set to base->ob_type,
  2376.   where base is tp_base, defaulting to &PyObject_Type.
  2377.  
  2378. - PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
  2379.  
  2380. - The PyCore_* family of APIs have been removed.
  2381.  
  2382. - The "u#" parser marker will now pass through Unicode objects as-is
  2383.   without going through the buffer API.
  2384.  
  2385. - The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
  2386.  
  2387. - An old #define of ANY as void has been removed from pyport.h.  This
  2388.   hasn't been used since Python's pre-ANSI days, and the #define has
  2389.   been marked as obsolete since then.  SF bug 495548 says it created
  2390.   conflicts with other packages, so keeping it around wasn't harmless.
  2391.  
  2392. - Because Python's magic number scheme broke on January 1st, we decided
  2393.   to stop Python development.  Thanks for all the fish!
  2394.  
  2395. - Some of us don't like fish, so we changed Python's magic number
  2396.   scheme to a new one. See Python/import.c for details.
  2397.  
  2398. New platforms
  2399. -------------
  2400.  
  2401. - OpenVMS is now supported.
  2402.  
  2403. - AtheOS is now supported.
  2404.  
  2405. - the EMX runtime environment on OS/2 is now supported.
  2406.  
  2407. - GNU/Hurd is now supported.
  2408.  
  2409. Tests
  2410. -----
  2411.  
  2412. - The regrtest.py script's -u option now provides a way to say "allow
  2413.   all resources except this one."  For example, to allow everything
  2414.   except bsddb, give the option '-uall,-bsddb'.
  2415.  
  2416. Windows
  2417. -------
  2418.  
  2419. - The Windows distribution now ships with version 4.0.14 of the
  2420.   Sleepycat Berkeley database library.  This should be a huge
  2421.   improvement over the previous Berkeley DB 1.85, which had many
  2422.   bugs.
  2423.   XXX What are the licensing issues here?
  2424.   XXX If a user has a database created with a previous version of
  2425.   XXX     Python, what must they do to convert it?
  2426.   XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
  2427.   XXX The version # is likely to change before 2.3a1.
  2428.  
  2429. - The Windows distribution now ships with a Secure Sockets Library (SLL)
  2430.    module (_ssl.pyd)
  2431.  
  2432. - The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
  2433.   previously shipped with Tcl/Tk 8.3.2).
  2434.  
  2435. - When Python is built under a Microsoft compiler, sys.version now
  2436.   includes the compiler version number (_MSC_VER).  For example, under
  2437.   MSVC 6, sys.version contains the substring "MSC v.1200 ".  1200 is
  2438.   the value of _MSC_VER under MSVC 6.
  2439.  
  2440. - Sometimes the uninstall executable (UNWISE.EXE) vanishes.  One cause
  2441.   of that has been fixed in the installer (disabled Wise's "delete in-
  2442.   use files" uninstall option).
  2443.  
  2444. - Fixed a bug in urllib's proxy handling in Windows.  [SF bug #503031]
  2445.  
  2446. - The installer now installs Start menu shortcuts under (the local
  2447.   equivalent of) "All Users" when doing an Admin install.
  2448.  
  2449. - file.truncate([newsize]) now works on Windows for all newsize values.
  2450.   It used to fail if newsize didn't fit in 32 bits, reflecting a
  2451.   limitation of MS _chsize (which is no longer used).
  2452.  
  2453. - os.waitpid() is now implemented for Windows, and can be used to block
  2454.   until a specified process exits.  This is similar to, but not exactly
  2455.   the same as, os.waitpid() on POSIX systems.  If you're waiting for
  2456.   a specific process whose pid was obtained from one of the spawn()
  2457.   functions, the same Python os.waitpid() code works across platforms.
  2458.   See the docs for details.  The docs were changed to clarify that
  2459.   spawn functions return, and waitpid requires, a process handle on
  2460.   Windows (not the same thing as a Windows process id).
  2461.  
  2462. - New tempfile.TemporaryFile implementation for Windows:  this doesn't
  2463.   need a TemporaryFileWrapper wrapper anymore, and should be immune
  2464.   to a nasty problem:  before 2.3, if you got a temp file on Windows, it
  2465.   got wrapped in an object whose close() method first closed the
  2466.   underlying file, then deleted the file.  This usually worked fine.
  2467.   However, the spawn family of functions on Windows create (at a low C
  2468.   level) the same set of open files in the spawned process Q as were
  2469.   open in the spawning process P.  If a temp file f was among them, then
  2470.   doing f.close() in P first closed P's C-level file handle on f, but Q's
  2471.   C-level file handle on f remained open, so the attempt in P to delete f
  2472.   blew up with a "Permission denied" error (Windows doesn't allow
  2473.   deleting open files).  This was surprising, subtle, and difficult to
  2474.   work around.
  2475.  
  2476. - The os module now exports all the symbolic constants usable with the
  2477.   low-level os.open() on Windows:  the new constants in 2.3 are
  2478.   O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
  2479.   The others were also available in 2.2:  O_APPEND, O_BINARY, O_CREAT,
  2480.   O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY.  Contrary
  2481.   to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
  2482.   (so specify both if you want both; note that neither is useful unless
  2483.   specified with O_CREAT too).
  2484.  
  2485. Mac
  2486. ----
  2487.  
  2488. - Mac/Relnotes is gone, the release notes are now here.
  2489.  
  2490. - Python (the OSX-only, unix-based version, not the OS9-compatible CFM
  2491.   version) now fully supports unicode strings as arguments to various file
  2492.   system calls, eg. open(), file(), os.stat() and os.listdir().
  2493.  
  2494. - The current naming convention for Python on the Macintosh is that MacPython
  2495.   refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
  2496.   CFM-based version that runs on both OS9 and OSX.
  2497.  
  2498. - All MacPython-OS9 functionality is now available in an OSX unix build,
  2499.   including the Carbon modules, the IDE, OSA support, etc. A lot of this
  2500.   will only work correctly in a framework build, though, because you cannot
  2501.   talk to the window manager unless your application is run from a .app
  2502.   bundle. There is a command line tool "pythonw" that runs your script
  2503.   with an interpreter living in such a .app bundle, this interpreter should
  2504.   be used to run any Python script using the window manager (including
  2505.   Tkinter or wxPython scripts).
  2506.  
  2507. - Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
  2508.   MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
  2509.   are specifically for MacPython-OS9 (CFM support, preference resources, etc).
  2510.  
  2511. - A new utility PythonLauncher will start a Python interpreter when a .py or
  2512.   .pyw script is double-clicked in the Finder. By default .py scripts are
  2513.   run with a normal Python interpreter in a Terminal window and .pyw
  2514.   files are run with a window-aware pythonw interpreter without a Terminal
  2515.   window, but all this can be customized.
  2516.  
  2517. - MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
  2518.   possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
  2519.   releases.
  2520.  
  2521. - Many tools such as BuildApplet.py and gensuitemodule.py now support a command
  2522.   line interface too.
  2523.  
  2524. - All the Carbon classes are now PEP253 compliant, meaning that you can
  2525.   subclass them from Python. Most of the attributes have gone, you should
  2526.   now use the accessor function call API, which is also what Apple's
  2527.   documentation uses. Some attributes such as grafport.visRgn are still
  2528.   available for convenience.
  2529.  
  2530. - New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
  2531.   and Folder (APIs from Folders.h). The old macfs builtin module is
  2532.   gone, and replaced by a Python wrapper around the new modules.
  2533.  
  2534. - Pathname handling should now be fully consistent: MacPython-OSX always uses
  2535.   unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
  2536.   (also when running on Mac OS X).
  2537.  
  2538. - New Carbon modules Help and AH give access to the Carbon Help Manager.
  2539.   There are hooks in the IDE to allow accessing the Python documentation
  2540.   (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
  2541.   See Mac/OSX/README for converting the Python documentation to a
  2542.   Help Viewer compatible form and installing it.
  2543.  
  2544. - OSA support has been redesigned and the generated Python classes now
  2545.   mirror the inheritance defined by the underlying OSA classes.
  2546.  
  2547. - MacPython no longer maps both \r and \n to \n on input for any text file.
  2548.   This feature has been replaced by universal newline support (PEP278).
  2549.  
  2550. - The default encoding for Python sourcefiles in MacPython-OS9 is no longer
  2551.   mac-roman (or whatever your local Mac encoding was) but "ascii", like on
  2552.   other platforms. If you really need sourcefiles with Mac characters in them
  2553.   you can change this in site.py.
  2554.  
  2555. ----
  2556.  
  2557. **(For information about older versions, consult the HISTORY file.)**
  2558.