PageRenderTime 119ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/Misc/HISTORY

http://unladen-swallow.googlecode.com/
#! | 12737 lines | 9094 code | 3643 blank | 0 comment | 0 complexity | 9c1bc4d2e0906898e8397430f132aece MD5 | raw file
Possible License(s): 0BSD, BSD-3-Clause
  1. Python History
  2. --------------
  3. This file contains the release messages for previous Python releases.
  4. As you read on you go back to the dark ages of Python's history.
  5. (Note: news about 2.5c2 and later 2.5 releases is in the Misc/NEWS
  6. file of the release25-maint branch.)
  7. ======================================================================
  8. What's New in Python 2.5 release candidate 1?
  9. =============================================
  10. *Release date: 17-AUG-2006*
  11. Core and builtins
  12. -----------------
  13. - Unicode objects will no longer raise an exception when being
  14. compared equal or unequal to a string and a UnicodeDecodeError
  15. exception occurs, e.g. as result of a decoding failure.
  16. Instead, the equal (==) and unequal (!=) comparison operators will
  17. now issue a UnicodeWarning and interpret the two objects as
  18. unequal. The UnicodeWarning can be filtered as desired using
  19. the warning framework, e.g. silenced completely, turned into an
  20. exception, logged, etc.
  21. Note that compare operators other than equal and unequal will still
  22. raise UnicodeDecodeError exceptions as they've always done.
  23. - Fix segfault when doing string formatting on subclasses of long.
  24. - Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
  25. with new-style classes.
  26. - Fix bug related to __len__ functions returning negative values with
  27. classic classes.
  28. - Patch #1538606, Fix __index__() clipping. There were some problems
  29. discovered with the API and how integers that didn't fit into Py_ssize_t
  30. were handled. This patch attempts to provide enough alternatives
  31. to effectively use __index__.
  32. - Bug #1536021: __hash__ may now return long int; the final hash
  33. value is obtained by invoking hash on the long int.
  34. - Bug #1536786: buffer comparison could emit a RuntimeWarning.
  35. - Bug #1535165: fixed a segfault in input() and raw_input() when
  36. sys.stdin is closed.
  37. - On Windows, the PyErr_Warn function is now exported from
  38. the Python dll again.
  39. - Bug #1191458: tracing over for loops now produces a line event
  40. on each iteration. Fixing this problem required changing the .pyc
  41. magic number. This means that .pyc files generated before 2.5c1
  42. will be regenerated.
  43. - Bug #1333982: string/number constants were inappropriately stored
  44. in the byte code and co_consts even if they were not used, ie
  45. immediately popped off the stack.
  46. - Fixed a reference-counting problem in property().
  47. Library
  48. -------
  49. - Fix a bug in the ``compiler`` package that caused invalid code to be
  50. generated for generator expressions.
  51. - The distutils version has been changed to 2.5.0. The change to
  52. keep it programmatically in sync with the Python version running
  53. the code (introduced in 2.5b3) has been reverted. It will continue
  54. to be maintained manually as static string literal.
  55. - If the Python part of a ctypes callback function returns None,
  56. and this cannot be converted to the required C type, an exception is
  57. printed with PyErr_WriteUnraisable. Before this change, the C
  58. callback returned arbitrary values to the calling code.
  59. - The __repr__ method of a NULL ctypes.py_object() no longer raises
  60. an exception.
  61. - uuid.UUID now has a bytes_le attribute. This returns the UUID in
  62. little-endian byte order for Windows. In addition, uuid.py gained some
  63. workarounds for clocks with low resolution, to stop the code yielding
  64. duplicate UUIDs.
  65. - Patch #1540892: site.py Quitter() class attempts to close sys.stdin
  66. before raising SystemExit, allowing IDLE to honor quit() and exit().
  67. - Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize.
  68. - Patch #1536071: trace.py should now find the full module name of a
  69. file correctly even on Windows.
  70. - logging's atexit hook now runs even if the rest of the module has
  71. already been cleaned up.
  72. - Bug #1112549, fix DoS attack on cgi.FieldStorage.
  73. - Bug #1531405, format_exception no longer raises an exception if
  74. str(exception) raised an exception.
  75. - Fix a bug in the ``compiler`` package that caused invalid code to be
  76. generated for nested functions.
  77. Extension Modules
  78. -----------------
  79. - Patch #1511317: don't crash on invalid hostname (alias) info.
  80. - Patch #1535500: fix segfault in BZ2File.writelines and make sure it
  81. raises the correct exceptions.
  82. - Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The
  83. '-no-stack-protector' compiler flag for OpenBSD has been removed.
  84. - Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
  85. uses the _as_parameter_ attribute when objects are passed to foreign
  86. function calls. The ctypes version number was changed to 1.0.1.
  87. - Bug #1530559, struct.pack raises TypeError where it used to convert.
  88. Passing float arguments to struct.pack when integers are expected
  89. now triggers a DeprecationWarning.
  90. Tests
  91. -----
  92. - test_socketserver should now work on cygwin and not fail sporadically
  93. on other platforms.
  94. - test_mailbox should now work on cygwin versions 2006-08-10 and later.
  95. - Bug #1535182: really test the xreadlines() method of bz2 objects.
  96. - test_threading now skips testing alternate thread stack sizes on
  97. platforms that don't support changing thread stack size.
  98. Documentation
  99. -------------
  100. - Patch #1534922: unittest docs were corrected and enhanced.
  101. Build
  102. -----
  103. - Bug #1535502, build _hashlib on Windows, and use masm assembler
  104. code in OpenSSL.
  105. - Bug #1534738, win32 debug version of _msi should be _msi_d.pyd.
  106. - Bug #1530448, ctypes build failure on Solaris 10 was fixed.
  107. C API
  108. -----
  109. - New API for Unicode rich comparisons: PyUnicode_RichCompare()
  110. - Bug #1069160. Internal correctness changes were made to
  111. ``PyThreadState_SetAsyncExc()``. A test case was added, and
  112. the documentation was changed to state that the return value
  113. is always 1 (normal) or 0 (if the specified thread wasn't found).
  114. What's New in Python 2.5 beta 3?
  115. ================================
  116. *Release date: 03-AUG-2006*
  117. Core and builtins
  118. -----------------
  119. - _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously
  120. returned a long (see PEP 353).
  121. - Bug #1515471: string.replace() accepts character buffers again.
  122. - Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().
  123. This provides the proper warning for struct.pack().
  124. PyErr_Warn() is now deprecated in favor of PyErr_WarnEx().
  125. - Patch #1531113: Fix augmented assignment with yield expressions.
  126. Also fix a SystemError when trying to assign to yield expressions.
  127. - Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
  128. with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
  129. used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
  130. excessive filesystem operations during imports.
  131. - Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some
  132. operations on signed longs that are formally undefined by C.
  133. Unfortunately, at least one compiler now cares about that, so complicated
  134. the code to make that compiler happy again.
  135. - Bug #1524310: Properly report errors from FindNextFile in os.listdir.
  136. - Patch #1232023: Stop including current directory in search
  137. path on Windows.
  138. - Fix some potential crashes found with failmalloc.
  139. - Fix warnings reported by Klocwork's static analysis tool.
  140. - Bug #1512814, Fix incorrect lineno's when code within a function
  141. had more than 255 blank lines.
  142. - Patch #1521179: Python now accepts the standard options ``--help`` and
  143. ``--version`` as well as ``/?`` on Windows.
  144. - Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
  145. again. Fixing this problem required changing the .pyc magic number.
  146. This means that .pyc files generated before 2.5b3 will be regenerated.
  147. - Bug #1524317: Compiling Python ``--without-threads`` failed.
  148. The Python core compiles again, and, in a build without threads, the
  149. new ``sys._current_frames()`` returns a dictionary with one entry,
  150. mapping the faux "thread id" 0 to the current frame.
  151. - Bug #1525447: build on MacOS X on a case-sensitive filesystem.
  152. Library
  153. -------
  154. - Fix #1693149. Now you can pass several modules separated by
  155. comma to trace.py in the same --ignore-module option.
  156. - Correction of patch #1455898: In the mbcs decoder, set final=False
  157. for stream decoder, but final=True for the decode function.
  158. - os.urandom no longer masks unrelated exceptions like SystemExit or
  159. KeyboardInterrupt.
  160. - Bug #1525866: Don't copy directory stat times in
  161. shutil.copytree on Windows
  162. - Bug #1002398: The documentation for os.path.sameopenfile now correctly
  163. refers to file descriptors, not file objects.
  164. - The renaming of the xml package to xmlcore, and the import hackery done
  165. to make it appear at both names, has been removed. Bug #1511497,
  166. #1513611, and probably others.
  167. - Bug #1441397: The compiler module now recognizes module and function
  168. docstrings correctly as it did in Python 2.4.
  169. - Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally
  170. lost that tests are sorted by name before being run. This rarely
  171. matters for well-written tests, but can create baffling symptoms if
  172. side effects from one test to the next affect outcomes. ``DocTestFinder``
  173. has been changed to sort the list of tests it returns.
  174. - The distutils version has been changed to 2.5.0, and is now kept
  175. in sync with sys.version_info[:3].
  176. - Bug #978833: Really close underlying socket in _socketobject.close.
  177. - Bug #1459963: urllib and urllib2 now normalize HTTP header names with
  178. title().
  179. - Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback
  180. to recursive calls and call it with the failing package name.
  181. - Bug #1525817: Don't truncate short lines in IDLE's tool tips.
  182. - Patch #1515343: Fix printing of deprecated string exceptions with a
  183. value in the traceback module.
  184. - Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
  185. - Patch #1524429: Use repr() instead of backticks in Tkinter again.
  186. - Bug #1520914: Change time.strftime() to accept a zero for any position in its
  187. argument tuple. For arguments where zero is illegal, the value is forced to
  188. the minimum value that is correct. This is to support an undocumented but
  189. common way people used to fill in inconsequential information in the time
  190. tuple pre-2.4.
  191. - Patch #1220874: Update the binhex module for Mach-O.
  192. - The email package has improved RFC 2231 support, specifically for
  193. recognizing the difference between encoded (name*0*=<blah>) and non-encoded
  194. (name*0=<blah>) parameter continuations. This may change the types of
  195. values returned from email.message.Message.get_param() and friends.
  196. Specifically in some cases where non-encoded continuations were used,
  197. get_param() used to return a 3-tuple of (None, None, string) whereas now it
  198. will just return the string (since non-encoded continuations don't have
  199. charset and language parts).
  200. Also, whereas % values were decoded in all parameter continuations, they are
  201. now only decoded in encoded parameter parts.
  202. - Bug #1517990: IDLE keybindings on MacOS X now work correctly
  203. - Bug #1517996: IDLE now longer shows the default Tk menu when a
  204. path browser, class browser or debugger is the frontmost window on MacOS X
  205. - Patch #1520294: Support for getset and member descriptors in types.py,
  206. inspect.py, and pydoc.py. Specifically, this allows for querying the type
  207. of an object against these built-in types and more importantly, for getting
  208. their docstrings printed in the interactive interpreter's help() function.
  209. Extension Modules
  210. -----------------
  211. - Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during
  212. a socket operation on a socket with a timeout, the exception will be
  213. caught correctly. Previously, the exception was not caught.
  214. - Patch #1529514: The _ctypes extension is now compiled on more
  215. openbsd target platforms.
  216. - The ``__reduce__()`` method of the new ``collections.defaultdict`` had
  217. a memory leak, affecting pickles and deep copies.
  218. - Bug #1471938: Fix curses module build problem on Solaris 8; patch by
  219. Paul Eggert.
  220. - Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
  221. - Patch #1521817: Index range checking on ctypes arrays containing
  222. exactly one element enabled again. This allows iterating over these
  223. arrays, without the need to check the array size before.
  224. - Bug #1521375: When the code in ctypes.util.find_library was
  225. run with root privileges, it could overwrite or delete
  226. /dev/null in certain cases; this is now fixed.
  227. - Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
  228. default mode for loading shared libraries in ctypes.
  229. - Because of a misspelled preprocessor symbol, ctypes was always
  230. compiled without thread support; this is now fixed.
  231. - pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename
  232. methods now allow their database parameter to be None as the
  233. sleepycat API allows.
  234. - Bug #1526460: Fix socketmodule compile on NetBSD as it has a different
  235. bluetooth API compared with Linux and FreeBSD.
  236. Tests
  237. -----
  238. - Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of
  239. how long the test file should take to play. Now accepts taking 2.93 secs
  240. (exact time) +/- 10% instead of the hard-coded 3.1 sec.
  241. - Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``,
  242. ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when
  243. run via ``regrtest.py``. Now they do.
  244. Build
  245. -----
  246. - Bug #1439538: Drop usage of test -e in configure as it is not portable.
  247. Mac
  248. ---
  249. - PythonLauncher now works correctly when the path to the script contains
  250. characters that are treated specially by the shell (such as quotes).
  251. - Bug #1527397: PythonLauncher now launches scripts with the working directory
  252. set to the directory that contains the script instead of the user home
  253. directory. That latter was an implementation accident and not what users
  254. expect.
  255. What's New in Python 2.5 beta 2?
  256. ================================
  257. *Release date: 11-JUL-2006*
  258. Core and builtins
  259. -----------------
  260. - Bug #1441486: The literal representation of -(sys.maxint - 1)
  261. again evaluates to a int object, not a long.
  262. - Bug #1501934: The scope of global variables that are locally assigned
  263. using augmented assignment is now correctly determined.
  264. - Bug #927248: Recursive method-wrapper objects can now safely
  265. be released.
  266. - Bug #1417699: Reject locale-specific decimal point in float()
  267. and atof().
  268. - Bug #1511381: codec_getstreamcodec() in codec.c is corrected to
  269. omit a default "error" argument for NULL pointer. This allows
  270. the parser to take a codec from cjkcodecs again.
  271. - Bug #1519018: 'as' is now validated properly in import statements.
  272. - On 64 bit systems, int literals that use less than 64 bits are
  273. now ints rather than longs.
  274. - Bug #1512814, Fix incorrect lineno's when code at module scope
  275. started after line 256.
  276. - New function ``sys._current_frames()`` returns a dict mapping thread
  277. id to topmost thread stack frame. This is for expert use, and is
  278. especially useful for debugging application deadlocks. The functionality
  279. was previously available in Fazal Majid's ``threadframe`` extension
  280. module, but it wasn't possible to do this in a wholly threadsafe way from
  281. an extension.
  282. Library
  283. -------
  284. - Bug #1257728: Mention Cygwin in distutils error message about a missing
  285. VS 2003.
  286. - Patch #1519566: Update turtle demo, make begin_fill idempotent.
  287. - Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK
  288. environment variable to be set in order to the SDK environment
  289. for finding the compiler, include files, etc.
  290. - Bug #1515998: Properly generate logical ids for files in bdist_msi.
  291. - warnings.py now ignores ImportWarning by default
  292. - string.Template() now correctly handles tuple-values. Previously,
  293. multi-value tuples would raise an exception and single-value tuples would
  294. be treated as the value they contain, instead.
  295. - Bug #822974: Honor timeout in telnetlib.{expect,read_until}
  296. even if some data are received.
  297. - Bug #1267547: Put proper recursive setup.py call into the
  298. spec file generated by bdist_rpm.
  299. - Bug #1514693: Update turtle's heading when switching between
  300. degrees and radians.
  301. - Reimplement turtle.circle using a polyline, to allow correct
  302. filling of arcs.
  303. - Bug #1514703: Only setup canvas window in turtle when the canvas
  304. is created.
  305. - Bug #1513223: .close() of a _socketobj now releases the underlying
  306. socket again, which then gets closed as it becomes unreferenced.
  307. - Bug #1504333: Make sgmllib support angle brackets in quoted
  308. attribute values.
  309. - Bug #853506: Fix IPv6 address parsing in unquoted attributes in
  310. sgmllib ('[' and ']' were not accepted).
  311. - Fix a bug in the turtle module's end_fill function.
  312. - Bug #1510580: The 'warnings' module improperly required that a Warning
  313. category be either a types.ClassType and a subclass of Warning. The proper
  314. check is just that it is a subclass with Warning as the documentation states.
  315. - The compiler module now correctly compiles the new try-except-finally
  316. statement (bug #1509132).
  317. - The wsgiref package is now installed properly on Unix.
  318. - A bug was fixed in logging.config.fileConfig() which caused a crash on
  319. shutdown when fileConfig() was called multiple times.
  320. - The sqlite3 module did cut off data from the SQLite database at the first
  321. null character before sending it to a custom converter. This has been fixed
  322. now.
  323. Extension Modules
  324. -----------------
  325. - #1494314: Fix a regression with high-numbered sockets in 2.4.3. This
  326. means that select() on sockets > FD_SETSIZE (typically 1024) work again.
  327. The patch makes sockets use poll() internally where available.
  328. - Assigning None to pointer type fields in ctypes structures possible
  329. overwrote the wrong fields, this is fixed now.
  330. - Fixed a segfault in _ctypes when ctypes.wintypes were imported
  331. on non-Windows platforms.
  332. - Bug #1518190: The ctypes.c_void_p constructor now accepts any
  333. integer or long, without range checking.
  334. - Patch #1517790: It is now possible to use custom objects in the ctypes
  335. foreign function argtypes sequence as long as they provide a from_param
  336. method, no longer is it required that the object is a ctypes type.
  337. - The '_ctypes' extension module now works when Python is configured
  338. with the --without-threads option.
  339. - Bug #1513646: os.access on Windows now correctly determines write
  340. access, again.
  341. - Bug #1512695: cPickle.loads could crash if it was interrupted with
  342. a KeyboardInterrupt.
  343. - Bug #1296433: parsing XML with a non-default encoding and
  344. a CharacterDataHandler could crash the interpreter in pyexpat.
  345. - Patch #1516912: improve Modules support for OpenVMS.
  346. Build
  347. -----
  348. - Automate Windows build process for the Win64 SSL module.
  349. - 'configure' now detects the zlib library the same way as distutils.
  350. Previously, the slight difference could cause compilation errors of the
  351. 'zlib' module on systems with more than one version of zlib.
  352. - The MSI compileall step was fixed to also support a TARGETDIR
  353. with spaces in it.
  354. - Bug #1517388: sqlite3.dll is now installed on Windows independent
  355. of Tcl/Tk.
  356. - Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old
  357. trying to be installed even though it's empty.
  358. Tests
  359. -----
  360. - Call os.waitpid() at the end of tests that spawn child processes in order
  361. to minimize resources (zombies).
  362. Documentation
  363. -------------
  364. - Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the
  365. documentation for the warnings module.
  366. - Patch #1509163: MS Toolkit Compiler no longer available.
  367. - Patch #1504046: Add documentation for xml.etree.
  368. What's New in Python 2.5 beta 1?
  369. ================================
  370. *Release date: 20-JUN-2006*
  371. Core and builtins
  372. -----------------
  373. - Patch #1507676: Error messages returned by invalid abstract object operations
  374. (such as iterating over an integer) have been improved and now include the
  375. type of the offending object to help with debugging.
  376. - Bug #992017: A classic class that defined a __coerce__() method that returned
  377. its arguments swapped would infinitely recurse and segfault the interpreter.
  378. - Fix the socket tests so they can be run concurrently.
  379. - Removed 5 integers from C frame objects (PyFrameObject).
  380. f_nlocals, f_ncells, f_nfreevars, f_stack_size, f_restricted.
  381. - Bug #532646: object.__call__() will continue looking for the __call__
  382. attribute on objects until one without one is found. This leads to recursion
  383. when you take a class and set its __call__ attribute to an instance of the
  384. class. Originally fixed for classic classes, but this fix is for new-style.
  385. Removes the infinite_rec_3 crasher.
  386. - The string and unicode methods startswith() and endswith() now accept
  387. a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
  388. - Buffer objects, at the C level, never used the char buffer
  389. implementation even when the char buffer for the wrapped object was
  390. explicitly requested (originally returned the read or write buffer).
  391. Now a TypeError is raised if the char buffer is not present but is
  392. requested.
  393. - Patch #1346214: Statements like "if 0: suite" are now again optimized
  394. away like they were in Python 2.4.
  395. - Builtin exceptions are now full-blown new-style classes instead of
  396. instances pretending to be classes, which speeds up exception handling
  397. by about 80% in comparison to 2.5a2.
  398. - Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
  399. Unicode 4.1.
  400. - Patch #921466: sys.path_importer_cache is now used to cache valid and
  401. invalid file paths for the built-in import machinery which leads to
  402. fewer open calls on startup.
  403. - Patch #1442927: ``long(str, base)`` is now up to 6x faster for non-power-
  404. of-2 bases. The largest speedup is for inputs with about 1000 decimal
  405. digits. Conversion from non-power-of-2 bases remains quadratic-time in
  406. the number of input digits (it was and remains linear-time for bases
  407. 2, 4, 8, 16 and 32).
  408. - Bug #1334662: ``int(string, base)`` could deliver a wrong answer
  409. when ``base`` was not 2, 4, 8, 10, 16 or 32, and ``string`` represented
  410. an integer close to ``sys.maxint``. This was repaired by patch
  411. #1335972, which also gives a nice speedup.
  412. - Patch #1337051: reduced size of frame objects.
  413. - PyErr_NewException now accepts a tuple of base classes as its
  414. "base" parameter.
  415. - Patch #876206: function call speedup by retaining allocated frame
  416. objects.
  417. - Bug #1462152: file() now checks more thoroughly for invalid mode
  418. strings and removes a possible "U" before passing the mode to the
  419. C library function.
  420. - Patch #1488312, Fix memory alignment problem on SPARC in unicode
  421. - Bug #1487966: Fix SystemError with conditional expression in assignment
  422. - WindowsError now has two error code attributes: errno, which carries
  423. the error values from errno.h, and winerror, which carries the error
  424. values from winerror.h. Previous versions put the winerror.h values
  425. (from GetLastError()) into the errno attribute.
  426. - Patch #1475845: Raise IndentationError for unexpected indent.
  427. - Patch #1479181: split open() and file() from being aliases for each other.
  428. - Patch #1497053 & bug #1275608: Exceptions occurring in ``__eq__()``
  429. methods were always silently ignored by dictionaries when comparing keys.
  430. They are now passed through (except when using the C API function
  431. ``PyDict_GetItem()``, whose semantics did not change).
  432. - Bug #1456209: In some obscure cases it was possible for a class with a
  433. custom ``__eq__()`` method to confuse dict internals when class instances
  434. were used as a dict's keys and the ``__eq__()`` method mutated the dict.
  435. No, you don't have any code that did this ;-)
  436. Extension Modules
  437. -----------------
  438. - Bug #1295808: expat symbols should be namespaced in pyexpat
  439. - Patch #1462338: Upgrade pyexpat to expat 2.0.0
  440. - Change binascii.hexlify to accept a read-only buffer instead of only a char
  441. buffer and actually follow its documentation.
  442. - Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
  443. - Patch #1478788 (modified version): The functional extension module has
  444. been renamed to _functools and a functools Python wrapper module added.
  445. This provides a home for additional function related utilities that are
  446. not specifically about functional programming. See PEP 309.
  447. - Patch #1493701: performance enhancements for struct module.
  448. - Patch #1490224: time.altzone is now set correctly on Cygwin.
  449. - Patch #1435422: zlib's compress and decompress objects now have a
  450. copy() method.
  451. - Patch #1454481: thread stack size is now tunable at runtime for thread
  452. enabled builds on Windows and systems with Posix threads support.
  453. - On Win32, os.listdir now supports arbitrarily-long Unicode path names
  454. (up to the system limit of 32K characters).
  455. - Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
  456. As a result, these functions now raise WindowsError instead of OSError.
  457. - ``time.clock()`` on Win64 should use the high-performance Windows
  458. ``QueryPerformanceCounter()`` now (as was already the case on 32-bit
  459. Windows platforms).
  460. - Calling Tk_Init twice is refused if the first call failed as that
  461. may deadlock.
  462. - bsddb: added the DB_ARCH_REMOVE flag and fixed db.DBEnv.log_archive() to
  463. accept it without potentially using an uninitialized pointer.
  464. - bsddb: added support for the DBEnv.log_stat() and DBEnv.lsn_reset() methods
  465. assuming BerkeleyDB >= 4.0 and 4.4 respectively. [pybsddb project SF
  466. patch numbers 1494885 and 1494902]
  467. - bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
  468. [pybsddb project SF patch number 1466734]
  469. - bsddb: fix DBCursor.pget() bug with keyword argument names when no data
  470. parameter is supplied. [SF pybsddb bug #1477863]
  471. - bsddb: the __len__ method of a DB object has been fixed to return correct
  472. results. It could previously incorrectly return 0 in some cases.
  473. Fixes SF bug 1493322 (pybsddb bug 1184012).
  474. - bsddb: the bsddb.dbtables Modify method now raises the proper error and
  475. aborts the db transaction safely when a modifier callback fails.
  476. Fixes SF python patch/bug #1408584.
  477. - bsddb: multithreaded DB access using the simple bsddb module interface
  478. now works reliably. It has been updated to use automatic BerkeleyDB
  479. deadlock detection and the bsddb.dbutils.DeadlockWrap wrapper to retry
  480. database calls that would previously deadlock. [SF python bug #775414]
  481. - Patch #1446489: add support for the ZIP64 extensions to zipfile.
  482. - Patch #1506645: add Python wrappers for the curses functions
  483. is_term_resized, resize_term and resizeterm.
  484. Library
  485. -------
  486. - Patch #815924: Restore ability to pass type= and icon= in tkMessageBox
  487. functions.
  488. - Patch #812986: Update turtle output even if not tracing.
  489. - Patch #1494750: Destroy master after deleting children in
  490. Tkinter.BaseWidget.
  491. - Patch #1096231: Add ``default`` argument to Tkinter.Wm.wm_iconbitmap.
  492. - Patch #763580: Add name and value arguments to Tkinter variable
  493. classes.
  494. - Bug #1117556: SimpleHTTPServer now tries to find and use the system's
  495. mime.types file for determining MIME types.
  496. - Bug #1339007: Shelf objects now don't raise an exception in their
  497. __del__ method when initialization failed.
  498. - Patch #1455898: The MBCS codec now supports the incremental mode for
  499. double-byte encodings.
  500. - ``difflib``'s ``SequenceMatcher.get_matching_blocks()`` was changed to
  501. guarantee that adjacent triples in the return list always describe
  502. non-adjacent blocks. Previously, a pair of matching blocks could end
  503. up being described by multiple adjacent triples that formed a partition
  504. of the matching pair.
  505. - Bug #1498146: fix optparse to handle Unicode strings in option help,
  506. description, and epilog.
  507. - Bug #1366250: minor optparse documentation error.
  508. - Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately;
  509. clarify docs.
  510. - The wsgiref package has been added to the standard library.
  511. - The functions update_wrapper() and wraps() have been added to the functools
  512. module. These make it easier to copy relevant metadata from the original
  513. function when writing wrapper functions.
  514. - The optional ``isprivate`` argument to ``doctest.testmod()``, and the
  515. ``doctest.is_private()`` function, both deprecated in 2.4, were removed.
  516. - Patch #1359618: Speed up charmap encoder by using a trie structure
  517. for lookup.
  518. - The functions in the ``pprint`` module now sort dictionaries by key
  519. before computing the display. Before 2.5, ``pprint`` sorted a dictionary
  520. if and only if its display required more than one line, although that
  521. wasn't documented. The new behavior increases predictability; e.g.,
  522. using ``pprint.pprint(a_dict)`` in a doctest is now reliable.
  523. - Patch #1497027: try HTTP digest auth before basic auth in urllib2
  524. (thanks for J. J. Lee).
  525. - Patch #1496206: improve urllib2 handling of passwords with respect to
  526. default HTTP and HTTPS ports.
  527. - Patch #1080727: add "encoding" parameter to doctest.DocFileSuite.
  528. - Patch #1281707: speed up gzip.readline.
  529. - Patch #1180296: Two new functions were added to the locale module:
  530. format_string() to get the effect of "format % items" but locale-aware,
  531. and currency() to format a monetary number with currency sign.
  532. - Patch #1486962: Several bugs in the turtle Tk demo module were fixed
  533. and several features added, such as speed and geometry control.
  534. - Patch #1488881: add support for external file objects in bz2 compressed
  535. tarfiles.
  536. - Patch #721464: pdb.Pdb instances can now be given explicit stdin and
  537. stdout arguments, making it possible to redirect input and output
  538. for remote debugging.
  539. - Patch #1484695: Update the tarfile module to version 0.8. This fixes
  540. a couple of issues, notably handling of long file names using the
  541. GNU LONGNAME extension.
  542. - Patch #1478292. ``doctest.register_optionflag(name)`` shouldn't create a
  543. new flag when ``name`` is already the name of an option flag.
  544. - Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
  545. package.
  546. - Patch #1472854: make the rlcompleter.Completer class usable on non-
  547. UNIX platforms.
  548. - Patch #1470846: fix urllib2 ProxyBasicAuthHandler.
  549. - Bug #1472827: correctly escape newlines and tabs in attribute values in
  550. the saxutils.XMLGenerator class.
  551. Build
  552. -----
  553. - Bug #1502728: Correctly link against librt library on HP-UX.
  554. - OpenBSD 3.9 is supported now.
  555. - Patch #1492356: Port to Windows CE.
  556. - Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
  557. - Patch #1471883: Add --enable-universalsdk.
  558. C API
  559. -----
  560. Tests
  561. -----
  562. Tools
  563. -----
  564. Documentation
  565. -------------
  566. What's New in Python 2.5 alpha 2?
  567. =================================
  568. *Release date: 27-APR-2006*
  569. Core and builtins
  570. -----------------
  571. - Bug #1465834: 'bdist_wininst preinstall script support' was fixed
  572. by converting these apis from macros into exported functions again:
  573. PyParser_SimpleParseFile PyParser_SimpleParseString PyRun_AnyFile
  574. PyRun_AnyFileEx PyRun_AnyFileFlags PyRun_File PyRun_FileEx
  575. PyRun_FileFlags PyRun_InteractiveLoop PyRun_InteractiveOne
  576. PyRun_SimpleFile PyRun_SimpleFileEx PyRun_SimpleString
  577. PyRun_String Py_CompileString
  578. - Under COUNT_ALLOCS, types are not necessarily immortal anymore.
  579. - All uses of PyStructSequence_InitType have been changed to initialize
  580. the type objects only once, even if the interpreter is initialized
  581. multiple times.
  582. - Bug #1454485, array.array('u') could crash the interpreter. This was
  583. due to PyArgs_ParseTuple(args, 'u#', ...) trying to convert buffers (strings)
  584. to unicode when it didn't make sense. 'u#' now requires a unicode string.
  585. - Py_UNICODE is unsigned. It was always documented as unsigned, but
  586. due to a bug had a signed value in previous versions.
  587. - Patch #837242: ``id()`` of any Python object always gives a positive
  588. number now, which might be a long integer. ``PyLong_FromVoidPtr`` and
  589. ``PyLong_AsVoidPtr`` have been changed accordingly. Note that it has
  590. never been correct to implement a ``__hash()__`` method that returns the
  591. ``id()`` of an object:
  592. def __hash__(self):
  593. return id(self) # WRONG
  594. because a hash result must be a (short) Python int but it was always
  595. possible for ``id()`` to return a Python long. However, because ``id()``
  596. could return negative values before, on a 32-bit box an ``id()`` result
  597. was always usable as a hash value before this patch. That's no longer
  598. necessarily so.
  599. - Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
  600. to load extension modules and now provides the dl module. As a result,
  601. sys.setdlopenflags() now works correctly on these systems. (SF patch
  602. #1454844)
  603. - Patch #1463867: enhanced garbage collection to allow cleanup of cycles
  604. involving generators that have paused outside of any ``try`` or ``with``
  605. blocks. (In 2.5a1, a paused generator that was part of a reference
  606. cycle could not be garbage collected, regardless of whether it was
  607. paused in a ``try`` or ``with`` block.)
  608. Extension Modules
  609. -----------------
  610. - Patch #1191065: Fix preprocessor problems on systems where recvfrom
  611. is a macro.
  612. - Bug #1467952: os.listdir() now correctly raises an error if readdir()
  613. fails with an error condition.
  614. - Fixed bsddb.db.DBError derived exceptions so they can be unpickled.
  615. - Bug #1117761: bsddb.*open() no longer raises an exception when using
  616. the cachesize parameter.
  617. - Bug #1149413: bsddb.*open() no longer raises an exception when using
  618. a temporary db (file=None) with the 'n' flag to truncate on open.
  619. - Bug #1332852: bsddb module minimum BerkeleyDB version raised to 3.3
  620. as older versions cause excessive test failures.
  621. - Patch #1062014: AF_UNIX sockets under Linux have a special
  622. abstract namespace that is now fully supported.
  623. Library
  624. -------
  625. - Bug #1223937: subprocess.CalledProcessError reports the exit status
  626. of the process using the returncode attribute, instead of
  627. abusing errno.
  628. - Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes
  629. a doctest to be skipped (the code is not run, and the expected output
  630. or exception is ignored).
  631. - Fixed contextlib.nested to cope with exceptions being raised and
  632. caught inside exit handlers.
  633. - Updated optparse module to Optik 1.5.1 (allow numeric constants in
  634. hex, octal, or binary; add ``append_const`` action; keep going if
  635. gettext cannot be imported; added ``OptionParser.destroy()`` method;
  636. added ``epilog`` for better help generation).
  637. - Bug #1473760: ``tempfile.TemporaryFile()`` could hang on Windows, when
  638. called from a thread spawned as a side effect of importing a module.
  639. - The pydoc module now supports documenting packages contained in
  640. .zip or .egg files.
  641. - The pkgutil module now has several new utility functions, such
  642. as ``walk_packages()`` to support working with packages that are either
  643. in the filesystem or zip files.
  644. - The mailbox module can now modify and delete messages from
  645. mailboxes, in addition to simply reading them. Thanks to Gregory
  646. K. Johnson for writing the code, and to the 2005 Google Summer of
  647. Code for funding his work.
  648. - The ``__del__`` method of class ``local`` in module ``_threading_local``
  649. returned before accomplishing any of its intended cleanup.
  650. - Patch #790710: Add breakpoint command lists in pdb.
  651. - Patch #1063914: Add Tkinter.Misc.clipboard_get().
  652. - Patch #1191700: Adjust column alignment in bdb breakpoint lists.
  653. - SimpleXMLRPCServer relied on the fcntl module, which is unavailable on
  654. Windows. Bug #1469163.
  655. - The warnings, linecache, inspect, traceback, site, and doctest modules
  656. were updated to work correctly with modules imported from zipfiles or
  657. via other PEP 302 __loader__ objects.
  658. - Patch #1467770: Reduce usage of subprocess._active to processes which
  659. the application hasn't waited on.
  660. - Patch #1462222: Fix Tix.Grid.
  661. - Fix exception when doing glob.glob('anything*/')
  662. - The pstats.Stats class accepts an optional stream keyword argument to
  663. direct output to an alternate file-like object.
  664. Build
  665. -----
  666. - The Makefile now has a reindent target, which runs reindent.py on
  667. the library.
  668. - Patch #1470875: Building Python with MS Free Compiler
  669. - Patch #1161914: Add a python-config script.
  670. - Patch #1324762:Remove ccpython.cc; replace --with-cxx with
  671. --with-cxx-main. Link with C++ compiler only if --with-cxx-main was
  672. specified. (Can be overridden by explicitly setting LINKCC.) Decouple
  673. CXX from --with-cxx-main, see description in README.
  674. - Patch #1429775: Link extension modules with the shared libpython.
  675. - Fixed a libffi build problem on MIPS systems.
  676. - ``PyString_FromFormat``, ``PyErr_Format``, and ``PyString_FromFormatV``
  677. now accept formats "%u" for unsigned ints, "%lu" for unsigned longs,
  678. and "%zu" for unsigned integers of type ``size_t``.
  679. Tests
  680. -----
  681. - test_contextlib now checks contextlib.nested can cope with exceptions
  682. being raised and caught inside exit handlers.
  683. - test_cmd_line now checks operation of the -m and -c command switches
  684. - The test_contextlib test in 2.5a1 wasn't actually run unless you ran
  685. it separately and by hand. It also wasn't cleaning up its changes to
  686. the current Decimal context.
  687. - regrtest.py now has a -M option to run tests that test the new limits of
  688. containers, on 64-bit architectures. Running these tests is only sensible
  689. on 64-bit machines with more than two gigabytes of memory. The argument
  690. passed is the maximum amount of memory for the tests to use.
  691. Tools
  692. -----
  693. - Added the Python benchmark suite pybench to the Tools/ directory;
  694. contributed by Marc-Andre Lemburg.
  695. Documentation
  696. -------------
  697. - Patch #1473132: Improve docs for ``tp_clear`` and ``tp_traverse``.
  698. - PEP 343: Added Context Types section to the library reference
  699. and attempted to bring other PEP 343 related documentation into
  700. line with the implementation and/or python-dev discussions.
  701. - Bug #1337990: clarified that ``doctest`` does not support examples
  702. requiring both expected output and an exception.
  703. What's New in Python 2.5 alpha 1?
  704. =================================
  705. *Release date: 05-APR-2006*
  706. Core and builtins
  707. -----------------
  708. - PEP 338: -m command line switch now delegates to runpy.run_module
  709. allowing it to support modules in packages and zipfiles
  710. - On Windows, .DLL is not an accepted file name extension for
  711. extension modules anymore; extensions are only found if they
  712. end in .PYD.
  713. - Bug #1421664: sys.stderr.encoding is now set to the same value as
  714. sys.stdout.encoding.
  715. - __import__ accepts keyword arguments.
  716. - Patch #1460496: round() now accepts keyword arguments.
  717. - Fixed bug #1459029 - unicode reprs were double-escaped.
  718. - Patch #1396919: The system scope threads are reenabled on FreeBSD
  719. 5.4 and later versions.
  720. - Bug #1115379: Compiling a Unicode string with an encoding declaration
  721. now gives a SyntaxError.
  722. - Previously, Python code had no easy way to access the contents of a
  723. cell object. Now, a ``cell_contents`` attribute has been added
  724. (closes patch #1170323).
  725. - Patch #1123430: Python's small-object allocator now returns an arena to
  726. the system ``free()`` when all memory within an arena becomes unused
  727. again. Prior to Python 2.5, arenas (256KB chunks of memory) were never
  728. freed. Some applications will see a drop in virtual memory size now,
  729. especially long-running applications that, from time to time, temporarily
  730. use a large number of small objects. Note that when Python returns an
  731. arena to the platform C's ``free()``, there's no guarantee that the
  732. platform C library will in turn return that memory to the operating system.
  733. The effect of the patch is to stop making that impossible, and in tests it
  734. appears to be effective at least on Microsoft C and gcc-based systems.
  735. Thanks to Evan Jones for hard work and patience.
  736. - Patch #1434038: property() now uses the getter's docstring if there is
  737. no "doc" argument given. This makes it possible to legitimately use
  738. property() as a decorator to produce a read-only property.
  739. - PEP 357, patch 1436368: add an __index__ method to int/long and a matching
  740. nb_index slot to the PyNumberMethods struct. The slot is consulted instead
  741. of requiring an int or long in slicing and a few other contexts, enabling
  742. other objects (e.g. Numeric Python's integers) to be used as slice indices.
  743. - Fixed various bugs reported by Coverity's Prevent tool.
  744. - PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
  745. new exception base class, BaseException, which has a new message attribute.
  746. KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
  747. Raising a string exception now raises a DeprecationWarning.
  748. - Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
  749. explicitly relative, using 'from .module import name' to mean 'from the same
  750. package as this module is in. Imports without dots still default to the
  751. old relative-then-absolute, unless 'from __future__ import
  752. absolute_import' is used.
  753. - Properly check if 'warnings' raises an exception (usually when a filter set
  754. to "error" is triggered) when raising a warning for raising string
  755. exceptions.
  756. - CO_GENERATOR_ALLOWED is no longer defined. This behavior is the default.
  757. The name was removed from Include/code.h.
  758. - PEP 308: conditional expressions were added: (x if cond else y).
  759. - Patch 1433928:
  760. - The copy module now "copies" function objects (as atomic objects).
  761. - dict.__getitem__ now looks for a __missing__ hook before raising
  762. KeyError.
  763. - PEP 343: with statement implemented. Needs ``from __future__ import
  764. with_statement``. Use of 'with' as a variable will generate a warning.
  765. Use of 'as' as a variable will also generate a warning (unless it's
  766. part of an import statement).
  767. The following objects have __context__ methods:
  768. - The built-in file type.
  769. - The thread.LockType type.
  770. - The following types defined by the threading module:
  771. Lock, RLock, Condition, Semaphore, BoundedSemaphore.
  772. - The decimal.Context class.
  773. - Fix the encodings package codec search function to only search
  774. inside its own package. Fixes problem reported in patch #1433198.
  775. Note: Codec packages should implement and register their own
  776. codec search function. PEP 100 has the details.
  777. - PEP 353: Using ``Py_ssize_t`` as the index type.
  778. - ``PYMALLOC_DEBUG`` builds now add ``4*sizeof(size_t)`` bytes of debugging
  779. info to each allocated block, since the ``Py_ssize_t`` changes (PEP 353)
  780. now allow Python to make use of memory blocks exceeding 2**32 bytes for
  781. some purposes on 64-bit boxes. A ``PYMALLOC_DEBUG`` build was limited
  782. to 4-byte allocations before.
  783. - Patch #1400181, fix unicode string formatting to not use the locale.
  784. This is how string objects work. u'%f' could use , instead of .
  785. for the decimal point. Now both strings and unicode always use periods.
  786. - Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
  787. configure would break checking curses.h.
  788. - Bug #959576: The pwd module is now builtin. This allows Python to be
  789. built on UNIX platforms without $HOME set.
  790. - Bug #1072182, fix some potential problems if characters are signed.
  791. - Bug #889500, fix line number on SyntaxWarning for global declarations.
  792. - Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
  793. - Support for converting hex strings to floats no longer works.
  794. This was not portable. float('0x3') now raises a ValueError.
  795. - Patch #1382163: Expose Subversion revision number to Python. New C API
  796. function Py_GetBuildNumber(). New attribute sys.subversion. Build number
  797. is now displayed in interactive prompt banner.
  798. - Implementation of PEP 341 - Unification of try/except and try/finally.
  799. "except" clauses can now be written together with a "finally" clause in
  800. one try statement instead of two nested ones. Patch #1355913.
  801. - Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
  802. now encodes backslash correctly.
  803. - Patch #1350409: Work around signal handling bug in Visual Studio 2005.
  804. - Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
  805. and long longs.
  806. - SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
  807. It was possible for dlerror() to return a NULL pointer, so
  808. it will now use a default error message in this case.
  809. - Replaced most Unicode charmap codecs with new ones using the
  810. new Unicode translate string feature in the builtin charmap
  811. codec; the codecs were created from the mapping tables available
  812. at ftp.unicode.org and contain a few updates (e.g. the Mac OS
  813. encodings now include a mapping for the Apple logo)
  814. - Added a few more codecs for Mac OS encodings
  815. - Sped up some Unicode operations.
  816. - A new AST parser implementation was completed. The abstract
  817. syntax tree is available for read-only (non-compile) access
  818. to Python code; an _ast module was added.
  819. - SF bug #1167751: fix incorrect code being produced for generator expressions.
  820. The following code now raises a SyntaxError: foo(a = i for i in range(10))
  821. - SF Bug #976608: fix SystemError when mtime of an imported file is -1.
  822. - SF Bug #887946: fix segfault when redirecting stdin from a directory.
  823. Provide a warning when a directory is passed on the command line.
  824. - Fix segfault with invalid coding.
  825. - SF bug #772896: unknown encoding results in MemoryError.
  826. - All iterators now have a Boolean value of True. Formerly, some iterators
  827. supported a __len__() method which evaluated to False when the iterator
  828. was empty.
  829. - On 64-bit platforms, when __len__() returns a value that cannot be
  830. represented as a C int, raise OverflowError.
  831. - test__locale is skipped on OS X < 10.4 (only partial locale support is
  832. present).
  833. - SF bug #893549: parsing keyword arguments was broken with a few format
  834. codes.
  835. - Changes donated by Elemental Security to make it work on AIX 5.3
  836. with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
  837. bug #105470: test_pwd fails on 64bit system (Opteron).
  838. - Changes donated by Elemental Security to make it work on HP-UX 11 on
  839. Itanium2 with HP's 64-bit compiler (SF patch #1225212).
  840. - Disallow keyword arguments for type constructors that don't use them
  841. (fixes bug #1119418).
  842. - Forward UnicodeDecodeError into SyntaxError for source encoding errors.
  843. - SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
  844. exceptions that cause a function to exit.
  845. - The implementation of set() and frozenset() was revised to use its
  846. own internal data structure. Memory consumption is reduced by 1/3
  847. and there are modest speed-ups as well. The API is unchanged.
  848. - SF bug #1238681: freed pointer is used in longobject.c:long_pow().
  849. - SF bug #1229429: PyObject_CallMethod failed to decrement some
  850. reference counts in some error exit cases.
  851. - SF bug #1185883: Python's small-object memory allocator took over
  852. a block managed by the platform C library whenever a realloc specified
  853. a small new size. However, there's no portable way to know then how
  854. much of the address space following the pointer is valid, so there's no
  855. portable way to copy data from the C-managed block into Python's
  856. small-object space without risking a memory fault. Python's small-object
  857. realloc now leaves such blocks under the control of the platform C
  858. realloc.
  859. - SF bug #1232517: An overflow error was not detected properly when
  860. attempting to convert a large float to an int in os.utime().
  861. - SF bug #1224347: hex longs now print with lowercase letters just
  862. like their int counterparts.
  863. - SF bug #1163563: the original fix for bug #1010677 ("thread Module
  864. Breaks PyGILState_Ensure()") broke badly in the case of multiple
  865. interpreter states; back out that fix and do a better job (see
  866. http://mail.python.org/pipermail/python-dev/2005-June/054258.html
  867. for a longer write-up of the problem).
  868. - SF patch #1180995: marshal now uses a binary format by default when
  869. serializing floats.
  870. - SF patch #1181301: on platforms that appear to use IEEE 754 floats,
  871. the routines that promise to produce IEEE 754 binary representations
  872. of floats now simply copy bytes around.
  873. - bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
  874. 278.
  875. - patch #1109424: int, long, float, complex, and unicode now check for the
  876. proper magic slot for type conversions when subclassed. Previously the
  877. magic slot was ignored during conversion. Semantics now match the way
  878. subclasses of str always behaved. int/long/float, conversion of an instance
  879. to the base class has been moved to the proper nb_* magic slot and out of
  880. PyNumber_*().
  881. Thanks Walter D�rwald.
  882. - Descriptors defined in C with a PyGetSetDef structure, where the setter is
  883. NULL, now raise an AttributeError when attempting to set or delete the
  884. attribute. Previously a TypeError was raised, but this was inconsistent
  885. with the equivalent pure-Python implementation.
  886. - It is now safe to call PyGILState_Release() before
  887. PyEval_InitThreads() (note that if there is reason to believe there
  888. are multiple threads around you still must call PyEval_InitThreads()
  889. before using the Python API; this fix is for extension modules that
  890. have no way of knowing if Python is multi-threaded yet).
  891. - Typing Ctrl-C whilst raw_input() was waiting in a build with threads
  892. disabled caused a crash.
  893. - Bug #1165306: instancemethod_new allowed the creation of a method
  894. with im_class == im_self == NULL, which caused a crash when called.
  895. - Move exception finalisation later in the shutdown process - this
  896. fixes the crash seen in bug #1165761
  897. - Added two new builtins, any() and all().
  898. - Defining a class with empty parentheses is now allowed
  899. (e.g., ``class C(): pass`` is no longer a syntax error).
  900. Patch #1176012 added support to the 'parser' module and 'compiler' package
  901. (thanks to logistix for that added support).
  902. - Patch #1115086: Support PY_LONGLONG in structmember.
  903. - Bug #1155938: new style classes did not check that __init__() was
  904. returning None.
  905. - Patch #802188: Report characters after line continuation character
  906. ('\') with a specific error message.
  907. - Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
  908. - Bug #1124295: the __name__ attribute of file objects was
  909. inadvertently made inaccessible in restricted mode.
  910. - Bug #1074011: closing sys.std{out,err} now causes a flush() and
  911. an ferror() call.
  912. - min() and max() now support key= arguments with the same meaning as in
  913. list.sort().
  914. - The peephole optimizer now performs simple constant folding in expressions:
  915. (2+3) --> (5).
  916. - set and frozenset objects can now be marshalled. SF #1098985.
  917. - Bug #1077106: Poor argument checking could cause memory corruption
  918. in calls to os.read().
  919. - The parser did not complain about future statements in illegal
  920. positions. It once again reports a syntax error if a future
  921. statement occurs after anything other than a doc string.
  922. - Change the %s format specifier for str objects so that it returns a
  923. unicode instance if the argument is not an instance of basestring and
  924. calling __str__ on the argument returns a unicode instance.
  925. - Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
  926. current thread state when the auto-GIL-state machinery knows about
  927. it (since the thread state is being deleted, continuing to remember it
  928. can't help, but can hurt if another thread happens to get created with
  929. the same thread id).
  930. Extension Modules
  931. -----------------
  932. - Patch #1380952: fix SSL objects timing out on consecutive read()s
  933. - Patch #1309579: wait3 and wait4 were added to the posix module.
  934. - Patch #1231053: The audioop module now supports encoding/decoding of alaw.
  935. In addition, the existing ulaw code was updated.
  936. - RFE #567972: Socket objects' family, type and proto properties are
  937. now exposed via new attributes.
  938. - Everything under lib-old was removed. This includes the following modules:
  939. Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
  940. lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
  941. util, whatsound, whrandom, zmod
  942. - The following modules were removed: regsub, reconvert, regex, regex_syntax.
  943. - re and sre were swapped, so help(re) provides full help. importing sre
  944. is deprecated. The undocumented re.engine variable no longer exists.
  945. - Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
  946. SS2 (single-shift 2) escape sequences correctly.
  947. - The unicodedata module was updated to the 4.1 version of the Unicode
  948. database. The 3.2 version is still available as unicodedata.db_3_2_0
  949. for applications that require this specific version (such as IDNA).
  950. - The timing module is no longer built by default. It was deprecated
  951. in PEP 4 in Python 2.0 or earlier.
  952. - Patch 1433928: Added a new type, defaultdict, to the collections module.
  953. This uses the new __missing__ hook behavior added to dict (see above).
  954. - Bug #854823: socketmodule now builds on Sun platforms even when
  955. INET_ADDRSTRLEN is not defined.
  956. - Patch #1393157: os.startfile() now has an optional argument to specify
  957. a "command verb" to invoke on the file.
  958. - Bug #876637, prevent stack corruption when socket descriptor
  959. is larger than FD_SETSIZE.
  960. - Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
  961. mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
  962. mmap.mmap(0, size) should not be used on Windows for anonymous memory.
  963. - Patch #1422385: The nis module now supports access to domains other
  964. than the system default domain.
  965. - Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
  966. are reported, the limit on path name lengths is removed, and stat reports
  967. WindowsError now (instead of OSError).
  968. - Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
  969. - Bug #1413192, fix seg fault in bsddb if a transaction was deleted
  970. before the env.
  971. - Patch #1103116: Basic AF_NETLINK support.
  972. - Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
  973. - Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
  974. Also fix ungetmouse() which did not accept arguments properly.
  975. The code now conforms to the documented signature.
  976. - Bug #1400115, Fix segfault when calling curses.panel.userptr()
  977. without prior setting of the userptr.
  978. - Fix 64-bit problems in bsddb.
  979. - Patch #1365916: fix some unsafe 64-bit mmap methods.
  980. - Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
  981. problem on AIX.
  982. - Bug #869197: os.setgroups rejects long integer arguments
  983. - Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
  984. - Bug #1344508, Fix UNIX mmap leaking file descriptors
  985. - Patch #1338314, Bug #1336623: fix tarfile so it can extract
  986. REGTYPE directories from tarfiles written by old programs.
  987. - Patch #1407992, fixes broken bsddb module db associate when using
  988. BerkeleyDB 3.3, 4.0 or 4.1.
  989. - Get bsddb module to build with BerkeleyDB version 4.4
  990. - Get bsddb module to build with BerkeleyDB version 3.2
  991. - Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
  992. but Python incorrectly assumes it is in UTF-8 format
  993. - Fix parse errors in the readline module when compiling without threads.
  994. - Patch #1288833: Removed thread lock from socket.getaddrinfo on
  995. FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
  996. - Patches #1298449 and #1298499: Add some missing checks for error
  997. returns in cStringIO.c.
  998. - Patch #1297028: fix segfault if call type on MultibyteCodec,
  999. MultibyteStreamReader, or MultibyteStreamWriter
  1000. - Fix memory leak in posix.access().
  1001. - Patch #1213831: Fix typo in unicodedata._getcode.
  1002. - Bug #1007046: os.startfile() did not accept unicode strings encoded in
  1003. the file system encoding.
  1004. - Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
  1005. platforms that don't have inet_aton().
  1006. - Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
  1007. - Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
  1008. line without newlines.
  1009. - Bug #728515: mmap.resize() now resizes the file on Unix as it did
  1010. on Windows.
  1011. - Patch #1180695: Add nanosecond stat resolution, and st_gen,
  1012. st_birthtime for FreeBSD.
  1013. - Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
  1014. the request code argument, which results in more C-like behaviour
  1015. for large or negative values.
  1016. - Bug #1234979: For the argument of thread.Lock.acquire, the Windows
  1017. implementation treated all integer values except 1 as false.
  1018. - Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
  1019. - Patch #1212117: os.stat().st_flags is now accessible as a attribute
  1020. if available on the platform.
  1021. - Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
  1022. available on the platform.
  1023. - Bug #1166660: The readline module could segfault if hook functions
  1024. were set in a different thread than that which called readline.
  1025. - collections.deque objects now support a remove() method.
  1026. - operator.itemgetter() and operator.attrgetter() now support retrieving
  1027. multiple fields. This provides direct support for sorting on multiple
  1028. keys (primary, secondary, etc).
  1029. - os.access now supports Unicode path names on non-Win32 systems.
  1030. - Patches #925152, #1118602: Avoid reading after the end of the buffer
  1031. in pyexpat.GetInputContext.
  1032. - Patches #749830, #1144555: allow UNIX mmap size to default to current
  1033. file size.
  1034. - Added functional.partial(). See PEP309.
  1035. - Patch #1093585: raise a ValueError for negative history items in readline.
  1036. {remove_history,replace_history}
  1037. - The spwd module has been added, allowing access to the shadow password
  1038. database.
  1039. - stat_float_times is now True.
  1040. - array.array objects are now picklable.
  1041. - the cPickle module no longer accepts the deprecated None option in the
  1042. args tuple returned by __reduce__().
  1043. - itertools.islice() now accepts None for the start and step arguments.
  1044. This allows islice() to work more readily with slices:
  1045. islice(s.start, s.stop, s.step)
  1046. - datetime.datetime() now has a strptime class method which can be used to
  1047. create datetime object using a string and format.
  1048. - Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
  1049. with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
  1050. Library
  1051. -------
  1052. - Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have
  1053. been renamed to have only a single underscore prefix. This was done to
  1054. make subclassing easier.
  1055. - PEP 338: new module runpy defines a run_module function to support
  1056. executing modules which provide access to source code or a code object
  1057. via the PEP 302 import mechanisms.
  1058. - The email module's parsedate_tz function now sets the daylight savings
  1059. flag to -1 (unknown) since it can't tell from the date whether it should
  1060. be set.
  1061. - Patch #624325: urlparse.urlparse() and urlparse.urlsplit() results
  1062. now sport attributes that provide access to the parts of the result.
  1063. - Patch #1462498: sgmllib now handles entity and character references
  1064. in attribute values.
  1065. - Added the sqlite3 package. This is based on pysqlite2.1.3, and provides
  1066. a DB-API interface in the standard library. You'll need sqlite 3.0.8 or
  1067. later to build this - if you have an earlier version, the C extension
  1068. module will not be built.
  1069. - Bug #1460340: ``random.sample(dict)`` failed in various ways. Dicts
  1070. aren't officially supported here, and trying to use them will probably
  1071. raise an exception some day. But dicts have been allowed, and "mostly
  1072. worked", so support for them won't go away without warning.
  1073. - Bug #1445068: getpass.getpass() can now be given an explicit stream
  1074. argument to specify where to write the prompt.
  1075. - Patch #1462313, bug #1443328: the pickle modules now can handle classes
  1076. that have __private names in their __slots__.
  1077. - Bug #1250170: mimetools now handles socket.gethostname() failures gracefully.
  1078. - patch #1457316: "setup.py upload" now supports --identity to select the
  1079. key to be used for signing the uploaded code.
  1080. - Queue.Queue objects now support .task_done() and .join() methods
  1081. to make it easier to monitor when daemon threads have completed
  1082. processing all enqueued tasks. Patch #1455676.
  1083. - popen2.Popen objects now preserve the command in a .cmd attribute.
  1084. - Added the ctypes ffi package.
  1085. - email 4.0 package now integrated. This is largely the same as the email 3.0
  1086. package that was included in Python 2.3, except that PEP 8 module names are
  1087. now used (e.g. mail.message instead of email.Message). The MIME classes
  1088. have been moved to a subpackage (e.g. email.mime.text instead of
  1089. email.MIMEText). The old names are still supported for now. Several
  1090. deprecated Message methods have been removed and lots of bugs have been
  1091. fixed. More details can be found in the email package documentation.
  1092. - Patches #1436130/#1443155: codecs.lookup() now returns a CodecInfo object
  1093. (a subclass of tuple) that provides incremental decoders and encoders
  1094. (a way to use stateful codecs without the stream API). Python functions
  1095. codecs.getincrementaldecoder() and codecs.getincrementalencoder() as well
  1096. as C functions PyCodec_IncrementalEncoder() and PyCodec_IncrementalDecoder()
  1097. have been added.
  1098. - Patch #1359365: Calling next() on a closed StringIO.String object raises
  1099. a ValueError instead of a StopIteration now (like file and cString.String do).
  1100. cStringIO.StringIO.isatty() will raise a ValueError now if close() has been
  1101. called before (like file and StringIO.StringIO do).
  1102. - A regrtest option -w was added to re-run failed tests in verbose mode.
  1103. - Patch #1446372: quit and exit can now be called from the interactive
  1104. interpreter to exit.
  1105. - The function get_count() has been added to the gc module, and gc.collect()
  1106. grew an optional 'generation' argument.
  1107. - A library msilib to generate Windows Installer files, and a distutils
  1108. command bdist_msi have been added.
  1109. - PEP 343: new module contextlib.py defines decorator @contextmanager
  1110. and helpful context managers nested() and closing().
  1111. - The compiler package now supports future imports after the module docstring.
  1112. - Bug #1413790: zipfile now sanitizes absolute archive names that are
  1113. not allowed by the specs.
  1114. - Patch #1215184: FileInput now can be given an opening hook which can
  1115. be used to control how files are opened.
  1116. - Patch #1212287: fileinput.input() now has a mode parameter for
  1117. specifying the file mode input files should be opened with.
  1118. - Patch #1215184: fileinput now has a fileno() function for getting the
  1119. current file number.
  1120. - Patch #1349274: gettext.install() now optionally installs additional
  1121. translation functions other than _() in the builtin namespace.
  1122. - Patch #1337756: fileinput now accepts Unicode filenames.
  1123. - Patch #1373643: The chunk module can now read chunks larger than
  1124. two gigabytes.
  1125. - Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
  1126. - Bug #1430298: It is now possible to send a mail with an empty
  1127. return address using smtplib.
  1128. - Bug #1432260: The names of lambda functions are now properly displayed
  1129. in pydoc.
  1130. - Patch #1412872: zipfile now sets the creator system to 3 (Unix)
  1131. unless the system is Win32.
  1132. - Patch #1349118: urllib now supports user:pass@ style proxy
  1133. specifications, raises IOErrors when proxies for unsupported protocols
  1134. are defined, and uses the https proxy on https redirections.
  1135. - Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
  1136. - Bug #1407902: Add support for sftp:// URIs to urlparse.
  1137. - Bug #1371247: Update Windows locale identifiers in locale.py.
  1138. - Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
  1139. any more.
  1140. - Bug #1403410: The warnings module now doesn't get confused
  1141. when it can't find out the module name it generates a warning for.
  1142. - Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
  1143. - Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
  1144. - Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
  1145. LoadError as documented, instead of IOError. For compatibility,
  1146. LoadError subclasses IOError.
  1147. - Added the hashlib module. It provides secure hash functions for MD5 and
  1148. SHA1, 224, 256, 384, and 512. Note that recent developments make the
  1149. historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
  1150. In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
  1151. Ronald L. Rivest offered this advice for Python:
  1152. "The consensus of researchers in this area (at least as
  1153. expressed at the NIST Hash Function Workshop 10/31/05),
  1154. is that SHA-256 is a good choice for the time being, but
  1155. that research should continue, and other alternatives may
  1156. arise from this research. The larger SHA's also seem OK."
  1157. - Added a subset of Fredrik Lundh's ElementTree package. Available
  1158. modules are xml.etree.ElementTree, xml.etree.ElementPath, and
  1159. xml.etree.ElementInclude, from ElementTree 1.2.6.
  1160. - Patch #1162825: Support non-ASCII characters in IDLE window titles.
  1161. - Bug #1365984: urllib now opens "data:" URLs again.
  1162. - Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
  1163. is raised within the method itself on a previous call (e.g., passing in an
  1164. illegal argument)
  1165. - Bug #1340337: change time.strptime() to always return ValueError when there
  1166. is an error in the format string.
  1167. - Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
  1168. - Bug #729103: pydoc.py: Fix docother() method to accept additional
  1169. "parent" argument.
  1170. - Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
  1171. for padding.
  1172. - Bug #1296004: httplib.py: Limit maximal amount of data read from the
  1173. socket to avoid a MemoryError on Windows.
  1174. - Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
  1175. to get the correct encoding.
  1176. - Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
  1177. languages.
  1178. - Patch #1268314: Cache lines in StreamReader.readlines for performance.
  1179. - Bug #1290505: Fix clearing the regex cache for time.strptime().
  1180. - Bug #1167128: Fix size of a symlink in a tarfile to be 0.
  1181. - Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
  1182. functionality.
  1183. - Bug #1163178: Make IDNA return an empty string when the input is empty.
  1184. - Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
  1185. separator and do not output trailing semicolon.
  1186. - Patch #1062060: urllib.urlretrieve() now raises a new exception, named
  1187. ContentTooShortException, when the actually downloaded size does not
  1188. match the Content-Length header.
  1189. - Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
  1190. - Bug #1178484: Return complete lines from codec stream readers
  1191. even if there is an exception in later lines, resulting in
  1192. correct line numbers for decoding errors in source code.
  1193. - Bug #1192315: Disallow negative arguments to clear() in pdb.
  1194. - Patch #827386: Support absolute source paths in msvccompiler.py.
  1195. - Patch #1105730: Apply the new implementation of commonprefix in posixpath
  1196. to ntpath, macpath, os2emxpath and riscospath.
  1197. - Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
  1198. __hasattr__ and __delattr__ methods on class Tk that were breaking
  1199. Tkdnd.
  1200. - Bug #1015140: disambiguated the term "article id" in nntplib docs and
  1201. docstrings to either "article number" or "message id".
  1202. - Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
  1203. parameter, but uses the usual "kwargs=None".
  1204. - textwrap now processes text chunks at O(n) speed instead of O(n**2).
  1205. Patch #1209527 (Contributed by Connelly).
  1206. - urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
  1207. to W3C name (404 -> 'Not Found'). RFE #1216944.
  1208. - Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
  1209. as this can cause problems with apps closing all file descriptors.
  1210. - Bug #839151: Fix an attempt to access sys.argv in the warnings module;
  1211. it can be missing in embedded interpreters
  1212. - Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
  1213. - Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
  1214. error messages.
  1215. - Bug #1108948: Cookie.py produced invalid JavaScript code.
  1216. - The tokenize module now detects and reports indentation errors.
  1217. Bug #1224621.
  1218. - The tokenize module has a new untokenize() function to support a full
  1219. roundtrip from lexed tokens back to Python source code. In addition,
  1220. the generate_tokens() function now accepts a callable argument that
  1221. terminates by raising StopIteration.
  1222. - Bug #1196315: fix weakref.WeakValueDictionary constructor.
  1223. - Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
  1224. component of the path.
  1225. - Patch #1120353: The xmlrpclib module provides better, more transparent,
  1226. support for datetime.{datetime,date,time} objects. With use_datetime set
  1227. to True, applications shouldn't have to fiddle with the DateTime wrapper
  1228. class at all.
  1229. - distutils.commands.upload was added to support uploading distribution
  1230. files to PyPI.
  1231. - distutils.commands.register now encodes the data as UTF-8 before posting
  1232. them to PyPI.
  1233. - decimal operator and comparison methods now return NotImplemented
  1234. instead of raising a TypeError when interacting with other types. This
  1235. allows other classes to implement __radd__ style methods and have them
  1236. work as expected.
  1237. - Bug #1163325: Decimal infinities failed to hash. Attempting to
  1238. hash a NaN raised an InvalidOperation instead of a TypeError.
  1239. - Patch #918101: Add tarfile open mode r|* for auto-detection of the
  1240. stream compression; add, for symmetry reasons, r:* as a synonym of r.
  1241. - Patch #1043890: Add extractall method to tarfile.
  1242. - Patch #1075887: Don't require MSVC in distutils if there is nothing
  1243. to build.
  1244. - Patch #1103407: Properly deal with tarfile iterators when untarring
  1245. symbolic links on Windows.
  1246. - Patch #645894: Use getrusage for computing the time consumption in
  1247. profile.py if available.
  1248. - Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
  1249. - Patch #1117454: Remove code to special-case cookies without values
  1250. in LWPCookieJar.
  1251. - Patch #1117339: Add cookielib special name tests.
  1252. - Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
  1253. - Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
  1254. - Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
  1255. - Patch #1104111: Alter setup.py --help and --help-commands.
  1256. - Patch #1121234: Properly cleanup _exit and tkerror commands.
  1257. - Patch #1049151: xdrlib now unpacks booleans as True or False.
  1258. - Fixed bug in a NameError bug in cookielib. Patch #1116583.
  1259. - Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
  1260. disables recursive traversal through instance attributes, which can
  1261. be exploited in various ways.
  1262. - Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
  1263. flags on the HTTP listening socket.
  1264. - Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
  1265. Fixed by reading the HTTP body in chunks instead of one big socket.read().
  1266. - Patches #893642, #1039083: add allow_none, encoding arguments to
  1267. constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
  1268. - Bug #1110478: Revert os.environ.update to do putenv again.
  1269. - Bug #1103844: fix distutils.install.dump_dirs() with negated options.
  1270. - os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
  1271. - Enhancements to the csv module:
  1272. + Dialects are now validated by the underlying C code, better
  1273. reflecting its capabilities, and improving its compliance with
  1274. PEP 305.
  1275. + Dialect parameter parsing has been re-implemented to improve error
  1276. reporting.
  1277. + quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
  1278. dictates.
  1279. + the parser now removes the escapechar prefix from escaped characters.
  1280. + when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
  1281. types, rather than any object that can be represented as a numeric.
  1282. + when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
  1283. to floats.
  1284. + reader now allows \r characters to be quoted (previously it only allowed
  1285. \n to be quoted).
  1286. + writer doublequote handling improved.
  1287. + Dialect classes passed to the module are no longer instantiated by
  1288. the module before being parsed (the former validation scheme required
  1289. this, but the mechanism was unreliable).
  1290. + The dialect registry now contains instances of the internal
  1291. C-coded dialect type, rather than references to python objects.
  1292. + the internal c-coded dialect type is now immutable.
  1293. + register_dialect now accepts the same keyword dialect specifications
  1294. as the reader and writer, allowing the user to register dialects
  1295. without first creating a dialect class.
  1296. + a configurable limit to the size of parsed fields has been added -
  1297. previously, an unmatched quote character could result in the entire
  1298. file being read into the field buffer before an error was reported.
  1299. + A new module method csv.field_size_limit() has been added that sets
  1300. the parser field size limit (returning the former limit). The initial
  1301. limit is 128kB.
  1302. + A line_num attribute has been added to the reader object, which tracks
  1303. the number of lines read from the source iterator. This is not
  1304. the same as the number of records returned, as records can span
  1305. multiple lines.
  1306. + reader and writer objects were not being registered with the cyclic-GC.
  1307. This has been fixed.
  1308. - _DummyThread objects in the threading module now delete self.__block that is
  1309. inherited from _Thread since it uses up a lock allocated by 'thread'. The
  1310. lock primitives tend to be limited in number and thus should not be wasted on
  1311. a _DummyThread object. Fixes bug #1089632.
  1312. - The imghdr module now detects Exif files.
  1313. - StringIO.truncate() now correctly adjusts the size attribute.
  1314. (Bug #951915).
  1315. - locale.py now uses an updated locale alias table (built using
  1316. Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
  1317. alias file); the encoding lookup was enhanced to use Python's
  1318. encoding alias table.
  1319. - moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
  1320. - the pickle module no longer accepts the deprecated None option in the
  1321. args tuple returned by __reduce__().
  1322. - optparse now optionally imports gettext. This allows its use in setup.py.
  1323. - the pickle module no longer uses the deprecated bin parameter.
  1324. - the shelve module no longer uses the deprecated binary parameter.
  1325. - the pstats module no longer uses the deprecated ignore() method.
  1326. - the filecmp module no longer uses the deprecated use_statcache argument.
  1327. - unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
  1328. extended or overridden by subclasses. Formerly, the subclassed method would
  1329. be ignored by the rest of the module. (Bug #1078905).
  1330. - heapq.nsmallest() and heapq.nlargest() now support key= arguments with
  1331. the same meaning as in list.sort().
  1332. - Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
  1333. once when a size argument is given. This prevents a buffer overflow in the
  1334. tokenizer with very long source lines.
  1335. - Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
  1336. immediately after creating the object, without any intervening
  1337. ``.decompress()`` calls.
  1338. - The reconvert.quote function can now emit triple-quoted strings. The
  1339. reconvert module now has some simple documentation.
  1340. - ``UserString.MutableString`` now supports negative indices in
  1341. ``__setitem__`` and ``__delitem__``
  1342. - Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
  1343. correctly.
  1344. - Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
  1345. ``codecs.StreamReader.readline()`` has a trailing "\r", read one more
  1346. character even if the user has passed a size parameter to get a proper
  1347. line ending. Remove the special handling of a "\r\n" that has been split
  1348. between two lines.
  1349. - Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
  1350. about illegal code points. The codec now supports PEP 293 style error
  1351. handlers.
  1352. - Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
  1353. from the input stream, so that the output is a byte string in the correct
  1354. encoding instead of a unicode string.
  1355. - Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
  1356. considering it exactly like a '*'.
  1357. - Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
  1358. ``encodings.aliases``.
  1359. - ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
  1360. - Patch #1413711: Certain patterns of differences were making difflib
  1361. touch the recursion limit.
  1362. - Bug #947906: An object oriented interface has been added to the calendar
  1363. module. It's possible to generate HTML calendar now and the module can be
  1364. called as a script (e.g. via ``python -mcalendar``). Localized month and
  1365. weekday names can be ouput (even if an exotic encoding is used) using
  1366. special classes that use unicode.
  1367. Build
  1368. -----
  1369. - Fix test_float, test_long, and test_struct failures on Tru64 with gcc
  1370. by using -mieee gcc option.
  1371. - Patch #1432345: Make python compile on DragonFly.
  1372. - Build support for Win64-AMD64 was added.
  1373. - Patch #1428494: Prefer linking against ncursesw over ncurses library.
  1374. - Patch #881820: look for openpty and forkpty also in libbsd.
  1375. - The sources of zlib are now part of the Python distribution (zlib 1.2.3).
  1376. The zlib module is now builtin on Windows.
  1377. - Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
  1378. - Bug #1189330: configure did not correctly determine the necessary
  1379. value of LINKCC if python was built with GCC 4.0.
  1380. - Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
  1381. vulnerability in zlib 1.2.1 and 1.2.2.
  1382. - EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
  1383. flags that change binary compatibility. Changes were also made to
  1384. distutils.sysconfig to also use the environment variable when used during
  1385. compilation of the interpreter and of C extensions through distutils.
  1386. - SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
  1387. and linking has changed (prebinding is now deprecated, and libcc_dynamic
  1388. no longer exists). This configure patch makes things right.
  1389. - Bug #1158607: Build with --disable-unicode again.
  1390. - spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
  1391. defined. Discovered as a result of not being able to build on OS X.
  1392. - setup.py now uses the directories specified in LDFLAGS using the -L option
  1393. and in CPPFLAGS using the -I option for adding library and include
  1394. directories, respectively, for compiling extension modules against. This has
  1395. led to the core being compiled using the values in CPPFLAGS. It also removes
  1396. the need for the special-casing of both DarwinPorts and Fink for darwin since
  1397. the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
  1398. ``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
  1399. Fink, ``-I/opt/local/include`` for DarwinPorts).
  1400. - Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
  1401. to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
  1402. Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
  1403. Closes bug #1096244. Thanks Gregory Bond.
  1404. C API
  1405. -----
  1406. - ``PyMem_{Del, DEL}`` and ``PyMem_{Free, FREE}`` no longer map to
  1407. ``PyObject_{Free, FREE}``. They map to the system ``free()`` now. If memory
  1408. is obtained via the ``PyObject_`` family, it must be released via the
  1409. ``PyObject_`` family, and likewise for the ``PyMem_`` family. This has
  1410. always been officially true, but when Python's small-object allocator was
  1411. introduced, an attempt was made to cater to a few extension modules
  1412. discovered at the time that obtained memory via ``PyObject_New`` but
  1413. released it via ``PyMem_DEL``. It's years later, and if such code still
  1414. exists it will fail now (probably with segfaults, but calling wrong
  1415. low-level memory management functions can yield many symptoms).
  1416. - Added a C API for set and frozenset objects.
  1417. - Removed PyRange_New().
  1418. - Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
  1419. mapping argument now. This string is used as a mapping table. Byte values
  1420. greater than the length of the string and 0xFFFE are treated as undefined
  1421. mappings.
  1422. Tests
  1423. -----
  1424. - In test_os, st_?time is now truncated before comparing it with ST_?TIME.
  1425. - Patch #1276356: New resource "urlfetch" is implemented. This enables
  1426. even impatient people to run tests that require remote files.
  1427. Documentation
  1428. -------------
  1429. - Bug #1402224: Add warning to dl docs about crashes.
  1430. - Bug #1396471: Document that Windows' ftell() can return invalid
  1431. values for text files with UNIX-style line endings.
  1432. - Bug #1274828: Document os.path.splitunc().
  1433. - Bug #1190204: Clarify which directories are searched by site.py.
  1434. - Bug #1193849: Clarify os.path.expanduser() documentation.
  1435. - Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
  1436. - Bug #755617: Document the effects of os.chown() on Windows.
  1437. - Patch #1180012: The documentation for modulefinder is now in the library reference.
  1438. - Patch #1213031: Document that os.chown() accepts argument values of -1.
  1439. - Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
  1440. - Bug #1175022: Correct the example code for property().
  1441. - Document the IterableUserDict class in the UserDict module.
  1442. Closes bug #1166582.
  1443. - Remove all latent references for "Macintosh" that referred to semantics for
  1444. Mac OS 9 and change to reflect the state for OS X.
  1445. Closes patch #1095802. Thanks Jack Jansen.
  1446. Mac
  1447. ---
  1448. New platforms
  1449. -------------
  1450. - FreeBSD 7 support is added.
  1451. Tools/Demos
  1452. -----------
  1453. - Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
  1454. directory for syntax highlighting in Vim. Vim directory was added and placed
  1455. vimrc to it (was previous up a level).
  1456. - Added two new files to Tools/scripts: pysource.py, which recursively
  1457. finds Python source files, and findnocoding.py, which finds Python
  1458. source files that need an encoding declaration.
  1459. Patch #784089, credits to Oleg Broytmann.
  1460. - Bug #1072853: pindent.py used an uninitialized variable.
  1461. - Patch #1177597: Correct Complex.__init__.
  1462. - Fixed a display glitch in Pynche, which could cause the right arrow to
  1463. wiggle over by a pixel.
  1464. What's New in Python 2.4 final?
  1465. ===============================
  1466. *Release date: 30-NOV-2004*
  1467. Core and builtins
  1468. -----------------
  1469. - Bug 875692: Improve signal handling, especially when using threads, by
  1470. forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
  1471. things_to_do is not cleared by Py_MakePendingCalls().
  1472. What's New in Python 2.4 (release candidate 1)
  1473. ==============================================
  1474. *Release date: 18-NOV-2004*
  1475. Core and builtins
  1476. -----------------
  1477. - Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
  1478. the years-old thread shutdown race bug 225673. Numeric history lesson
  1479. aside, all bugs in all three reports are fixed now.
  1480. Library
  1481. -------
  1482. - Bug 1052242: If exceptions are raised by an atexit handler function an
  1483. attempt is made to execute the remaining handlers. The last exception
  1484. raised is re-raised.
  1485. - ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
  1486. doctests was broken in a dramatic but shallow way. Fixed.
  1487. - Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
  1488. and ``month_abbr`` attributes emulate sequences of locale-correct
  1489. spellings of month and day names. Because the locale can change at
  1490. any time, the correct spelling is recomputed whenever one of these is
  1491. indexed. In the worst case, the index may be a slice object, so these
  1492. recomputed every day or month name each time they were indexed. This is
  1493. much slower than necessary in the usual case, when the index is just an
  1494. integer. In that case, only the single spelling needed is recomputed
  1495. now; and, when the index is a slice object, only the spellings needed
  1496. by the slice are recomputed now.
  1497. - Patch 1061679: Added ``__all__`` to pickletools.py.
  1498. Build
  1499. -----
  1500. - Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
  1501. and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
  1502. which has no known users. Thanks Bob Ippolito.
  1503. C API
  1504. -----
  1505. - The PyRange_New() function is deprecated.
  1506. What's New in Python 2.4 beta 2?
  1507. ================================
  1508. *Release date: 03-NOV-2004*
  1509. License
  1510. -------
  1511. The Python Software Foundation changed the license under which Python
  1512. is released, to remove Python version numbers. There were no other
  1513. changes to the license. So, for example, wherever the license for
  1514. Python 2.3 said "Python 2.3", the new license says "Python". The
  1515. intent is to make it possible to refer to the PSF license in a more
  1516. durable way. For example, some people say they're confused by that
  1517. the Open Source Initiative's entry for the Python Software Foundation
  1518. License::
  1519. http://www.opensource.org/licenses/PythonSoftFoundation.php
  1520. says "Python 2.1.1" all over it, wondering whether it applies only
  1521. to Python 2.1.1.
  1522. The official name of the new license is the Python Software Foundation
  1523. License Version 2.
  1524. Core and builtins
  1525. -----------------
  1526. - Bug #1055820 Cyclic garbage collection was not protecting against that
  1527. calling a live weakref to a piece of cyclic trash could resurrect an
  1528. insane mutation of the trash if any Python code ran during gc (via
  1529. running a dead object's __del__ method, running another callback on a
  1530. weakref to a dead object, or via any Python code run in any other thread
  1531. that managed to obtain the GIL while a __del__ or callback was running
  1532. in the thread doing gc). The most likely symptom was "impossible"
  1533. ``AttributeError`` exceptions, appearing seemingly at random, on weakly
  1534. referenced objects. The cure was to clear all weakrefs to unreachable
  1535. objects before allowing any callbacks to run.
  1536. - Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
  1537. Extension Modules
  1538. -----------------
  1539. - Bug #1048870: the compiler now generates distinct code objects for
  1540. functions with identical bodies. This was producing confusing
  1541. traceback messages which pointed to the function where the code
  1542. object was first defined rather than the function being executed.
  1543. Library
  1544. -------
  1545. - Patch #1056967 changes the semantics of Template.safe_substitute() so that
  1546. no ValueError is raised on an 'invalid' match group. Now the delimiter is
  1547. returned.
  1548. - Bug #1052503 pdb.runcall() was not passing along keyword arguments.
  1549. - Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
  1550. paths with a base path before checking os.path.isfile().
  1551. - The whichdb module can now be run from the command line.
  1552. - Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
  1553. the year) when the day of the week and year are also specified.
  1554. - Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
  1555. - Bug #1017553: fix bug in tarfile.filemode()
  1556. - Patch #737473: fix bug that old source code is shown in tracebacks even if
  1557. the source code is updated and reloaded.
  1558. Build
  1559. -----
  1560. - Patch #1044395: --enable-shared is allowed in FreeBSD also.
  1561. What's New in Python 2.4 beta 1?
  1562. ================================
  1563. *Release date: 15-OCT-2004*
  1564. Core and builtins
  1565. -----------------
  1566. - Patch #975056: Restartable signals were not correctly disabled on
  1567. BSD systems. Consistently use PyOS_setsig() instead of signal().
  1568. - The internal portable implementation of thread-local storage (TLS), used
  1569. by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
  1570. thread-correct. This could lead to a variety of problems, up to and
  1571. including segfaults. See bug 1041645 for an example.
  1572. - Added a command line option, -m module, which searches sys.path for the
  1573. module and then runs it. (Contributed by Nick Coghlan.)
  1574. - The bytecode optimizer now folds tuples of constants into a single
  1575. constant.
  1576. - SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
  1577. an integer was compared to a float, the integer was coerced to a float.
  1578. That could yield spurious overflow errors (if the integer was very
  1579. large), and to anomalies such as
  1580. ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
  1581. longer performed, and cases like ``long(1e200)-1 < 1e200``,
  1582. ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
  1583. correctly now.
  1584. Extension modules
  1585. -----------------
  1586. - ``collections.deque`` objects didn't play quite right with garbage
  1587. collection, which could lead to a segfault in a release build, or
  1588. an assert failure in a debug build. Also, added overflow checks,
  1589. better detection of mutation during iteration, and shielded deque
  1590. comparisons from unusual subclass overrides of the __iter__() method.
  1591. Library
  1592. -------
  1593. - Patch 1046644: distutils build_ext grew two new options - --swig for
  1594. specifying the swig executable to use, and --swig-opts to specify
  1595. options to pass to swig. --swig-opts="-c++" is the new way to spell
  1596. --swig-cpp.
  1597. - Patch 983206: distutils now obeys environment variable LDSHARED, if
  1598. it is set.
  1599. - Added Peter Astrand's subprocess.py module. See PEP 324 for details.
  1600. - time.strptime() now properly escapes timezones and all other locale-specific
  1601. strings for regex-specific symbols. Was breaking under Japanese Windows when
  1602. the timezone was specified as "Tokyo (standard time)".
  1603. Closes bug #1039270.
  1604. - Updates for the email package:
  1605. + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
  1606. + All deprecated APIs that in email 2.x issued warnings have been removed:
  1607. _encoder argument to the MIMEText constructor, Message.add_payload(),
  1608. Utils.dump_address_pair(), Utils.decode(), Utils.encode()
  1609. + New deprecations: Generator.__call__(), Message.get_type(),
  1610. Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
  1611. the Parser constructor. These will be removed in email 3.1.
  1612. + Support for Python earlier than 2.3 has been removed (see PEP 291).
  1613. + All defect classes have been renamed to end in 'Defect'.
  1614. + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
  1615. added to messages that claim to be multipart but really aren't.
  1616. + Updates to documentation.
  1617. - re's findall() and finditer() functions now take an optional flags argument
  1618. just like the compile(), search(), and match() functions. Also, documented
  1619. the previously existing start and stop parameters for the findall() and
  1620. finditer() methods of regular expression objects.
  1621. - rfc822 Messages now support iterating over the headers.
  1622. - The (undocumented) tarfile.Tarfile.membernames has been removed;
  1623. applications should use the getmember function.
  1624. - httplib now offers symbolic constants for the HTTP status codes.
  1625. - SF bug #1028306: Trying to compare a ``datetime.date`` to a
  1626. ``datetime.datetime`` mistakenly compared only the year, month and day.
  1627. Now it acts like a mixed-type comparison: ``False`` for ``==``,
  1628. ``True`` for ``!=``, and raises ``TypeError`` for other comparison
  1629. operators. Because datetime is a subclass of date, comparing only the
  1630. base class (date) members can still be done, if that's desired, by
  1631. forcing using of the approprate date method; e.g.,
  1632. ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
  1633. and day members of ``a_date`` and ``a_datetime`` are equal.
  1634. - bdist_rpm now supports command line options --force-arch,
  1635. {pre,post}-install, {pre,post}-uninstall, and
  1636. {prep,build,install,clean,verify}-script.
  1637. - SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
  1638. decoding incomplete input (when the input stream is temporarily exhausted).
  1639. ``codecs.StreamReader`` now implements buffering, which enables proper
  1640. readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
  1641. has a new argument ``chars`` which specifies the number of characters to
  1642. return. ``codecs.StreamReader.readline()`` and
  1643. ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
  1644. Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
  1645. - The documentation for doctest is greatly expanded, and now covers all
  1646. the new public features (of which there are many).
  1647. - ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
  1648. updates it. This isn't good, because every ``testmod()`` call
  1649. contributes to bloating the "hidden" state of ``doctest.master``, but
  1650. some old code apparently relies on it. For now, all we can do is
  1651. encourage people to stitch doctests together via doctest's unittest
  1652. integration features instead.
  1653. - httplib now handles ipv6 address/port pairs.
  1654. - SF bug #1017864: ConfigParser now correctly handles default keys,
  1655. processing them with ``ConfigParser.optionxform`` when supplied,
  1656. consistent with the handling of config file entries and runtime-set
  1657. options.
  1658. - SF bug #997050: Document, test, & check for non-string values in
  1659. ConfigParser. Moved the new string-only restriction added in
  1660. rev. 1.65 to the SafeConfigParser class, leaving existing
  1661. ConfigParser & RawConfigParser behavior alone, and documented the
  1662. conditions under which non-string values work.
  1663. Build
  1664. -----
  1665. - Building on darwin now includes /opt/local/include and /opt/local/lib for
  1666. building extension modules. This is so as to include software installed as
  1667. a DarwinPorts port <http://darwinports.opendarwin.org/>
  1668. - pyport.h now defines a Py_IS_NAN macro. It works as-is when the
  1669. platform C computes true for ``x != x`` if and only if X is a NaN.
  1670. Other platforms can override the default definition with a platform-
  1671. specific spelling in that platform's pyconfig.h. You can also override
  1672. pyport.h's default Py_IS_INFINITY definition now.
  1673. C API
  1674. -----
  1675. - SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
  1676. non-zero if PyEval_InitThreads() has been called.
  1677. - The undocumented and unused extern int ``_PyThread_Started`` was removed.
  1678. - The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
  1679. are two of the very few advertised as being safe to call without holding
  1680. the GIL. However, this wasn't true in a debug build, as bug 1041645
  1681. demonstrated. In a debug build, Python redirects the ``PyMem`` family
  1682. of calls to Python's small-object allocator, to get the benefit of
  1683. its extra debugging capabilities. But Python's small-object allocator
  1684. isn't threadsafe, relying on the GIL to avoid the expense of doing its
  1685. own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
  1686. call the platform ``malloc()`` directly now, regardless of build type.
  1687. - PyLong_AsUnsignedLong[Mask] now support int objects as well.
  1688. - SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
  1689. ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
  1690. decoding.
  1691. Tests
  1692. -----
  1693. - test__locale ported to unittest
  1694. Mac
  1695. ---
  1696. - ``plistlib`` now supports non-dict root objects. There is also a new
  1697. interface for reading and writing plist files: ``readPlist(pathOrFile)``
  1698. and ``writePlist(rootObject, pathOrFile)``
  1699. Tools/Demos
  1700. -----------
  1701. - The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
  1702. read the input files in universal-newline mode. This spares them
  1703. from consuming a great deal of time to deduce the useless result that,
  1704. e.g., a file with Windows line ends and a file with Linux line ends
  1705. have no lines in common.
  1706. What's New in Python 2.4 alpha 3?
  1707. =================================
  1708. *Release date: 02-SEP-2004*
  1709. Core and builtins
  1710. -----------------
  1711. - SF patch #1007189: ``from ... import ...`` statements now allow the name
  1712. list to be surrounded by parentheses.
  1713. - Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
  1714. multiplication was sped a little by optimizing the C code. Gradeschool
  1715. squaring was sped by about a factor of 2, by exploiting that about half
  1716. the digit products are duplicates in a square. Because exponentiation
  1717. uses squaring often, this also speeds long power. For example, the time
  1718. to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
  1719. to this much. The cutoff for Karatsuba multiplication was raised,
  1720. since gradeschool multiplication got quicker, and the cutoff was
  1721. aggressively small regardless. The exponentiation algorithm was switched
  1722. from right-to-left to left-to-right, which is more efficient for small
  1723. bases. In addition, if the exponent is large, the algorithm now does
  1724. 5 bits (instead of 1 bit) at a time. That cut the time to compute
  1725. 17**1000000 on my box in half again, down to about 4.5 seconds.
  1726. - OverflowWarning is no longer generated. PEP 237 scheduled this to
  1727. occur in Python 2.3, but since OverflowWarning was disabled by default,
  1728. nobody realized it was still being generated. On the chance that user
  1729. code is still using them, the Python builtin OverflowWarning, and
  1730. corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
  1731. - Py_InitializeEx has been added.
  1732. - Fix the order of application of decorators. The proper order is bottom-up;
  1733. the first decorator listed is the last one called.
  1734. - SF patch #1005778. Fix a seg fault if the list size changed while
  1735. calling list.index(). This could happen if a rich comparison function
  1736. modified the list.
  1737. - The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
  1738. functions is now writable.
  1739. - code_new (a.k.a new.code()) now checks its arguments sufficiently
  1740. carefully that passing them on to PyCode_New() won't trigger calls
  1741. to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
  1742. that the returned code object might be entirely insane.
  1743. - Subclasses of string can no longer be interned. The semantics of
  1744. interning were not clear here -- a subclass could be mutable, for
  1745. example -- and had bugs. Explicitly interning a subclass of string
  1746. via intern() will raise a TypeError. Internal operations that attempt
  1747. to intern a string subclass will have no effect.
  1748. - Bug 1003935: xrange() could report bogus OverflowErrors. Documented
  1749. what xrange() intends, and repaired tests accordingly.
  1750. Extension modules
  1751. -----------------
  1752. - difflib now supports HTML side-by-side diff.
  1753. - os.urandom has been added for systems that support sources of random
  1754. data.
  1755. - Patch 1012740: truncate() on a writeable cStringIO now resets the
  1756. position to the end of the stream. This is consistent with the original
  1757. StringIO module and avoids inadvertently resurrecting data that was
  1758. supposed to have been truncated away.
  1759. - Added socket.socketpair().
  1760. - Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
  1761. members to xml.parsers.expat.XMLParser object.
  1762. - The mpz, rotor, and xreadlines modules, all deprecated in earlier
  1763. versions of Python, have now been removed.
  1764. Library
  1765. -------
  1766. - Patch #934356: if a module defines __all__, believe that rather than using
  1767. heuristics for filtering out imported names.
  1768. - Patch #941486: added os.path.lexists(), which returns True for broken
  1769. symlinks, unlike os.path.exists().
  1770. - the random module now uses os.urandom() for seeding if it is available.
  1771. Added a new generator based on os.urandom().
  1772. - difflib and diff.py can now generate HTML.
  1773. - bdist_rpm now includes version and release in the BuildRoot, and
  1774. replaces - by ``_`` in version and release.
  1775. - distutils build/build_scripts now has an -e option to specify the
  1776. path to the Python interpreter for installed scripts.
  1777. - PEP 292 classes Template and SafeTemplate are added to the string module.
  1778. - tarfile now generates GNU tar files by default.
  1779. - HTTPResponse has now a getheaders method.
  1780. - Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
  1781. Percivall.
  1782. - logging.handlers.SMTPHandler.date_time has been removed;
  1783. the class now uses email.Utils.formatdate to generate the time stamp.
  1784. - A new function tkFont.nametofont was added to return an existing
  1785. font. The Font class constructor now has an additional exists argument
  1786. which, if True, requests to return/configure an existing font, rather
  1787. than creating a new one.
  1788. - Updated the decimal package's min() and max() methods to match the
  1789. latest revision of the General Decimal Arithmetic Specification.
  1790. Quiet NaNs are ignored and equal values are sorted based on sign
  1791. and exponent.
  1792. - The decimal package's Context.copy() method now returns deep copies.
  1793. - Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
  1794. attribute will be kept around for backwards compatibility and atexit
  1795. will just become the one preferred way to do it.
  1796. - patch #675551: Add get_history_item and replace_history_item functions
  1797. to the readline module.
  1798. - bug #989672: pdb.doc and the help messages for the help_d and help_u methods
  1799. of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
  1800. frame, u(p) to an older frame, not the other way around.
  1801. - bug #990669: os.path.realpath() will resolve symlinks before normalizing the
  1802. path, as normalizing the path may alter the meaning of the path if it
  1803. contains symlinks.
  1804. - bug #851123: shutil.copyfile will raise an exception when trying to copy a
  1805. file onto a link to itself. Thanks Gregory Ball.
  1806. - bug #570300: Fix inspect to resolve file locations using os.path.realpath()
  1807. so as to properly list all functions in a module when the module itself is
  1808. reached through a symlink. Thanks Johannes Gijsbers.
  1809. - doctest refactoring continued. See the docs for details. As part of
  1810. this effort, some old and little- (never?) used features are now
  1811. deprecated: the Tester class, the module is_private() function, and the
  1812. isprivate argument to testmod(). The Tester class supplied a feeble
  1813. "by hand" way to combine multiple doctests, if you knew exactly what
  1814. you were doing. The newer doctest features for unittest integration
  1815. already did a better job of that, are stronger now than ever, and the
  1816. new DocTestRunner class is a saner foundation if you want to do it by
  1817. hand. The "private name" filtering gimmick was a mistake from the
  1818. start, and testmod() changed long ago to ignore it by default. If
  1819. you want to filter out tests, the new DocTestFinder class can be used
  1820. to return a list of all doctests, and you can filter that list by
  1821. any computable criteria before passing it to a DocTestRunner instance.
  1822. - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
  1823. Tools/Demos
  1824. -----------
  1825. - IDLE's shortcut keys for windows are now case insensitive so that
  1826. Control-V works the same as Control-v.
  1827. - pygettext.py: Generate POT-Creation-Date header in ISO format.
  1828. Build
  1829. -----
  1830. - Backward incompatibility: longintrepr.h now triggers a compile-time
  1831. error if SHIFT (the number of bits in a Python long "digit") isn't
  1832. divisible by 5. This new requirement allows simple code for the new
  1833. 5-bits-at-a-time long_pow() implementation. If necessary, the
  1834. restriction could be removed (by complicating long_pow(), or by
  1835. falling back to the 1-bit-at-a-time algorithm), but there are no
  1836. plans to do so.
  1837. - bug #991962: When building with --disable-toolbox-glue on Darwin no
  1838. attempt to build Mac-specific modules occurs.
  1839. - The --with-tsc flag to configure to enable VM profiling with the
  1840. processor's timestamp counter now works on PPC platforms.
  1841. - patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
  1842. GCC's definition and avoid redefinition warnings.
  1843. - Detect pthreads support (provided by gnu pth pthread emulation) on
  1844. GNU/k*BSD systems.
  1845. - bug #1005737, #1007249: Fixed several build problems and warnings
  1846. found on old/legacy C compilers of HP-UX, IRIX and Tru64.
  1847. C API
  1848. -----
  1849. ..
  1850. Documentation
  1851. -------------
  1852. - patch #1005936, bug #1009373: fix index entries which contain
  1853. an underscore when viewed with Acrobat.
  1854. - bug #990669: os.path.normpath may alter the meaning of a path if
  1855. it contains symbolic links. This has been documented in a comment
  1856. since 1992, but is now in the library reference as well.
  1857. New platforms
  1858. -------------
  1859. - FreeBSD 6 is now supported.
  1860. Tests
  1861. -----
  1862. ..
  1863. Windows
  1864. -------
  1865. - Boosted the stack reservation for python.exe and pythonw.exe from
  1866. the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
  1867. bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
  1868. within the default sys.getrecursionlimit() default value of 1000 were
  1869. able to suffer undetected C stack overflows. The standard test program
  1870. test_compiler was one such program. If a Python process on Windows
  1871. "just vanishes" without a trace, and without an error message of any
  1872. kind, but with an exit code of 128, undetected stack overflow may be
  1873. the problem.
  1874. Mac
  1875. ---
  1876. ..
  1877. What's New in Python 2.4 alpha 2?
  1878. =================================
  1879. *Release date: 05-AUG-2004*
  1880. Core and builtins
  1881. -----------------
  1882. - Patch #980695: Implements efficient string concatenation for statements
  1883. of the form s=s+t and s+=t. This will vary across implementations.
  1884. Accordingly, the str.join() method is strongly preferred for performance
  1885. sensitive code.
  1886. - PEP-0318, Function Decorators have been added to the language. These are
  1887. implemented using the Java-style @decorator syntax, like so::
  1888. @staticmethod
  1889. def foo(bar):
  1890. (The PEP needs to be updated to reflect the current state)
  1891. - When importing a module M raises an exception, Python no longer leaves M
  1892. in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
  1893. succeed, picking up a module object from sys.modules reflecting as much
  1894. of the initialization of M as completed before the exception was raised.
  1895. Subsequent imports got no indication that M was in a partially-
  1896. initialized state, and the importers could get into arbitrarily bad
  1897. trouble as a result (the M they got was in an unintended state,
  1898. arbitrarily far removed from M's author's intent). Now subsequent
  1899. imports of M will continue raising exceptions (but if, for example, the
  1900. source code for M is edited between import attempts, then perhaps later
  1901. attempts will succeed, or raise a different exception).
  1902. This can break existing code, but in such cases the code was probably
  1903. working before by accident. In the Python source, the only case of
  1904. breakage discovered was in a test accidentally relying on a damaged
  1905. module remaining in sys.modules. Cases are also known where tests
  1906. deliberately provoking import errors remove damaged modules from
  1907. sys.modules themselves, and such tests will break now if they do an
  1908. unconditional del sys.modules[M].
  1909. - u'%s' % obj will now try obj.__unicode__() first and fallback to
  1910. obj.__str__() if no __unicode__ method can be found.
  1911. - Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
  1912. PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
  1913. - Allow string and unicode return types from .encode()/.decode()
  1914. methods on string and unicode objects. Added unicode.decode()
  1915. which was missing for no apparent reason.
  1916. - An attempt to fix the mess that is Python's behaviour with
  1917. signal handlers and threads, complicated by readline's behaviour.
  1918. It's quite possible that there are still bugs here.
  1919. - Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
  1920. types that support garbage collection.
  1921. - Compiler now treats None as a constant.
  1922. - The type of values returned by __int__, __float__, __long__,
  1923. __oct__, and __hex__ are now checked. Returning an invalid type
  1924. will cause a TypeError to be raised. This matches the behavior of
  1925. Jython.
  1926. - Implemented bind_textdomain_codeset() in locale module.
  1927. - Added a workaround for proper string operations in BSDs. str.split
  1928. and str.is* methods can now work correctly with UTF-8 locales.
  1929. - Bug #989185: unicode.iswide() and unicode.width() is dropped and
  1930. the East Asian Width support is moved to unicodedata extension
  1931. module.
  1932. - Patch #941229: The source code encoding in interactive mode
  1933. now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
  1934. allows for non-latin-1 users to write unicode strings directly.
  1935. Extension modules
  1936. -----------------
  1937. - cpickle now supports the same keyword arguments as pickle.
  1938. Library
  1939. -------
  1940. - Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
  1941. TIS-620
  1942. - Thanks to Edward Loper, doctest has been massively refactored, and
  1943. many new features were added. Full docs will appear later. For now
  1944. the doctest module comments and new test cases give good coverage.
  1945. The refactoring provides many hook points for customizing behavior
  1946. (such as how to report errors, and how to compare expected to actual
  1947. output). New features include a <BLANKLINE> marker for expected
  1948. output containing blank lines, options to produce unified or context
  1949. diffs when actual output doesn't match expectations, an option to
  1950. normalize whitespace before comparing, and an option to use an
  1951. ellipsis to signify "don't care" regions of output.
  1952. - Tkinter now supports the wish -sync and -use options.
  1953. - The following methods in time support passing of None: ctime(), gmtime(),
  1954. and localtime(). If None is provided, the current time is used (the
  1955. same as when the argument is omitted).
  1956. [SF bug 658254, patch 663482]
  1957. - nntplib does now allow to ignore a .netrc file.
  1958. - urllib2 now recognizes Basic authentication even if other authentication
  1959. schemes are offered.
  1960. - Bug #1001053. wave.open() now accepts unicode filenames.
  1961. - gzip.GzipFile has a new fileno() method, to retrieve the handle of the
  1962. underlying file object (provided it has a fileno() method). This is
  1963. needed if you want to use os.fsync() on a GzipFile.
  1964. - imaplib has two new methods: deleteacl and myrights.
  1965. - nntplib has two new methods: description and descriptions. They
  1966. use a more RFC-compliant way of getting a newsgroup description.
  1967. - Bug #993394. Fix a possible red herring of KeyError in 'threading' being
  1968. raised during interpreter shutdown from a registered function with atexit
  1969. when dummy_threading is being used.
  1970. - Bug #857297/Patch #916874. Fix an error when extracting a hard link
  1971. from a tarfile.
  1972. - Patch #846659. Fix an error in tarfile.py when using
  1973. GNU longname/longlink creation.
  1974. - The obsolete FCNTL.py has been deleted. The builtin fcntl module
  1975. has been available (on platforms that support fcntl) since Python
  1976. 1.5a3, and all FCNTL.py did is export fcntl's names, after generating
  1977. a deprecation warning telling you to use fcntl directly.
  1978. - Several new unicode codecs are added: big5hkscs, euc_jis_2004,
  1979. iso2022_jp_2004, shift_jis_2004.
  1980. - Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
  1981. implementations, exploiting Conditions (which didn't exist at the time
  1982. Queue was introduced). A minor semantic change is that the Full and
  1983. Empty exceptions raised by non-blocking calls now occur only if the
  1984. queue truly was full or empty at the instant the queue was checked (of
  1985. course the Queue may no longer be full or empty by the time a calling
  1986. thread sees those exceptions, though). Before, the exceptions could
  1987. also be raised if it was "merely inconvenient" for the implementation
  1988. to determine the true state of the Queue (because the Queue was locked
  1989. by some other method in progress).
  1990. - Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
  1991. case of comparing two empty lists. This affected both context_diff() and
  1992. unified_diff(),
  1993. - Bug #980938: smtplib now prints debug output to sys.stderr.
  1994. - Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
  1995. returning the last point in the path that was not part of any loop. Thanks
  1996. AM Kuchling.
  1997. - Bug #980327: ntpath not handles compressing erroneous slashes between the
  1998. drive letter and the rest of the path. Also clearly handles UNC addresses now
  1999. as well. Thanks Paul Moore.
  2000. - bug #679953: zipfile.py should now work for files over 2 GB. The packed data
  2001. for file sizes (compressed and uncompressed) was being stored as signed
  2002. instead of unsigned.
  2003. - decimal.py now only uses signals in the IBM spec. The other conditions are
  2004. no longer part of the public API.
  2005. - codecs module now has two new generic APIs: encode() and decode()
  2006. which don't restrict the return types (unlike the unicode and
  2007. string methods of the same name).
  2008. - Non-blocking SSL sockets work again; they were broken in Python 2.3.
  2009. SF patch 945642.
  2010. - doctest unittest integration improvements:
  2011. o Improved the unitest test output for doctest-based unit tests
  2012. o Can now pass setUp and tearDown functions when creating
  2013. DocTestSuites.
  2014. - The threading module has a new class, local, for creating objects
  2015. that provide thread-local data.
  2016. - Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
  2017. no longer returns spurious empty fields.
  2018. - Implemented bind_textdomain_codeset() in gettext module.
  2019. - Introduced in gettext module the l*gettext() family of functions,
  2020. which return translation strings encoded in the preferred encoding,
  2021. as informed by locale module's getpreferredencoding().
  2022. - optparse module (and tests) upgraded to Optik 1.5a1. Changes:
  2023. - Add expansion of default values in help text: the string
  2024. "%default" in an option's help string is expanded to str() of
  2025. that option's default value, or "none" if no default value.
  2026. - Bug #955889: option default values that happen to be strings are
  2027. now processed in the same way as values from the command line; this
  2028. allows generation of nicer help when using custom types. Can
  2029. be disabled with parser.set_process_default_values(False).
  2030. - Bug #960515: don't crash when generating help for callback
  2031. options that specify 'type', but not 'dest' or 'metavar'.
  2032. - Feature #815264: change the default help format for short options
  2033. that take an argument from e.g. "-oARG" to "-o ARG"; add
  2034. set_short_opt_delimiter() and set_long_opt_delimiter() methods to
  2035. HelpFormatter to allow (slight) customization of the formatting.
  2036. - Patch #736940: internationalize Optik: all built-in user-
  2037. targeted literal strings are passed through gettext.gettext(). (If
  2038. you want translations (.po files), they're not included with Python
  2039. -- you'll find them in the Optik source distribution from
  2040. http://optik.sourceforge.net/ .)
  2041. - Bug #878453: respect $COLUMNS environment variable for
  2042. wrapping help output.
  2043. - Feature #988122: expand "%prog" in the 'description' passed
  2044. to OptionParser, just like in the 'usage' and 'version' strings.
  2045. (This is *not* done in the 'description' passed to OptionGroup.)
  2046. C API
  2047. -----
  2048. - PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
  2049. error occurs while loading the module, these now delete the module's
  2050. entry from sys.modules. All ways of loading modules eventually call
  2051. one of these, so this is an error-case change in semantics for all
  2052. ways of loading modules. In rare cases, a module loader may wish
  2053. to keep a module object in sys.modules despite that the module's
  2054. code cannot be executed. In such cases, the module loader must
  2055. arrange to reinsert the name and module object in sys.modules.
  2056. PyImport_ReloadModule() has been changed to reinsert the original
  2057. module object into sys.modules if the module reload fails, so that
  2058. its visible semantics have not changed.
  2059. - A large pile of datetime field-extraction macros is now documented,
  2060. thanks to Anthony Tuininga (patch #986010).
  2061. Documentation
  2062. -------------
  2063. - Improved the tutorial on creating types in C.
  2064. - point out the importance of reassigning data members before
  2065. assigning their values
  2066. - correct my misconception about return values from visitprocs. Sigh.
  2067. - mention the labor saving Py_VISIT and Py_CLEAR macros.
  2068. - Major rewrite of the math module docs, to address common confusions.
  2069. Tests
  2070. -----
  2071. - The test data files for the decimal test suite are now installed on
  2072. platforms that use the Makefile.
  2073. - SF patch 995225: The test file testtar.tar accidentally contained
  2074. CVS keywords (like $Id: HISTORY 73770 2009-07-02 15:37:21Z jesus.cea $), which could cause spurious failures in
  2075. test_tarfile.py depending on how the test file was checked out.
  2076. What's New in Python 2.4 alpha 1?
  2077. =================================
  2078. *Release date: 08-JUL-2004*
  2079. Core and builtins
  2080. -----------------
  2081. - weakref.ref is now the type object also known as
  2082. weakref.ReferenceType; it can be subclassed like any other new-style
  2083. class. There's less per-entry overhead in WeakValueDictionary
  2084. objects now (one object instead of three).
  2085. - Bug #951851: Python crashed when reading import table of certain
  2086. Windows DLLs.
  2087. - Bug #215126. The locals argument to eval(), execfile(), and exec now
  2088. accept any mapping type.
  2089. - marshal now shares interned strings. This change introduces
  2090. a new .pyc magic.
  2091. - Bug #966623. classes created with type() in an exec(, {}) don't
  2092. have a __module__, but code in typeobject assumed it would always
  2093. be there.
  2094. - Python no longer relies on the LC_NUMERIC locale setting to be
  2095. the "C" locale; as a result, it no longer tries to prevent changing
  2096. the LC_NUMERIC category.
  2097. - Bug #952807: Unpickling pickled instances of subclasses of
  2098. datetime.date, datetime.datetime and datetime.time could yield insane
  2099. objects. Thanks to Jiwon Seo for a fix.
  2100. - Bug #845802: Python crashes when __init__.py is a directory.
  2101. - Unicode objects received two new methods: iswide() and width().
  2102. These query East Asian width information, as specified in Unicode
  2103. TR11.
  2104. - Improved the tuple hashing algorithm to give fewer collisions in
  2105. common cases. Fixes bug #942952.
  2106. - Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
  2107. - Enabled the profiling of C extension functions (and builtins) - check
  2108. new documentation and modified profile and bdb modules for more details
  2109. - Set file.name to the object passed to open (instead of a new string)
  2110. - Moved tracebackobject into traceback.h and renamed to PyTracebackObject
  2111. - Optimized the byte coding for multiple assignments like "a,b=b,a" and
  2112. "a,b,c=1,2,3". Improves their speed by 25% to 30%.
  2113. - Limit the nested depth of a tuple for the second argument to isinstance()
  2114. and issubclass() to the recursion limit of the interpreter.
  2115. Fixes bug #858016 .
  2116. - Optimized dict iterators, creating separate types for each
  2117. and having them reveal their length. Also optimized the
  2118. methods: keys(), values(), and items().
  2119. - Implemented a newcode opcode, LIST_APPEND, that simplifies
  2120. the generated bytecode for list comprehensions and further
  2121. improves their performance (about 35%).
  2122. - Implemented rich comparisons for floats, which seems to make
  2123. comparisons involving NaNs somewhat less surprising when the
  2124. underlying C compiler actually implements C99 semantics.
  2125. - Optimized list.extend() to save memory and no longer create
  2126. intermediate sequences. Also, extend() now pre-allocates the
  2127. needed memory whenever the length of the iterable is known in
  2128. advance -- this halves the time to extend the list.
  2129. - Optimized list resize operations to make fewer calls to the system
  2130. realloc(). Significantly speeds up list appends, list pops,
  2131. list comprehensions, and the list constructor (when the input iterable
  2132. length is not known).
  2133. - Changed the internal list over-allocation scheme. For larger lists,
  2134. overallocation ranged between 3% and 25%. Now, it is a constant 12%.
  2135. For smaller lists (n<8), overallocation was upto eight elements. Now,
  2136. the overallocation is no more than three elements -- this improves space
  2137. utilization for applications that have large numbers of small lists.
  2138. - Most list bodies now get re-used rather than freed. Speeds up list
  2139. instantiation and deletion by saving calls to malloc() and free().
  2140. - The dict.update() method now accepts all the same argument forms
  2141. as the dict() constructor. This now includes item lists and/or
  2142. keyword arguments.
  2143. - Support for arbitrary objects supporting the read-only buffer
  2144. interface as the co_code field of code objects (something that was
  2145. only possible to create from C code) has been removed.
  2146. - Made omitted callback and None equivalent for weakref.ref() and
  2147. weakref.proxy(); the None case wasn't handled correctly in all
  2148. cases.
  2149. - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
  2150. assumed that initial existing entries in an object's weakref list
  2151. would not be removed while allocating a new weakref object. Since
  2152. GC could be invoked at that time, however, that assumption was
  2153. invalid. In a truly obscure case of GC being triggered during
  2154. creation for a new weakref object for an referent which already
  2155. has a weakref without a callback which is only referenced from
  2156. cyclic trash, a memory error can occur. This consistently created a
  2157. segfault in a debug build, but provided less predictable behavior in
  2158. a release build.
  2159. - input() builtin function now respects compiler flags such as
  2160. __future__ statements. SF patch 876178.
  2161. - Removed PendingDeprecationWarning from apply(). apply() remains
  2162. deprecated, but the nuisance warning will not be issued.
  2163. - At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
  2164. collection twice, both before and after tearing down modules. The
  2165. call after tearing down modules has been disabled, because too much
  2166. of Python has been torn down then for __del__ methods and weakref
  2167. callbacks to execute sanely. The most common symptom was a sequence
  2168. of uninformative messages on stderr when Python shut down, produced
  2169. by threads trying to raise exceptions, but unable to report the nature
  2170. of their problems because too much of the sys module had already been
  2171. destroyed.
  2172. - Removed FutureWarnings related to hex/oct literals and conversions
  2173. and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
  2174. This addresses most of the remaining semantic changes promised by
  2175. PEP 237, except for repr() of a long, which still shows the trailing
  2176. 'L'. The PEP appears to promise warnings for operations that
  2177. changed semantics compared to Python 2.3, but this is not
  2178. implemented; we've suffered through enough warnings related to
  2179. hex/oct literals and I think it's best to be silent now.
  2180. - For str and unicode objects, the ljust(), center(), and rjust()
  2181. methods now accept an optional argument specifying a fill
  2182. character other than a space.
  2183. - When method objects have an attribute that can be satisfied either
  2184. by the function object or by the method object, the function
  2185. object's attribute usually wins. Christian Tismer pointed out that
  2186. that this is really a mistake, because this only happens for special
  2187. methods (like __reduce__) where the method object's version is
  2188. really more appropriate than the function's attribute. So from now
  2189. on, all method attributes will have precedence over function
  2190. attributes with the same name.
  2191. - Critical bugfix, for SF bug 839548: if a weakref with a callback,
  2192. its callback, and its weakly referenced object, all became part of
  2193. cyclic garbage during a single run of garbage collection, the order
  2194. in which they were torn down was unpredictable. It was possible for
  2195. the callback to see partially-torn-down objects, leading to immediate
  2196. segfaults, or, if the callback resurrected garbage objects, to
  2197. resurrect insane objects that caused segfaults (or other surprises)
  2198. later. In one sense this wasn't surprising, because Python's cyclic gc
  2199. had no knowledge of Python's weakref objects. It does now. When
  2200. weakrefs with callbacks become part of cyclic garbage now, those
  2201. weakrefs are cleared first. The callbacks don't trigger then,
  2202. preventing the problems. If you need callbacks to trigger, then just
  2203. as when cyclic gc is not involved, you need to write your code so
  2204. that weakref objects outlive the objects they weakly reference.
  2205. - Critical bugfix, for SF bug 840829: if cyclic garbage collection
  2206. happened to occur during a weakref callback for a new-style class
  2207. instance, subtle memory corruption was the result (in a release build;
  2208. in a debug build, a segfault occurred reliably very soon after).
  2209. This has been repaired.
  2210. - Compiler flags set in PYTHONSTARTUP are now active in __main__.
  2211. - Added two builtin types, set() and frozenset().
  2212. - Added a reversed() builtin function that returns a reverse iterator
  2213. over a sequence.
  2214. - Added a sorted() builtin function that returns a new sorted list
  2215. from any iterable.
  2216. - CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
  2217. - list.sort() now supports three keyword arguments: cmp, key, and reverse.
  2218. The key argument can be a function of one argument that extracts a
  2219. comparison key from the original record: mylist.sort(key=str.lower).
  2220. The reverse argument is a boolean value and if True will change the
  2221. sort order as if the comparison arguments were reversed. In addition,
  2222. the documentation has been amended to provide a guarantee that all sorts
  2223. starting with Py2.3 are guaranteed to be stable (the relative order of
  2224. records with equal keys is unchanged).
  2225. - Added test whether wchar_t is signed or not. A signed wchar_t is not
  2226. usable as internal unicode type base for Py_UNICODE since the
  2227. unicode implementation assumes an unsigned type.
  2228. - Fixed a bug in the cache of length-one Unicode strings that could
  2229. lead to a seg fault. The specific problem occurred when an earlier,
  2230. non-fatal error left an uninitialized Unicode object in the
  2231. freelist.
  2232. - The % formatting operator now supports '%F' which is equivalent to
  2233. '%f'. This has always been documented but never implemented.
  2234. - complex(obj) could leak a little memory if obj wasn't a string or
  2235. number.
  2236. - zip() with no arguments now returns an empty list instead of raising
  2237. a TypeError exception.
  2238. - obj.__contains__() now returns True/False instead of 1/0. SF patch
  2239. 820195.
  2240. - Python no longer tries to be smart about recursive comparisons.
  2241. When comparing containers with cyclic references to themselves it
  2242. will now just hit the recursion limit. See SF patch 825639.
  2243. - str and unicode builtin types now have an rsplit() method that is
  2244. same as split() except that it scans the string from the end
  2245. working towards the beginning. See SF feature request 801847.
  2246. - Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
  2247. to clear the error when attempts to get the __getstate__ attribute
  2248. fail caused intermittent errors and odd behavior.
  2249. - buffer objects based on other objects no longer cache a pointer to
  2250. the data and the data length. Instead, the appropriate tp_as_buffer
  2251. method is called as necessary.
  2252. - fixed: if a file is opened with an explicit buffer size >= 1, repeated
  2253. close() calls would attempt to free() the buffer already free()ed on
  2254. the first call.
  2255. Extension modules
  2256. -----------------
  2257. - Added socket.getservbyport(), and make the second argument in
  2258. getservbyname() and getservbyport() optional.
  2259. - time module code that deals with input POSIX timestamps will now raise
  2260. ValueError if more than a second is lost in precision when the
  2261. timestamp is cast to the platform C time_t type. There's no chance
  2262. that the platform will do anything sensible with the result in such
  2263. cases. This includes ctime(), localtime() and gmtime(). Assorted
  2264. fromtimestamp() and utcfromtimestamp() methods in the datetime module
  2265. were also protected. Closes bugs #919012 and 975996.
  2266. - fcntl.ioctl now warns if the mutate flag is not specified.
  2267. - nt now properly allows to refer to UNC roots, e.g. in nt.stat().
  2268. - the weakref module now supports additional objects: array.array,
  2269. sre.pattern_objects, file objects, and sockets.
  2270. - operator.isMappingType() and operator.isSequenceType() now give
  2271. fewer false positives.
  2272. - socket.sslerror is now a subclass of socket.error . Also added
  2273. socket.error to the socket module's C API.
  2274. - Bug #920575: A problem where the _locale module segfaults on
  2275. nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
  2276. - array objects now support the copy module. Also, their resizing
  2277. scheme has been updated to match that used for list objects. This improves
  2278. the performance (speed and memory usage) of append() operations.
  2279. Also, array.array() and array.extend() now accept any iterable argument
  2280. for repeated appends without needing to create another temporary array.
  2281. - cStringIO.writelines() now accepts any iterable argument and writes
  2282. the lines one at a time rather than joining them and writing once.
  2283. Made a parallel change to StringIO.writelines(). Saves memory and
  2284. makes suitable for use with generator expressions.
  2285. - time.strftime() now checks that the values in its time tuple argument
  2286. are within the proper boundaries to prevent possible crashes from the
  2287. platform's C library implementation of strftime(). Can possibly
  2288. break code that uses values outside the range that didn't cause
  2289. problems previously (such as sitting day of year to 0). Fixes bug
  2290. #897625.
  2291. - The socket module now supports Bluetooth sockets, if the
  2292. system has <bluetooth/bluetooth.h>
  2293. - Added a collections module containing a new datatype, deque(),
  2294. offering high-performance, thread-safe, memory friendly appends
  2295. and pops on either side of the deque.
  2296. - Several modules now take advantage of collections.deque() for
  2297. improved performance: Queue, mutex, shlex, threading, and pydoc.
  2298. - The operator module has two new functions, attrgetter() and
  2299. itemgetter() which are useful for creating fast data extractor
  2300. functions for map(), list.sort(), itertools.groupby(), and
  2301. other functions that expect a function argument.
  2302. - socket.SHUT_{RD,WR,RDWR} was added.
  2303. - os.getsid was added.
  2304. - The pwd module incorrectly advertised its struct type as
  2305. struct_pwent; this has been renamed to struct_passwd. (The old name
  2306. is still supported for backwards compatibility.)
  2307. - The xml.parsers.expat module now provides Expat 1.95.7.
  2308. - socket.IPPROTO_IPV6 was added.
  2309. - readline.clear_history was added.
  2310. - select.select() now accepts sequences for its first three arguments.
  2311. - cStringIO now supports the f.closed attribute.
  2312. - The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
  2313. - curses module now supports use_default_colors(). [patch #739124]
  2314. - Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
  2315. - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
  2316. - Implemented non-recursive SRE matching scheme (#757624).
  2317. - Implemented (?(id/name)yes|no) support in SRE (#572936).
  2318. - random.seed() with no arguments or None uses time.time() as a default
  2319. seed. Modified to match Py2.2 behavior and use fractional seconds so
  2320. that successive runs are more likely to produce different sequences.
  2321. - random.Random has a new method, getrandbits(k), which returns an int
  2322. with k random bits. This method is now an optional part of the API
  2323. for user defined generators. Any generator that defines genrandbits()
  2324. can now use randrange() for ranges with a length >= 2**53. Formerly,
  2325. randrange would return only even numbers for ranges that large (see
  2326. SF bug #812202). Generators that do not define genrandbits() now
  2327. issue a warning when randrange() is called with a range that large.
  2328. - itertools has a new function, groupby() for aggregating iterables
  2329. into groups sharing the same key (as determined by a key function).
  2330. It offers some of functionality of SQL's groupby keyword and of
  2331. the Unix uniq filter.
  2332. - itertools now has a new tee() function which produces two independent
  2333. iterators from a single iterable.
  2334. - itertools.izip() with no arguments now returns an empty iterator instead
  2335. of raising a TypeError exception.
  2336. - Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
  2337. as parameter.
  2338. Library
  2339. -------
  2340. - Added a new module: cProfile, a C profiler with the same interface as the
  2341. profile module. cProfile avoids some of the drawbacks of the hotshot
  2342. profiler and provides a bit more information than the other two profilers.
  2343. Based on "lsprof" (patch #1212837).
  2344. - Bug #1266283: The new function "lexists" is now in os.path.__all__.
  2345. - Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
  2346. the documented behavior: the function passed to the onerror()
  2347. handler can now also be os.listdir.
  2348. - Bug #754449: threading.Thread objects no longer mask exceptions raised during
  2349. interpreter shutdown with another exception from attempting to handle the
  2350. original exception.
  2351. - Added decimal.py per PEP 327.
  2352. - Bug #981299: rsync is now a recognized protocol in urlparse that uses a
  2353. "netloc" portion of a URL.
  2354. - Bug #919012: shutil.move() will not try to move a directory into itself.
  2355. Thanks Johannes Gijsbers.
  2356. - Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
  2357. - Bug #823209: cmath.log() now takes an optional base argument so that its
  2358. API matches math.log().
  2359. - Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
  2360. that generate a -debuginfo.rpm
  2361. - os.path.devnull has been added for all supported platforms.
  2362. - Fixed #877165: distutils now picks the right C++ compiler command
  2363. on cygwin and mingw32.
  2364. - urllib.urlopen().readline() now handles HTTP/0.9 correctly.
  2365. - refactored site.py into functions. Also wrote regression tests for the
  2366. module.
  2367. - The distutils install command now supports the --home option and
  2368. installation scheme for all platforms.
  2369. - asyncore.loop now has a repeat count parameter that defaults to
  2370. looping forever.
  2371. - The distutils sdist command now ignores all .svn directories, in
  2372. addition to CVS and RCS directories. .svn directories hold
  2373. administrative files for the Subversion source control system.
  2374. - Added a new module: cookielib. Automatic cookie handling for HTTP
  2375. clients. Also, support for cookielib has been added to urllib2, so
  2376. urllib2.urlopen() can transparently handle cookies.
  2377. - stringprep.py now uses built-in set() instead of sets.Set().
  2378. - Bug #876278: Unbounded recursion in modulefinder
  2379. - Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
  2380. Applications relying on the wrong order need to be corrected.
  2381. - Bug #926075: Fixed a bug that returns a wrong pattern object
  2382. for a string or unicode object in sre.compile() when a different
  2383. type pattern with the same value exists.
  2384. - Added countcallers arg to trace.Trace class (--trackcalls command line arg
  2385. when run from the command prompt).
  2386. - Fixed a caching bug in platform.platform() where the argument of 'terse' was
  2387. not taken into consideration when caching value.
  2388. - Added two new command-line arguments for profile (output file and
  2389. default sort).
  2390. - Added global runctx function to profile module
  2391. - Add hlist missing entryconfigure and entrycget methods.
  2392. - The ptcp154 codec was added for Kazakh character set support.
  2393. - Support non-anonymous ftp URLs in urllib2.
  2394. - The encodings package will now apply codec name aliases
  2395. first before starting to try the import of the codec module.
  2396. This simplifies overriding built-in codecs with external
  2397. packages, e.g. the included CJK codecs with the JapaneseCodecs
  2398. package, by adjusting the aliases dictionary in encodings.aliases
  2399. accordingly.
  2400. - base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
  2401. decoding standards.
  2402. - urllib2 now supports processors. A processor is a handler that
  2403. implements an xxx_request or xxx_response method. These methods are
  2404. called for all requests.
  2405. - distutils compilers now compile source files in the same order as
  2406. they are passed to the compiler.
  2407. - pprint.pprint() and pprint.pformat() now have additional parameters
  2408. indent, width and depth.
  2409. - Patch #750542: pprint now will pretty print subclasses of list, tuple
  2410. and dict too, as long as they don't overwrite __repr__().
  2411. - Bug #848614: distutils' msvccompiler fails to find the MSVC6
  2412. compiler because of incomplete registry entries.
  2413. - httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
  2414. - Patch #841977: modulefinder didn't find extension modules in packages
  2415. - imaplib.IMAP4.thread was added.
  2416. - Plugged a minor hole in tempfile.mktemp() due to the use of
  2417. os.path.exists(), switched to using os.lstat() directly if possible.
  2418. - bisect.py and heapq.py now have underlying C implementations
  2419. for better performance.
  2420. - heapq.py has two new functions, nsmallest() and nlargest().
  2421. - traceback.format_exc has been added (similar to print_exc but it returns
  2422. a string).
  2423. - xmlrpclib.MultiCall has been added.
  2424. - poplib.POP3_SSL has been added.
  2425. - tmpfile.mkstemp now returns an absolute path even if dir is relative.
  2426. - urlparse is RFC 2396 compliant.
  2427. - The fieldnames argument to the csv module's DictReader constructor is now
  2428. optional. If omitted, the first row of the file will be used as the
  2429. list of fieldnames.
  2430. - encodings.bz2_codec was added for access to bz2 compression
  2431. using "a long string".encode('bz2')
  2432. - Various improvements to unittest.py, realigned with PyUnit CVS.
  2433. - dircache now passes exceptions to the caller, instead of returning
  2434. empty lists.
  2435. - The bsddb module and dbhash module now support the iterator and
  2436. mapping protocols which make them more substitutable for dictionaries
  2437. and shelves.
  2438. - The csv module's DictReader and DictWriter classes now accept keyword
  2439. arguments. This was an omission in the initial implementation.
  2440. - The email package handles some RFC 2231 parameters with missing
  2441. CHARSET fields better. It also includes a patch to parameter
  2442. parsing when semicolons appear inside quotes.
  2443. - sets.py now runs under Py2.2. In addition, the argument restrictions
  2444. for most set methods (but not the operators) have been relaxed to
  2445. allow any iterable.
  2446. - _strptime.py now has a behind-the-scenes caching mechanism for the most
  2447. recent TimeRE instance used along with the last five unique directive
  2448. patterns. The overall module was also made more thread-safe.
  2449. - random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
  2450. and removed in Py2.4.
  2451. - Bug #823328: urllib2.py's HTTP Digest Auth support works again.
  2452. - Patch #873597: CJK codecs are imported into rank of default codecs.
  2453. Tools/Demos
  2454. -----------
  2455. - A hotshotmain script was added to the Tools/scripts directory that
  2456. makes it easy to run a script under control of the hotshot profiler.
  2457. - The db2pickle and pickle2db scripts can now dump/load gdbm files.
  2458. - The file order on the command line of the pickle2db script was reversed.
  2459. It is now [ picklefile ] dbfile. This provides better symmetry with
  2460. db2pickle. The file arguments to both scripts are now source followed by
  2461. destination in situations where both files are given.
  2462. - The pydoc script will display a link to the module documentation for
  2463. modules determined to be part of the core distribution. The documentation
  2464. base directory defaults to http://www.python.org/doc/current/lib/ but can
  2465. be changed by setting the PYTHONDOCS environment variable.
  2466. - texcheck.py now detects double word errors.
  2467. - md5sum.py mistakenly opened input files in text mode by default, a
  2468. silent and dangerous change from previous releases. It once again
  2469. opens input files in binary mode by default. The -t and -b flags
  2470. remain for compatibility with the 2.3 release, but -b is the default
  2471. now.
  2472. - py-electric-colon now works when pending-delete/delete-selection mode is
  2473. in effect
  2474. - py-help-at-point is no longer bound to the F1 key - it's still bound to
  2475. C-c C-h
  2476. - Pynche was fixed to not crash when there is no ~/.pynche file and no
  2477. -d option was given.
  2478. Build
  2479. -----
  2480. - Bug #978645: Modules/getpath.c now builds properly in --disable-framework
  2481. build under OS X.
  2482. - Profiling using gprof is now available if Python is configured with
  2483. --enable-profiling.
  2484. - Profiling the VM using the Pentium TSC is now possible if Python
  2485. is configured --with-tsc.
  2486. - In order to find libraries, setup.py now also looks in /lib64, for use
  2487. on AMD64.
  2488. - Bug #934635: Fixed a bug where the configure script couldn't detect
  2489. getaddrinfo() properly if the KAME stack had SCTP support.
  2490. - Support for missing ANSI C header files (limits.h, stddef.h, etc) was
  2491. removed.
  2492. - Systems requiring the D4, D6 or D7 variants of pthreads are no longer
  2493. supported (see PEP 11).
  2494. - Universal newline support can no longer be disabled (see PEP 11).
  2495. - Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
  2496. - Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
  2497. (see PEP 11).
  2498. - Tests for sizeof(char) were removed since ANSI C mandates that
  2499. sizeof(char) must be 1.
  2500. C API
  2501. -----
  2502. - Thanks to Anthony Tuininga, the datetime module now supplies a C API
  2503. containing type-check macros and constructors. See new docs in the
  2504. Python/C API Reference Manual for details.
  2505. - Private function _PyTime_DoubleToTimet added, to convert a Python
  2506. timestamp (C double) to platform time_t with some out-of-bounds
  2507. checking. Declared in new header file timefuncs.h. It would be
  2508. good to expose some other internal timemodule.c functions there.
  2509. - New public functions PyEval_EvaluateFrame and PyGen_New to expose
  2510. generator objects.
  2511. - New public functions Py_IncRef() and Py_DecRef(), exposing the
  2512. functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
  2513. runtime dynamic embedding of Python. See patch #938302, by Bob
  2514. Ippolito.
  2515. - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
  2516. underlying array of PyObject pointers. Useful for high speed looping.
  2517. - Created a new method flag, METH_COEXIST, which causes a method to be loaded
  2518. even if already defined by a slot wrapper. This allows a __contains__
  2519. method, for example, to co-exist with a defined sq_contains slot. This
  2520. is helpful because the PyCFunction can take advantage of optimized calls
  2521. whenever METH_O or METH_NOARGS flags are defined.
  2522. - Added a new function, PyDict_Contains(d, k) which is like
  2523. PySequence_Contains() but is specific to dictionaries and executes
  2524. about 10% faster.
  2525. - Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
  2526. Each return the singleton they mention after Py_INCREF()ing them.
  2527. - Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
  2528. variable length argument list of Python objects without having to invoke
  2529. the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
  2530. is equivalent to Py_BuildValue("(OOO)", a, b, c).
  2531. Windows
  2532. -------
  2533. - The _winreg module could segfault when reading very large registry
  2534. values, due to unchecked alloca() calls (SF bug 851056). The fix is
  2535. uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
  2536. as appropriate, followed by a size check.
  2537. - file.truncate() could misbehave if the file was open for update
  2538. (modes r+, rb+, w+, wb+), and the most recent file operation before
  2539. the truncate() call was an input operation. SF bug 801631.
  2540. What's New in Python 2.3 final?
  2541. ===============================
  2542. *Release date: 29-Jul-2003*
  2543. IDLE
  2544. ----
  2545. - Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
  2546. This was unique to Windows, and was fixed by adding an -n switch to
  2547. the command the Windows installer creates to execute "Edit with IDLE"
  2548. context-menu actions.
  2549. - IDLE displays a new message upon startup: some "personal firewall"
  2550. kinds of programs (for example, ZoneAlarm) open a dialog of their
  2551. own when any program opens a socket. IDLE does use sockets, talking
  2552. on the computer's internal loopback interface. This connection is not
  2553. visible on any external interface and no data is sent to or received
  2554. from the Internet. So, if you get such a dialog when opening IDLE,
  2555. asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
  2556. and rest assured no communication external to your machine is taking
  2557. place. If you don't allow it, IDLE won't be able to start.
  2558. What's New in Python 2.3 release candidate 2?
  2559. =============================================
  2560. *Release date: 24-Jul-2003*
  2561. Core and builtins
  2562. -----------------
  2563. - It is now possible to import from zipfiles containing additional
  2564. data bytes before the zip compatible archive. Zipfiles containing a
  2565. comment at the end are still unsupported.
  2566. Extension modules
  2567. -----------------
  2568. - A longstanding bug in the parser module's initialization could cause
  2569. fatal internal refcount confusion when the module got initialized more
  2570. than once. This has been fixed.
  2571. - Fixed memory leak in pyexpat; using the parser's ParseFile() method
  2572. with open files that aren't instances of the standard file type
  2573. caused an instance of the bound .read() method to be leaked on every
  2574. call.
  2575. - Fixed some leaks in the locale module.
  2576. Library
  2577. -------
  2578. - Lib/encodings/rot_13.py when used as a script, now more properly
  2579. uses the first Python interpreter on your path.
  2580. - Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
  2581. fix a locale related bug in the test suite. Although another patch
  2582. was needed to actually fix the problem, the cache code was not
  2583. restored.
  2584. IDLE
  2585. ----
  2586. - Calltips patches.
  2587. Build
  2588. -----
  2589. - For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
  2590. on Panther (OSX 10.3).
  2591. C API
  2592. -----
  2593. Windows
  2594. -------
  2595. - The tempfile module could do insane imports on Windows if PYTHONCASEOK
  2596. was set, making temp file creation impossible. Repaired.
  2597. - Add a patch to workaround pthread_sigmask() bugs in Cygwin.
  2598. Mac
  2599. ---
  2600. - Various fixes to pimp.
  2601. - Scripts runs with pythonw no longer had full window manager access.
  2602. - Don't force boot-disk-only install, for reasons unknown it causes
  2603. more problems than it solves.
  2604. What's New in Python 2.3 release candidate 1?
  2605. =============================================
  2606. *Release date: 18-Jul-2003*
  2607. Core and builtins
  2608. -----------------
  2609. - The new function sys.getcheckinterval() returns the last value set
  2610. by sys.setcheckinterval().
  2611. - Several bugs in the symbol table phase of the compiler have been
  2612. fixed. Errors could be lost and compilation could fail without
  2613. reporting an error. SF patch 763201.
  2614. - The interpreter is now more robust about importing the warnings
  2615. module. In an executable generated by freeze or similar programs,
  2616. earlier versions of 2.3 would fail if the warnings module could
  2617. not be found on the file system. Fixes SF bug 771097.
  2618. - A warning about assignments to module attributes that shadow
  2619. builtins, present in earlier releases of 2.3, has been removed.
  2620. - It is not possible to create subclasses of builtin types like str
  2621. and tuple that define an itemsize. Earlier releases of Python 2.3
  2622. allowed this by mistake, leading to crashes and other problems.
  2623. - The thread_id is now initialized to 0 in a non-thread build. SF bug
  2624. 770247.
  2625. - SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
  2626. Extension modules
  2627. -----------------
  2628. - weakref.proxy() can now handle "del obj[i]" for proxy objects
  2629. defining __delitem__. Formerly, it generated a SystemError.
  2630. - SSL no longer crashes the interpreter when the remote side disconnects.
  2631. - On Unix the mmap module can again be used to map device files.
  2632. - time.strptime now exclusively uses the Python implementation
  2633. contained within the _strptime module.
  2634. - The print slot of weakref proxy objects was removed, because it was
  2635. not consistent with the object's repr slot.
  2636. - The mmap module only checks file size for regular files, not
  2637. character or block devices. SF patch 708374.
  2638. - The cPickle Pickler garbage collection support was fixed to traverse
  2639. the find_class attribute, if present.
  2640. - There are several fixes for the bsddb3 wrapper module.
  2641. bsddb3 no longer crashes if an environment is closed before a cursor
  2642. (SF bug 763298).
  2643. The DB and DBEnv set_get_returns_none function was extended to take
  2644. a level instead of a boolean flag. The new level 2 means that in
  2645. addition, cursor.set()/.get() methods return None instead of raising
  2646. an exception.
  2647. A typo was fixed in DBCursor.join_item(), preventing a crash.
  2648. Library
  2649. -------
  2650. - distutils now supports MSVC 7.1
  2651. - doctest now examines all docstrings by default. Previously, it would
  2652. skip over functions with private names (as indicated by the underscore
  2653. naming convention). The old default created too much of a risk that
  2654. user tests were being skipped inadvertently. Note, this change could
  2655. break code in the unlikely case that someone had intentionally put
  2656. failing tests in the docstrings of private functions. The breakage
  2657. is easily fixable by specifying the old behavior when calling testmod()
  2658. or Tester().
  2659. - There were several fixes to the way dumbdbms are closed. It's vital
  2660. that a dumbdbm database be closed properly, else the on-disk data
  2661. and directory files can be left in mutually inconsistent states.
  2662. dumbdbm.py's _Database.__del__() method attempted to close the
  2663. database properly, but a shutdown race in _Database._commit() could
  2664. prevent this from working, so that a program trusting __del__() to
  2665. get the on-disk files in synch could be badly surprised. The race
  2666. has been repaired. A sync() method was also added so that shelve
  2667. can guarantee data is written to disk.
  2668. The close() method can now be called more than once without complaint.
  2669. - The classes in threading.py are now new-style classes. That they
  2670. weren't before was an oversight.
  2671. - The urllib2 digest authentication handlers now define the correct
  2672. auth_header. The earlier versions would fail at runtime.
  2673. - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
  2674. when there are no lines.
  2675. - SF bug 763637: fix exception in Tkinter with after_cancel
  2676. which could occur with Tk 8.4
  2677. - SF bug 770601: CGIHTTPServer.py now passes the entire environment
  2678. to child processes.
  2679. - SF bug 765238: add filter to fnmatch's __all__.
  2680. - SF bug 748201: make time.strptime() error messages more helpful.
  2681. - SF patch 764470: Do not dump the args attribute of a Fault object in
  2682. xmlrpclib.
  2683. - SF patch 549151: urllib and urllib2 now redirect POSTs on 301
  2684. responses.
  2685. - SF patch 766650: The whichdb module was fixed to recognize dbm files
  2686. generated by gdbm on OS/2 EMX.
  2687. - SF bugs 763047 and 763052: fixes bug of timezone value being left as
  2688. -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
  2689. is true when it should only when time.daylight is true.
  2690. - SF bug 764548: re now allows subclasses of str and unicode to be
  2691. used as patterns.
  2692. - SF bug 763637: In Tkinter, change after_cancel() to handle tuples
  2693. of varying sizes. Tk 8.4 returns a different number of values
  2694. than Tk 8.3.
  2695. - SF bug 763023: difflib.ratio() did not catch zero division.
  2696. - The Queue module now has an __all__ attribute.
  2697. Tools/Demos
  2698. -----------
  2699. - See Lib/idlelib/NEWS.txt for IDLE news.
  2700. - SF bug 753592: webchecker/wsgui now handles user supplied directories.
  2701. - The trace.py script has been removed. It is now in the standard library.
  2702. Build
  2703. -----
  2704. - Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
  2705. - The socket module compiles on IRIX 6.5.10.
  2706. - An irix64 system is treated the same way as an irix6 system (SF
  2707. patch 764560).
  2708. - Several definitions were missing on FreeBSD 5.x unless the
  2709. __BSD_VISIBLE symbol was defined. configure now defines it as
  2710. needed.
  2711. C API
  2712. -----
  2713. - Unicode objects now support mbcs as a built-in encoding, so the C
  2714. API can use it without deferring to the encodings package.
  2715. Windows
  2716. -------
  2717. - The Windows implementation of PyThread_start_new_thread() never
  2718. checked error returns from Windows functions correctly. As a result,
  2719. it could claim to start a new thread even when the Microsoft
  2720. _beginthread() function failed (due to "too many threads" -- this is
  2721. on the order of thousands when it happens). In these cases, the
  2722. Python exception ::
  2723. thread.error: can't start new thread
  2724. is raised now.
  2725. - SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
  2726. use. The interpreter now calls WSACleanup() from Py_Finalize()
  2727. instead of from DLL teardown.
  2728. Mac
  2729. ---
  2730. - Bundlebuilder now inherits default values in the right way. It was
  2731. previously possible for app bundles to get a type of "BNDL" instead
  2732. of "APPL." Other improvements include, a --build-id option to
  2733. specify the CFBundleIdentifier and using the --python option to set
  2734. the executable in the bundle.
  2735. - Fixed two bugs in MacOSX framework handling.
  2736. - pythonw did not allow user interaction in 2.3rc1, this has been fixed.
  2737. - Python is now compiled with -mno-fused-madd, making all tests pass
  2738. on Panther.
  2739. What's New in Python 2.3 beta 2?
  2740. ================================
  2741. *Release date: 29-Jun-2003*
  2742. Core and builtins
  2743. -----------------
  2744. - A program can now set the environment variable PYTHONINSPECT to some
  2745. string value in Python, and cause the interpreter to enter the
  2746. interactive prompt at program exit, as if Python had been invoked
  2747. with the -i option.
  2748. - list.index() now accepts optional start and stop arguments. Similar
  2749. changes were made to UserList.index(). SF feature request 754014.
  2750. - SF patch 751998 fixes an unwanted side effect of the previous fix
  2751. for SF bug 742860 (the next item).
  2752. - SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
  2753. wasn't threadsafe, was very inefficient (expected time O(len(dict))
  2754. instead of O(1)), and could raise a spurious RuntimeError if another
  2755. thread mutated the dict during __delitem__, or if a comparison function
  2756. mutated it. It also neglected to raise KeyError when the key wasn't
  2757. present; didn't raise TypeError when the key wasn't of a weakly
  2758. referencable type; and broke various more-or-less obscure dict
  2759. invariants by using a sequence of equality comparisons over the whole
  2760. set of dict keys instead of computing the key's hash code to narrow
  2761. the search to those keys with the same hash code. All of these are
  2762. considered to be bugs. A new implementation of __delitem__ repairs all
  2763. that, but note that fixing these bugs may change visible behavior in
  2764. code relying (whether intentionally or accidentally) on old behavior.
  2765. - SF bug 734869: Fixed a compiler bug that caused a fatal error when
  2766. compiling a list comprehension that contained another list comprehension
  2767. embedded in a lambda expression.
  2768. - SF bug 705231: builtin pow() no longer lets the platform C pow()
  2769. raise -1.0 to integer powers, because (at least) glibc gets it wrong
  2770. in some cases. The result should be -1.0 if the power is odd and 1.0
  2771. if the power is even, and any float with a sufficiently large exponent
  2772. is (mathematically) an exact even integer.
  2773. - SF bug 759227: A new-style class that implements __nonzero__() must
  2774. return a bool or int (but not an int subclass) from that method. This
  2775. matches the restriction on classic classes.
  2776. - The encoding attribute has been added for file objects, and set to
  2777. the terminal encoding on Unix and Windows.
  2778. - The softspace attribute of file objects became read-only by oversight.
  2779. It's writable again.
  2780. - Reverted a 2.3 beta 1 change to iterators for subclasses of list and
  2781. tuple. By default, the iterators now access data elements directly
  2782. instead of going through __getitem__. If __getitem__ access is
  2783. preferred, then __iter__ can be overridden.
  2784. - SF bug 735247: The staticmethod and super types participate in
  2785. garbage collection. Before this change, it was possible for leaks to
  2786. occur in functions with non-global free variables that used these types.
  2787. Extension modules
  2788. -----------------
  2789. - the socket module has a new exception, socket.timeout, to allow
  2790. timeouts to be handled separately from other socket errors.
  2791. - SF bug 751276: cPickle has fixed to propagate exceptions raised in
  2792. user code. In earlier versions, cPickle caught and ignored any
  2793. exception when it performed operations that it expected to raise
  2794. specific exceptions like AttributeError.
  2795. - cPickle Pickler and Unpickler objects now participate in garbage
  2796. collection.
  2797. - mimetools.choose_boundary() could return duplicate strings at times,
  2798. especially likely on Windows. The strings returned are now guaranteed
  2799. unique within a single program run.
  2800. - thread.interrupt_main() raises KeyboardInterrupt in the main thread.
  2801. dummy_thread has also been modified to try to simulate the behavior.
  2802. - array.array.insert() now treats negative indices as being relative
  2803. to the end of the array, just like list.insert() does. (SF bug #739313)
  2804. - The datetime module classes datetime, time, and timedelta are now
  2805. properly subclassable.
  2806. - _tkinter.{get|set}busywaitinterval was added.
  2807. - itertools.islice() now accepts stop=None as documented.
  2808. Fixes SF bug #730685.
  2809. - the bsddb185 module is built in one restricted instance -
  2810. /usr/include/db.h exists and defines HASHVERSION to be 2. This is true
  2811. for many BSD-derived systems.
  2812. Library
  2813. -------
  2814. - Some happy doctest extensions from Jim Fulton have been added to
  2815. doctest.py. These are already being used in Zope3. The two
  2816. primary ones:
  2817. doctest.debug(module, name) extracts the doctests from the named object
  2818. in the given module, puts them in a temp file, and starts pdb running
  2819. on that file. This is great when a doctest fails.
  2820. doctest.DocTestSuite(module=None) returns a synthesized unittest
  2821. TestSuite instance, to be run by the unittest framework, which
  2822. runs all the doctests in the module. This allows writing tests in
  2823. doctest style (which can be clearer and shorter than writing tests
  2824. in unittest style), without losing unittest's powerful testing
  2825. framework features (which doctest lacks).
  2826. - For compatibility with doctests created before 2.3, if an expected
  2827. output block consists solely of "1" and the actual output block
  2828. consists solely of "True", it's accepted as a match; similarly
  2829. for "0" and "False". This is quite un-doctest-like, but is practical.
  2830. The behavior can be disabled by passing the new doctest module
  2831. constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
  2832. argument.
  2833. - ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
  2834. a bare except caught to much and reported all errors as a problem
  2835. in the archive.
  2836. - The logging module now has a new function, makeLogRecord() making
  2837. LogHandler easier to interact with DatagramHandler and SocketHandler.
  2838. - The cgitb module has been extended to support plain text display (SF patch
  2839. 569574).
  2840. - A brand new version of IDLE (from the IDLEfork project at
  2841. SourceForge) is now included as Lib/idlelib. The old Tools/idle is
  2842. no more.
  2843. - Added a new module: trace (documentation missing). This module used
  2844. to be distributed in Tools/scripts. It uses sys.settrace() to trace
  2845. code execution -- either function calls or individual lines. It can
  2846. generate tracing output during execution or a post-mortem report of
  2847. code coverage.
  2848. - The threading module has new functions settrace() and setprofile()
  2849. that cooperate with the functions of the same name in the sys
  2850. module. A function registered with the threading module will
  2851. be used for all threads it creates. The new trace module uses this
  2852. to provide tracing for code running in threads.
  2853. - copy.py: applied SF patch 707900, fixing bug 702858, by Steven
  2854. Taschuk. Copying a new-style class that had a reference to itself
  2855. didn't work. (The same thing worked fine for old-style classes.)
  2856. Builtin functions are now treated as atomic, fixing bug #746304.
  2857. - difflib.py has two new functions: context_diff() and unified_diff().
  2858. - More fixes to urllib (SF 549151): (a) When redirecting, always use
  2859. GET. This is common practice and more-or-less sanctioned by the
  2860. HTTP standard. (b) Add a handler for 307 redirection, which becomes
  2861. an error for POST, but a regular redirect for GET and HEAD
  2862. - Added optional 'onerror' argument to os.walk(), to control error
  2863. handling.
  2864. - inspect.is{method|data}descriptor was added, to allow pydoc display
  2865. __doc__ of data descriptors.
  2866. - Fixed socket speed loss caused by use of the _socketobject wrapper class
  2867. in socket.py.
  2868. - timeit.py now checks the current directory for imports.
  2869. - urllib2.py now knows how to order proxy classes, so the user doesn't
  2870. have to insert it in front of other classes, nor do dirty tricks like
  2871. inserting a "dummy" HTTPHandler after a ProxyHandler when building an
  2872. opener with proxy support.
  2873. - Iterators have been added for dbm keys.
  2874. - random.Random objects can now be pickled.
  2875. Tools/Demos
  2876. -----------
  2877. - pydoc now offers help on keywords and topics.
  2878. - Tools/idle is gone; long live Lib/idlelib.
  2879. - diff.py prints file diffs in context, unified, or ndiff formats,
  2880. providing a command line interface to difflib.py.
  2881. - texcheck.py is a new script for making a rough validation of Python LaTeX
  2882. files.
  2883. Build
  2884. -----
  2885. - Setting DESTDIR during 'make install' now allows specifying a
  2886. different root directory.
  2887. C API
  2888. -----
  2889. - PyType_Ready(): If a type declares that it participates in gc
  2890. (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
  2891. tp_free slot is the default _PyObject_Del, and type does not define
  2892. a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
  2893. Previously _PyObject_Del was inherited, which could at best lead to a
  2894. segfault. In addition, if even after this magic the type's tp_free
  2895. slot is _PyObject_Del or NULL, and the type is a base type
  2896. (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
  2897. type, its dealloc function must call type->tp_free, and since the type
  2898. is gc'able, tp_free must not be NULL or _PyObject_Del.
  2899. - PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
  2900. from C) to interrupt a thread by sending it an exception. It is
  2901. intentional that you have to write your own C extension to call it
  2902. from Python.
  2903. New platforms
  2904. -------------
  2905. None this time.
  2906. Tests
  2907. -----
  2908. - test_imp rewritten so that it doesn't raise RuntimeError if run as a
  2909. side effect of being imported ("import test.autotest").
  2910. Windows
  2911. -------
  2912. - The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
  2913. - The installer always suggested that Python be installed on the C:
  2914. drive, due to a hardcoded "C:" generated by the Wise installation
  2915. wizard. People with machines where C: is not the system drive
  2916. usually want Python installed on whichever drive is their system drive
  2917. instead. We removed the hardcoded "C:", and two testers on machines
  2918. where C: is not the system drive report that the installer now
  2919. suggests their system drive. Note that you can always select the
  2920. directory you want in the "Select Destination Directory" dialog --
  2921. that's what it's for.
  2922. Mac
  2923. ---
  2924. - There's a new module called "autoGIL", which offers a mechanism to
  2925. automatically release the Global Interpreter Lock when an event loop
  2926. goes to sleep, allowing other threads to run. It's currently only
  2927. supported on OSX, in the Mach-O version.
  2928. - The OSA modules now allow direct access to properties of the
  2929. toplevel application class (in AppleScript terminology).
  2930. - The Package Manager can now update itself.
  2931. SourceForge Bugs and Patches Applied
  2932. ------------------------------------
  2933. 430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
  2934. 598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
  2935. 622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
  2936. 661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
  2937. 683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
  2938. 697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
  2939. 713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
  2940. 724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
  2941. 727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
  2942. 729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
  2943. 730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
  2944. 731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
  2945. 732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
  2946. 733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
  2947. 735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
  2948. 740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
  2949. 744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
  2950. 745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
  2951. 747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
  2952. 749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
  2953. 751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
  2954. 753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
  2955. 755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
  2956. 757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
  2957. 760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
  2958. What's New in Python 2.3 beta 1?
  2959. ================================
  2960. *Release date: 25-Apr-2003*
  2961. Core and builtins
  2962. -----------------
  2963. - New format codes B, H, I, k and K have been implemented for
  2964. PyArg_ParseTuple and PyBuild_Value.
  2965. - New builtin function sum(seq, start=0) returns the sum of all the
  2966. items in iterable object seq, plus start (items are normally numbers,
  2967. and cannot be strings).
  2968. - bool() called without arguments now returns False rather than
  2969. raising an exception. This is consistent with calling the
  2970. constructors for the other builtin types -- called without argument
  2971. they all return the false value of that type. (SF patch #724135)
  2972. - In support of PEP 269 (making the pgen parser generator accessible
  2973. from Python), some changes to the pgen code structure were made; a
  2974. few files that used to be linked only with pgen are now linked with
  2975. Python itself.
  2976. - The repr() of a weakref object now shows the __name__ attribute of
  2977. the referenced object, if it has one.
  2978. - super() no longer ignores data descriptors, except __class__. See
  2979. the thread started at
  2980. http://mail.python.org/pipermail/python-dev/2003-April/034338.html
  2981. - list.insert(i, x) now interprets negative i as it would be
  2982. interpreted by slicing, so negative values count from the end of the
  2983. list. This was the only place where such an interpretation was not
  2984. placed on a list index.
  2985. - range() now works even if the arguments are longs with magnitude
  2986. larger than sys.maxint, as long as the total length of the sequence
  2987. fits. E.g., range(2**100, 2**101, 2**100) is the following list:
  2988. [1267650600228229401496703205376L]. (SF patch #707427.)
  2989. - Some horridly obscure problems were fixed involving interaction
  2990. between garbage collection and old-style classes with "ambitious"
  2991. getattr hooks. If an old-style instance didn't have a __del__ method,
  2992. but did have a __getattr__ hook, and the instance became reachable
  2993. only from an unreachable cycle, and the hook resurrected or deleted
  2994. unreachable objects when asked to resolve "__del__", anything up to
  2995. a segfault could happen. That's been repaired.
  2996. - dict.pop now takes an optional argument specifying a default
  2997. value to return if the key is not in the dict. If a default is not
  2998. given and the key is not found, a KeyError will still be raised.
  2999. Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
  3000. [SF patch #693753] (contributed by Michael Stone.)
  3001. - sys.getfilesystemencoding() was added to expose
  3002. Py_FileSystemDefaultEncoding.
  3003. - New function sys.exc_clear() clears the current exception. This is
  3004. rarely needed, but can sometimes be useful to release objects
  3005. referenced by the traceback held in sys.exc_info()[2]. (SF patch
  3006. #693195.)
  3007. - On 64-bit systems, a dictionary could contain duplicate long/int keys
  3008. if the key value was larger than 2**32. See SF bug #689659.
  3009. - Fixed SF bug #663074. The codec system was using global static
  3010. variables to store internal data. As a result, any attempts to use the
  3011. unicode system with multiple active interpreters, or successive
  3012. interpreter executions, would fail.
  3013. - "%c" % u"a" now returns a unicode string instead of raising a
  3014. TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
  3015. of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
  3016. Extension modules
  3017. -----------------
  3018. - The socket module now provides the functions inet_pton and inet_ntop
  3019. for converting between string and packed representation of IP
  3020. addresses. There is also a new module variable, has_ipv6, which is
  3021. True iff the current Python has IPv6 support. See SF patch #658327.
  3022. - Tkinter wrappers around Tcl variables now pass objects directly
  3023. to Tcl, instead of first converting them to strings.
  3024. - The .*? pattern in the re module is now special-cased to avoid the
  3025. recursion limit. (SF patch #720991 -- many thanks to Gary Herron
  3026. and Greg Chapman.)
  3027. - New function sys.call_tracing() allows pdb to debug code
  3028. recursively.
  3029. - New function gc.get_referents(obj) returns a list of objects
  3030. directly referenced by obj. In effect, it exposes what the object's
  3031. tp_traverse slot does, and can be helpful when debugging memory
  3032. leaks.
  3033. - The iconv module has been removed from this release.
  3034. - The platform-independent routines for packing floats in IEEE formats
  3035. (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
  3036. pickling of floats) ignored that rounding can cause a carry to
  3037. propagate. The worst consequence was that, in rare cases, <f and >f
  3038. could produce strings that, when unpacked again, were a factor of 2
  3039. away from the original float. This has been fixed. See SF bug
  3040. #705836.
  3041. - New function time.tzset() provides access to the C library tzset()
  3042. function, if supported. (SF patch #675422.)
  3043. - Using createfilehandler, deletefilehandler, createtimerhandler functions
  3044. on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
  3045. See SF bug #692416.
  3046. - Modified the fcntl.ioctl() function to allow modification of a passed
  3047. mutable buffer (for details see the reference documentation).
  3048. - Made user requested changes to the itertools module.
  3049. Subsumed the times() function into repeat().
  3050. Added chain() and cycle().
  3051. - The rotor module is now deprecated; the encryption algorithm it uses
  3052. is not believed to be secure, and including crypto code with Python
  3053. has implications for exporting and importing it in various countries.
  3054. - The socket module now always uses the _socketobject wrapper class, even on
  3055. platforms which have dup(2). The makefile() method is built directly
  3056. on top of the socket without duplicating the file descriptor, allowing
  3057. timeouts to work properly.
  3058. Library
  3059. -------
  3060. - New generator function os.walk() is an easy-to-use alternative to
  3061. os.path.walk(). See os module docs for details. os.path.walk()
  3062. isn't deprecated at this time, but may become deprecated in a
  3063. future release.
  3064. - Added new module "platform" which provides a wide range of tools
  3065. for querying platform dependent features.
  3066. - netrc now allows ASCII punctuation characters in passwords.
  3067. - shelve now supports the optional writeback argument, and exposes
  3068. pickle protocol versions.
  3069. - Several methods of nntplib.NNTP have grown an optional file argument
  3070. which specifies a file where to divert the command's output
  3071. (already supported by the body() method). (SF patch #720468)
  3072. - The self-documenting XML server library DocXMLRPCServer was added.
  3073. - Support for internationalized domain names has been added through
  3074. the 'idna' and 'punycode' encodings, the 'stringprep' module, the
  3075. 'mkstringprep' tool, and enhancements to the socket and httplib
  3076. modules.
  3077. - htmlentitydefs has two new dictionaries: name2codepoint maps
  3078. HTML entity names to Unicode codepoints (as integers).
  3079. codepoint2name is the reverse mapping. See SF patch #722017.
  3080. - pdb has a new command, "debug", which lets you step through
  3081. arbitrary code from the debugger's (pdb) prompt.
  3082. - unittest.failUnlessEqual and its equivalent unittest.assertEqual now
  3083. return 'not a == b' rather than 'a != b'. This gives the desired
  3084. result for classes that define __eq__ without defining __ne__.
  3085. - sgmllib now supports SGML marked sections, in particular the
  3086. MS Office extensions.
  3087. - The urllib module now offers support for the iterator protocol.
  3088. SF patch 698520 contributed by Brett Cannon.
  3089. - New module timeit provides a simple framework for timing the
  3090. execution speed of expressions and statements.
  3091. - sets.Set objects now support mixed-type __eq__ and __ne__, instead
  3092. of raising TypeError. If x is a Set object and y is a non-Set object,
  3093. x == y is False, and x != y is True. This is akin to the change made
  3094. for mixed-type comparisons of datetime objects in 2.3a2; more info
  3095. about the rationale is in the NEWS entry for that. See also SF bug
  3096. report <http://www.python.org/sf/693121>.
  3097. - On Unix platforms, if os.listdir() is called with a Unicode argument,
  3098. it now returns Unicode strings. (This behavior was added earlier
  3099. to the Windows NT/2k/XP version of os.listdir().)
  3100. - Distutils: both 'py_modules' and 'packages' keywords can now be specified
  3101. in core.setup(). Previously you could supply one or the other, but
  3102. not both of them. (SF patch #695090 from Bernhard Herzog)
  3103. - New csv package makes it easy to read/write CSV files.
  3104. - Module shlex has been extended to allow posix-like shell parsings,
  3105. including a split() function for easy spliting of quoted strings and
  3106. commands. An iterator interface was also implemented.
  3107. Tools/Demos
  3108. -----------
  3109. - New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
  3110. See the module docstring for details.
  3111. Build
  3112. -----
  3113. - Fix problem building on OSF1 because the compiler only accepted
  3114. preprocessor directives that start in column 1. (SF bug #691793.)
  3115. C API
  3116. -----
  3117. - Added PyGC_Collect(), equivalent to calling gc.collect().
  3118. - PyThreadState_GetDict() was changed not to raise an exception or
  3119. issue a fatal error when no current thread state is available. This
  3120. makes it possible to print dictionaries when no thread is active.
  3121. - LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
  3122. need compatibility with previous versions can use this:
  3123. #ifndef PY_LONG_LONG
  3124. #define PY_LONG_LONG LONG_LONG
  3125. #endif
  3126. - Added PyObject_SelfIter() to fill the tp_iter slot for the
  3127. typical case where the method returns its self argument.
  3128. - The extended type structure used for heap types (new-style
  3129. classes defined by Python code using a class statement) is now
  3130. exported from object.h as PyHeapTypeObject. (SF patch #696193.)
  3131. New platforms
  3132. -------------
  3133. None this time.
  3134. Tests
  3135. -----
  3136. - test_timeout now requires -u network to be passed to regrtest to run.
  3137. See SF bug #692988.
  3138. Windows
  3139. -------
  3140. - os.fsync() now exists on Windows, and calls the Microsoft _commit()
  3141. function.
  3142. - New function winsound.MessageBeep() wraps the Win32 API
  3143. MessageBeep().
  3144. Mac
  3145. ---
  3146. - os.listdir() now returns Unicode strings on MacOS X when called with
  3147. a Unicode argument. See the general news item under "Library".
  3148. - A new method MacOS.WMAvailable() returns true if it is safe to access
  3149. the window manager, false otherwise.
  3150. - EasyDialogs dialogs are now movable-modal, and if the application is
  3151. currently in the background they will ask to be moved to the foreground
  3152. before displaying.
  3153. - OSA Scripting support has improved a lot, and gensuitemodule.py can now
  3154. be used by mere mortals. The documentation is now also more or less
  3155. complete.
  3156. - The IDE (in a framework build) now includes introductory documentation
  3157. in Apple Help Viewer format.
  3158. What's New in Python 2.3 alpha 2?
  3159. =================================
  3160. *Release date: 19-Feb-2003*
  3161. Core and builtins
  3162. -----------------
  3163. - Negative positions returned from PEP 293 error callbacks are now
  3164. treated as being relative to the end of the input string. Positions
  3165. that are out of bounds raise an IndexError.
  3166. - sys.path[0] (the directory from which the script is loaded) is now
  3167. turned into an absolute pathname, unless it is the empty string.
  3168. (SF patch #664376.)
  3169. - Finally fixed the bug in compile() and exec where a string ending
  3170. with an indented code block but no newline would raise SyntaxError.
  3171. This would have been a four-line change in parsetok.c... Except
  3172. codeop.py depends on this behavior, so a compilation flag had to be
  3173. invented that causes the tokenizer to revert to the old behavior;
  3174. this required extra changes to 2 .h files, 2 .c files, and 2 .py
  3175. files. (Fixes SF bug #501622.)
  3176. - If a new-style class defines neither __new__ nor __init__, its
  3177. constructor would ignore all arguments. This is changed now: the
  3178. constructor refuses arguments in this case. This might break code
  3179. that worked under Python 2.2. The simplest fix is to add a no-op
  3180. __init__: ``def __init__(self, *args, **kw): pass``.
  3181. - Through a bytecode optimizer bug (and I bet you didn't even know
  3182. Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
  3183. with a leading minus sign would come out with the wrong sign.
  3184. ("Unsigned" hex/oct constants are those with a face value in the
  3185. range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
  3186. always been interpreted as negative numbers through sign folding.)
  3187. E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
  3188. come out as -4294967295. This was the case in Python 2.2 through
  3189. 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
  3190. value, but according to PEP 237 it really needs to be 1 now. This
  3191. will be backported to Python 2.2.3 a well. (SF #660455)
  3192. - int(s, base) sometimes sign-folds hex and oct constants; it only
  3193. does this when base is 0 and s.strip() starts with a '0'. When the
  3194. sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
  3195. machine, which returns -1, a FutureWarning is now issued; in Python
  3196. 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
  3197. int("0xffffffff", 16) right now. (PEP 347)
  3198. - super(X, x): x may now be a proxy for an X instance, i.e.
  3199. issubclass(x.__class__, X) but not issubclass(type(x), X).
  3200. - isinstance(x, X): if X is a new-style class, this is now equivalent
  3201. to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
  3202. only type(x) was tested. (For classic classes this was already the
  3203. case.)
  3204. - compile(), eval() and the exec statement now fully support source code
  3205. passed as unicode strings.
  3206. - int subclasses can be initialized with longs if the value fits in an int.
  3207. See SF bug #683467.
  3208. - long(string, base) takes time linear in len(string) when base is a power
  3209. of 2 now. It used to take time quadratic in len(string).
  3210. - filter returns now Unicode results for Unicode arguments.
  3211. - raw_input can now return Unicode objects.
  3212. - List objects' sort() method now accepts None as the comparison function.
  3213. Passing None is semantically identical to calling sort() with no
  3214. arguments.
  3215. - Fixed crash when printing a subclass of str and __str__ returned self.
  3216. See SF bug #667147.
  3217. - Fixed an invalid RuntimeWarning and an undetected error when trying
  3218. to convert a long integer into a float which couldn't fit.
  3219. See SF bug #676155.
  3220. - Function objects now have a __module__ attribute that is bound to
  3221. the name of the module in which the function was defined. This
  3222. applies for C functions and methods as well as functions and methods
  3223. defined in Python. This attribute is used by pickle.whichmodule(),
  3224. which changes the behavior of whichmodule slightly. In Python 2.2
  3225. whichmodule() returns "__main__" for functions that are not defined
  3226. at the top-level of a module (examples: methods, nested functions).
  3227. Now whichmodule() will return the proper module name.
  3228. Extension modules
  3229. -----------------
  3230. - operator.isNumberType() now checks that the object has a nb_int or
  3231. nb_float slot, rather than simply checking whether it has a non-NULL
  3232. tp_as_number pointer.
  3233. - The imp module now has ways to acquire and release the "import
  3234. lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
  3235. reentrant lock, so releasing the lock only truly releases it when
  3236. this is the last release_lock() call. You can check with
  3237. imp.lock_held(). (SF bug #580952 and patch #683257.)
  3238. - Change to cPickle to match pickle.py (see below and PEP 307).
  3239. - Fix some bugs in the parser module. SF bug #678518.
  3240. - Thanks to Scott David Daniels, a subtle bug in how the zlib
  3241. extension implemented flush() was fixed. Scott also rewrote the
  3242. zlib test suite using the unittest module. (SF bug #640230 and
  3243. patch #678531.)
  3244. - Added an itertools module containing high speed, memory efficient
  3245. looping constructs inspired by tools from Haskell and SML.
  3246. - The SSL module now handles sockets with a timeout set correctly (SF
  3247. patch #675750, fixing SF bug #675552).
  3248. - os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
  3249. - Fixed broken threadstate swap in readline that could cause fatal
  3250. errors when a readline hook was being invoked while a background
  3251. thread was active. (SF bugs #660476 and #513033.)
  3252. - fcntl now exposes the strops.h I_* constants.
  3253. - Fix a crash on Solaris that occurred when calling close() on
  3254. an mmap'ed file which was already closed. (SF patch #665913)
  3255. - Fixed several serious bugs in the zipimport implementation.
  3256. - datetime changes:
  3257. The date class is now properly subclassable. (SF bug #720908)
  3258. The datetime and datetimetz classes have been collapsed into a single
  3259. datetime class, and likewise the time and timetz classes into a single
  3260. time class. Previously, a datetimetz object with tzinfo=None acted
  3261. exactly like a datetime object, and similarly for timetz. This wasn't
  3262. enough of a difference to justify distinct classes, and life is simpler
  3263. now.
  3264. today() and now() now round system timestamps to the closest
  3265. microsecond <http://www.python.org/sf/661086>. This repairs an
  3266. irritation most likely seen on Windows systems.
  3267. In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
  3268. ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
  3269. as 0 instead, but a tzinfo subclass wishing to participate in
  3270. time zone conversion has to take a stand on whether it supports
  3271. DST; if you don't care about DST, then code dst() to return 0 minutes,
  3272. meaning that DST is never in effect).
  3273. The tzinfo methods utcoffset() and dst() must return a timedelta object
  3274. (or None) now. In 2.3a1 they could also return an int or long, but that
  3275. was an unhelpfully redundant leftover from an earlier version wherein
  3276. they couldn't return a timedelta. TOOWTDI.
  3277. The example tzinfo class for local time had a bug. It was replaced
  3278. by a later example coded by Guido.
  3279. datetime.astimezone(tz) no longer raises an exception when the
  3280. input datetime has no UTC equivalent in tz. For typical "hybrid" time
  3281. zones (a single tzinfo subclass modeling both standard and daylight
  3282. time), this case can arise one hour per year, at the hour daylight time
  3283. ends. See new docs for details. In short, the new behavior mimics
  3284. the local wall clock's behavior of repeating an hour in local time.
  3285. dt.astimezone() can no longer be used to convert between naive and aware
  3286. datetime objects. If you merely want to attach, or remove, a tzinfo
  3287. object, without any conversion of date and time members, use
  3288. dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
  3289. tzinfo subclass instance.
  3290. A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
  3291. to give complete control over how a UTC time is to be converted to
  3292. a local time. The default astimezone() implementation calls fromutc()
  3293. as its last step, so a tzinfo subclass can affect that too by overriding
  3294. fromutc(). It's expected that the default fromutc() implementation will
  3295. be suitable as-is for "almost all" time zone subclasses, but the
  3296. creativity of political time zone fiddling appears unbounded -- fromutc()
  3297. allows the highly motivated to emulate any scheme expressible in Python.
  3298. datetime.now(): The optional tzinfo argument was undocumented (that's
  3299. repaired), and its name was changed to tz ("tzinfo" is overloaded enough
  3300. already). With a tz argument, now(tz) used to return the local date
  3301. and time, and attach tz to it, without any conversion of date and time
  3302. members. This was less than useful. Now now(tz) returns the current
  3303. date and time as local time in tz's time zone, akin to ::
  3304. tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
  3305. where "utc" is an instance of a tzinfo subclass modeling UTC. Without
  3306. a tz argument, now() continues to return the current local date and time,
  3307. as a naive datetime object.
  3308. datetime.fromtimestamp(): Like datetime.now() above, this had less than
  3309. useful behavior when the optional tinzo argument was specified. See
  3310. also SF bug report <http://www.python.org/sf/660872>.
  3311. date and datetime comparison: In order to prevent comparison from
  3312. falling back to the default compare-object-addresses strategy, these
  3313. raised TypeError whenever they didn't understand the other object type.
  3314. They still do, except when the other object has a "timetuple" attribute,
  3315. in which case they return NotImplemented now. This gives other
  3316. datetime objects (e.g., mxDateTime) a chance to intercept the
  3317. comparison.
  3318. date, time, datetime and timedelta comparison: When the exception
  3319. for mixed-type comparisons in the last paragraph doesn't apply, if
  3320. the comparison is == then False is returned, and if the comparison is
  3321. != then True is returned. Because dict lookup and the "in" operator
  3322. only invoke __eq__, this allows, for example, ::
  3323. if some_datetime in some_sequence:
  3324. and ::
  3325. some_dict[some_timedelta] = whatever
  3326. to work as expected, without raising TypeError just because the
  3327. sequence is heterogeneous, or the dict has mixed-type keys. [This
  3328. seems like a good idea to implement for all mixed-type comparisons
  3329. that don't want to allow falling back to address comparison.]
  3330. The constructors building a datetime from a timestamp could raise
  3331. ValueError if the platform C localtime()/gmtime() inserted "leap
  3332. seconds". Leap seconds are ignored now. On such platforms, it's
  3333. possible to have timestamps that differ by a second, yet where
  3334. datetimes constructed from them are equal.
  3335. The pickle format of date, time and datetime objects has changed
  3336. completely. The undocumented pickler and unpickler functions no
  3337. longer exist. The undocumented __setstate__() and __getstate__()
  3338. methods no longer exist either.
  3339. Library
  3340. -------
  3341. - The logging module was updated slightly; the WARN level was renamed
  3342. to WARNING, and the matching function/method warn() to warning().
  3343. - The pickle and cPickle modules were updated with a new pickling
  3344. protocol (documented by pickletools.py, see below) and several
  3345. extensions to the pickle customization API (__reduce__, __setstate__
  3346. etc.). The copy module now uses more of the pickle customization
  3347. API to copy objects that don't implement __copy__ or __deepcopy__.
  3348. See PEP 307 for details.
  3349. - The distutils "register" command now uses http://www.python.org/pypi
  3350. as the default repository. (See PEP 301.)
  3351. - the platform dependent path related variables sep, altsep, extsep,
  3352. pathsep, curdir, pardir and defpath are now defined in the platform
  3353. dependent path modules (e.g. ntpath.py) rather than os.py, so these
  3354. variables are now available via os.path. They continue to be
  3355. available from the os module.
  3356. (see <http://www.python.org/sf/680789>).
  3357. - array.array was added to the types repr.py knows about (see
  3358. <http://www.python.org/sf/680789>).
  3359. - The new pickletools.py contains lots of documentation about pickle
  3360. internals, and supplies some helpers for working with pickles, such as
  3361. a symbolic pickle disassembler.
  3362. - Xmlrpclib.py now supports the builtin boolean type.
  3363. - py_compile has a new 'doraise' flag and a new PyCompileError
  3364. exception.
  3365. - SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
  3366. class.
  3367. - The sets module now raises TypeError in __cmp__, to clarify that
  3368. sets are not intended to be three-way-compared; the comparison
  3369. operators are overloaded as subset/superset tests.
  3370. - Bastion.py and rexec.py are disabled. These modules are not safe in
  3371. Python 2.2. or 2.3.
  3372. - realpath is now exported when doing ``from poxixpath import *``.
  3373. It is also exported for ntpath, macpath, and os2emxpath.
  3374. See SF bug #659228.
  3375. - New module tarfile from Lars Gustäbel provides a comprehensive interface
  3376. to tar archive files with transparent gzip and bzip2 compression.
  3377. See SF patch #651082.
  3378. - urlparse can now parse imap:// URLs. See SF feature request #618024.
  3379. - Tkinter.Canvas.scan_dragto() provides an optional parameter to support
  3380. the gain value which is passed to Tk. SF bug# 602259.
  3381. - Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
  3382. See SF patch #642974.
  3383. - The dospath module was deleted. Use the ntpath module when manipulating
  3384. DOS paths from other platforms.
  3385. Tools/Demos
  3386. -----------
  3387. - Two new scripts (db2pickle.py and pickle2db.py) were added to the
  3388. Tools/scripts directory to facilitate conversion from the old bsddb module
  3389. to the new one. While the user-visible API of the new module is
  3390. compatible with the old one, it's likely that the version of the
  3391. underlying database library has changed. To convert from the old library,
  3392. run the db2pickle.py script using the old version of Python to convert it
  3393. to a pickle file. After upgrading Python, run the pickle2db.py script
  3394. using the new version of Python to reconstitute your database. For
  3395. example:
  3396. % python2.2 db2pickle.py -h some.db > some.pickle
  3397. % python2.3 pickle2db.py -h some.db.new < some.pickle
  3398. Run the scripts without any args to get a usage message.
  3399. Build
  3400. -----
  3401. - The audio driver tests (test_ossaudiodev.py and
  3402. test_linuxaudiodev.py) are no longer run by default. This is
  3403. because they don't always work, depending on your hardware and
  3404. software. To run these tests, you must use an invocation like ::
  3405. ./python Lib/test/regrtest.py -u audio test_ossaudiodev
  3406. - On systems which build using the configure script, compiler flags which
  3407. used to be lumped together using the OPT flag have been split into two
  3408. groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
  3409. debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
  3410. compiler flags that are required to get a clean compile. On some
  3411. platforms (many Linux flavors in particular) BASECFLAGS will be empty by
  3412. default. On others, such as Mac OS X and SCO, it will contain required
  3413. flags. This change allows people building Python to override OPT without
  3414. fear of clobbering compiler flags which are required to get a clean build.
  3415. - On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
  3416. relevant search lists in setup.py. This allows users building Python to
  3417. take advantage of the many packages available from the fink project
  3418. <http://fink.sf.net/>.
  3419. - A new Makefile target, scriptsinstall, installs a number of useful scripts
  3420. from the Tools/scripts directory.
  3421. C API
  3422. -----
  3423. - PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
  3424. instead of a plain ``PyObject *``. (SF patch #686601.)
  3425. - PyNumber_Check() now checks that the object has a nb_int or nb_float
  3426. slot, rather than simply checking whether it has a non-NULL
  3427. tp_as_number pointer.
  3428. - A C type that inherits from a base type that defines tp_as_buffer
  3429. will now inherit the tp_as_buffer pointer if it doesn't define one.
  3430. (SF #681367)
  3431. - The PyArg_Parse functions now issue a DeprecationWarning if a float
  3432. argument is provided when an integer is specified (this affects the 'b',
  3433. 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
  3434. raise a TypeError.
  3435. Tests
  3436. -----
  3437. - Several tests weren't being run from regrtest.py (test_timeout.py,
  3438. test_tarfile.py, test_netrc.py, test_multifile.py,
  3439. test_importhooks.py and test_imp.py). Now they are. (Note to
  3440. developers: please read Lib/test/README when creating a new test, to
  3441. make sure to do it right! All tests need to use either unittest or
  3442. pydoc.)
  3443. - Added test_posix.py, a test suite for the posix module.
  3444. - Added test_hexoct.py, a test suite for hex/oct constant folding.
  3445. Windows
  3446. -------
  3447. - The timeout code for socket connect() didn't work right; this has
  3448. now been fixed. test_timeout.py should pass (at least most of the
  3449. time).
  3450. - distutils' msvccompiler class now passes the preprocessor options to
  3451. the resource compiler. See SF patch #669198.
  3452. - The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
  3453. release without strong cryptography.
  3454. - sys.path[0], if it contains a directory name, is now always an
  3455. absolute pathname. (SF patch #664376.)
  3456. - The new logging package is now installed by the Windows installer. It
  3457. wasn't in 2.3a1 due to oversight.
  3458. Mac
  3459. ---
  3460. - There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
  3461. and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
  3462. - Most of the standard library now uses pathnames or FSRefs in preference
  3463. of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
  3464. in stead of macfs. macfs will probably be deprecated in the future.
  3465. - Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
  3466. This also makes macfs.FSSpec.SetDates() work again.
  3467. - There is a new module pimp, the package install manager for Python, and
  3468. accompanying applet PackageManager. These allow you to easily download
  3469. and install pretested extension packages either in source or binary
  3470. form. Only in MacPython-OSX.
  3471. - Applets are now built with bundlebuilder in MacPython-OSX, which should make
  3472. them more robust and also provides a path towards BuildApplication. The
  3473. downside of this change is that applets can no longer be run from the
  3474. Terminal window, this will hopefully be fixed in the 2.3b1.
  3475. What's New in Python 2.3 alpha 1?
  3476. =================================
  3477. *Release date: 31-Dec-2002*
  3478. Type/class unification and new-style classes
  3479. --------------------------------------------
  3480. - One can now assign to __bases__ and __name__ of new-style classes.
  3481. - dict() now accepts keyword arguments so that dict(one=1, two=2)
  3482. is the equivalent of {"one": 1, "two": 2}. Accordingly,
  3483. the existing (but undocumented) 'items' keyword argument has
  3484. been eliminated. This means that dict(items=someMapping) now has
  3485. a different meaning than before.
  3486. - int() now returns a long object if the argument is outside the
  3487. integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
  3488. all return long objects instead of raising an OverflowError.
  3489. - Assignment to __class__ is disallowed if either the old or the new
  3490. class is a statically allocated type object (such as defined by an
  3491. extension module). This prevents anomalies like 2.__class__ = bool.
  3492. - New-style object creation and deallocation have been sped up
  3493. significantly; they are now faster than classic instance creation
  3494. and deallocation.
  3495. - The __slots__ variable can now mention "private" names, and the
  3496. right thing will happen (e.g. __slots__ = ["__foo"]).
  3497. - The built-ins slice() and buffer() are now callable types. The
  3498. types classobj (formerly class), code, function, instance, and
  3499. instancemethod (formerly instance-method), which have no built-in
  3500. names but are accessible through the types module, are now also
  3501. callable. The type dict-proxy is renamed to dictproxy.
  3502. - Cycles going through the __class__ link of a new-style instance are
  3503. now detected by the garbage collector.
  3504. - Classes using __slots__ are now properly garbage collected.
  3505. [SF bug 519621]
  3506. - Tightened the __slots__ rules: a slot name must be a valid Python
  3507. identifier.
  3508. - The constructor for the module type now requires a name argument and
  3509. takes an optional docstring argument. Previously, this constructor
  3510. ignored its arguments. As a consequence, deriving a class from a
  3511. module (not from the module type) is now illegal; previously this
  3512. created an unnamed module, just like invoking the module type did.
  3513. [SF bug 563060]
  3514. - A new type object, 'basestring', is added. This is a common base type
  3515. for 'str' and 'unicode', and can be used instead of
  3516. types.StringTypes, e.g. to test whether something is "a string":
  3517. isinstance(x, basestring) is True for Unicode and 8-bit strings. This
  3518. is an abstract base class and cannot be instantiated directly.
  3519. - Changed new-style class instantiation so that when C's __new__
  3520. method returns something that's not a C instance, its __init__ is
  3521. not called. [SF bug #537450]
  3522. - Fixed super() to work correctly with class methods. [SF bug #535444]
  3523. - If you try to pickle an instance of a class that has __slots__ but
  3524. doesn't define or override __getstate__, a TypeError is now raised.
  3525. This is done by adding a bozo __getstate__ to the class that always
  3526. raises TypeError. (Before, this would appear to be pickled, but the
  3527. state of the slots would be lost.)
  3528. Core and builtins
  3529. -----------------
  3530. - Import from zipfiles is now supported. The name of a zipfile placed
  3531. on sys.path causes the import statement to look for importable Python
  3532. modules (with .py, pyc and .pyo extensions) and packages inside the
  3533. zipfile. The zipfile import follows the specification (though not
  3534. the sample implementation) of PEP 273. The semantics of __path__ are
  3535. compatible with those that have been implemented in Jython since
  3536. Jython 2.1.
  3537. - PEP 302 has been accepted. Although it was initially developed to
  3538. support zipimport, it offers a new, general import hook mechanism.
  3539. Several new variables have been added to the sys module:
  3540. sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
  3541. make extending the import statement much more convenient than
  3542. overriding the __import__ built-in function. For a description of
  3543. these, see PEP 302.
  3544. - A frame object's f_lineno attribute can now be written to from a
  3545. trace function to change which line will execute next. A command to
  3546. exploit this from pdb has been added. [SF patch #643835]
  3547. - The _codecs support module for codecs.py was turned into a builtin
  3548. module to assure that at least the builtin codecs are available
  3549. to the Python parser for source code decoding according to PEP 263.
  3550. - issubclass now supports a tuple as the second argument, just like
  3551. isinstance does. ``issubclass(X, (A, B))`` is equivalent to
  3552. ``issubclass(X, A) or issubclass(X, B)``.
  3553. - Thanks to Armin Rigo, the last known way to provoke a system crash
  3554. by cleverly arranging for a comparison function to mutate a list
  3555. during a list.sort() operation has been fixed. The effect of
  3556. attempting to mutate a list, or even to inspect its contents or
  3557. length, while a sort is in progress, is not defined by the language.
  3558. The C implementation of Python 2.3 attempts to detect mutations,
  3559. and raise ValueError if one occurs, but there's no guarantee that
  3560. all mutations will be caught, or that any will be caught across
  3561. releases or implementations.
  3562. - Unicode file name processing for Windows (PEP 277) is implemented.
  3563. All platforms now have an os.path.supports_unicode_filenames attribute,
  3564. which is set to True on Windows NT/2000/XP, and False elsewhere.
  3565. - Codec error handling callbacks (PEP 293) are implemented.
  3566. Error handling in unicode.encode or str.decode can now be customized.
  3567. - A subtle change to the semantics of the built-in function intern():
  3568. interned strings are no longer immortal. You must keep a reference
  3569. to the return value intern() around to get the benefit.
  3570. - Use of 'None' as a variable, argument or attribute name now
  3571. issues a SyntaxWarning. In the future, None may become a keyword.
  3572. - SET_LINENO is gone. co_lnotab is now consulted to determine when to
  3573. call the trace function. C code that accessed f_lineno should call
  3574. PyCode_Addr2Line instead (f_lineno is still there, but only kept up
  3575. to date when there is a trace function set).
  3576. - There's a new warning category, FutureWarning. This is used to warn
  3577. about a number of situations where the value or sign of an integer
  3578. result will change in Python 2.4 as a result of PEP 237 (integer
  3579. unification). The warnings implement stage B0 mentioned in that
  3580. PEP. The warnings are about the following situations:
  3581. - Octal and hex literals without 'L' prefix in the inclusive range
  3582. [0x80000000..0xffffffff]; these are currently negative ints, but
  3583. in Python 2.4 they will be positive longs with the same bit
  3584. pattern.
  3585. - Left shifts on integer values that cause the outcome to lose
  3586. bits or have a different sign than the left operand. To be
  3587. precise: x<<n where this currently doesn't yield the same value
  3588. as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
  3589. - Conversions from ints to string that show negative values as
  3590. unsigned ints in the inclusive range [0x80000000..0xffffffff];
  3591. this affects the functions hex() and oct(), and the string
  3592. formatting codes %u, %o, %x, and %X. In Python 2.4, these will
  3593. show signed values (e.g. hex(-1) currently returns "0xffffffff";
  3594. in Python 2.4 it will return "-0x1").
  3595. - The bits manipulated under the cover by sys.setcheckinterval() have
  3596. been changed. Both the check interval and the ticker used to be
  3597. per-thread values. They are now just a pair of global variables.
  3598. In addition, the default check interval was boosted from 10 to 100
  3599. bytecode instructions. This may have some effect on systems that
  3600. relied on the old default value. In particular, in multi-threaded
  3601. applications which try to be highly responsive, response time will
  3602. increase by some (perhaps imperceptible) amount.
  3603. - When multiplying very large integers, a version of the so-called
  3604. Karatsuba algorithm is now used. This is most effective if the
  3605. inputs have roughly the same size. If they both have about N digits,
  3606. Karatsuba multiplication has O(N**1.58) runtime (the exponent is
  3607. log_base_2(3)) instead of the previous O(N**2). Measured results may
  3608. be better or worse than that, depending on platform quirks. Besides
  3609. the O() improvement in raw instruction count, the Karatsuba algorithm
  3610. appears to have much better cache behavior on extremely large integers
  3611. (starting in the ballpark of a million bits). Note that this is a
  3612. simple implementation, and there's no intent here to compete with,
  3613. e.g., GMP. It gives a very nice speedup when it applies, but a package
  3614. devoted to fast large-integer arithmetic should run circles around it.
  3615. - u'%c' will now raise a ValueError in case the argument is an
  3616. integer outside the valid range of Unicode code point ordinals.
  3617. - The tempfile module has been overhauled for enhanced security. The
  3618. mktemp() function is now deprecated; new, safe replacements are
  3619. mkstemp() (for files) and mkdtemp() (for directories), and the
  3620. higher-level functions NamedTemporaryFile() and TemporaryFile().
  3621. Use of some global variables in this module is also deprecated; the
  3622. new functions have keyword arguments to provide the same
  3623. functionality. All Lib, Tools and Demo modules that used the unsafe
  3624. interfaces have been updated to use the safe replacements. Thanks
  3625. to Zack Weinberg!
  3626. - When x is an object whose class implements __mul__ and __rmul__,
  3627. 1.0*x would correctly invoke __rmul__, but 1*x would erroneously
  3628. invoke __mul__. This was due to the sequence-repeat code in the int
  3629. type. This has been fixed now.
  3630. - Previously, "str1 in str2" required str1 to be a string of length 1.
  3631. This restriction has been relaxed to allow str1 to be a string of
  3632. any length. Thus "'el' in 'hello world'" returns True now.
  3633. - File objects are now their own iterators. For a file f, iter(f) now
  3634. returns f (unless f is closed), and f.next() is similar to
  3635. f.readline() when EOF is not reached; however, f.next() uses a
  3636. readahead buffer that messes up the file position, so mixing
  3637. f.next() and f.readline() (or other methods) doesn't work right.
  3638. Calling f.seek() drops the readahead buffer, but other operations
  3639. don't. It so happens that this gives a nice additional speed boost
  3640. to "for line in file:"; the xreadlines method and corresponding
  3641. module are now obsolete. Thanks to Oren Tirosh!
  3642. - Encoding declarations (PEP 263, phase 1) have been implemented. A
  3643. comment of the form "# -*- coding: <encodingname> -*-" in the first
  3644. or second line of a Python source file indicates the encoding.
  3645. - list.sort() has a new implementation. While cross-platform results
  3646. may vary, and in data-dependent ways, this is much faster on many
  3647. kinds of partially ordered lists than the previous implementation,
  3648. and reported to be just as fast on randomly ordered lists on
  3649. several major platforms. This sort is also stable (if A==B and A
  3650. precedes B in the list at the start, A precedes B after the sort too),
  3651. although the language definition does not guarantee stability. A
  3652. potential drawback is that list.sort() may require temp space of
  3653. len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
  3654. for list.sort() to raise MemoryError now, even if a comparison function
  3655. does not. See <http://www.python.org/sf/587076> for full details.
  3656. - All standard iterators now ensure that, once StopIteration has been
  3657. raised, all future calls to next() on the same iterator will also
  3658. raise StopIteration. There used to be various counterexamples to
  3659. this behavior, which could caused confusion or subtle program
  3660. breakage, without any benefits. (Note that this is still an
  3661. iterator's responsibility; the iterator framework does not enforce
  3662. this.)
  3663. - Ctrl+C handling on Windows has been made more consistent with
  3664. other platforms. KeyboardInterrupt can now reliably be caught,
  3665. and Ctrl+C at an interactive prompt no longer terminates the
  3666. process under NT/2k/XP (it never did under Win9x). Ctrl+C will
  3667. interrupt time.sleep() in the main thread, and any child processes
  3668. created via the popen family (on win2k; we can't make win9x work
  3669. reliably) are also interrupted (as generally happens on for Linux/Unix.)
  3670. [SF bugs 231273, 439992 and 581232]
  3671. - sys.getwindowsversion() has been added on Windows. This
  3672. returns a tuple with information about the version of Windows
  3673. currently running.
  3674. - Slices and repetitions of buffer objects now consistently return
  3675. a string. Formerly, strings would be returned most of the time,
  3676. but a buffer object would be returned when the repetition count
  3677. was one or when the slice range was all inclusive.
  3678. - Unicode objects in sys.path are no longer ignored but treated
  3679. as directory names.
  3680. - Fixed string.startswith and string.endswith builtin methods
  3681. so they accept negative indices. [SF bug 493951]
  3682. - Fixed a bug with a continue inside a try block and a yield in the
  3683. finally clause. [SF bug 567538]
  3684. - Most builtin sequences now support "extended slices", i.e. slices
  3685. with a third "stride" parameter. For example, "hello world"[::-1]
  3686. gives "dlrow olleh".
  3687. - A new warning PendingDeprecationWarning was added to provide
  3688. direction on features which are in the process of being deprecated.
  3689. The warning will not be printed by default. To see the pending
  3690. deprecations, use -Walways::PendingDeprecationWarning::
  3691. as a command line option or warnings.filterwarnings() in code.
  3692. - Deprecated features of xrange objects have been removed as
  3693. promised. The start, stop, and step attributes and the tolist()
  3694. method no longer exist. xrange repetition and slicing have been
  3695. removed.
  3696. - New builtin function enumerate(x), from PEP 279. Example:
  3697. enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  3698. The argument can be an arbitrary iterable object.
  3699. - The assert statement no longer tests __debug__ at runtime. This means
  3700. that assert statements cannot be disabled by assigning a false value
  3701. to __debug__.
  3702. - A method zfill() was added to str and unicode, that fills a numeric
  3703. string to the left with zeros. For example,
  3704. "+123".zfill(6) -> "+00123".
  3705. - Complex numbers supported divmod() and the // and % operators, but
  3706. these make no sense. Since this was documented, they're being
  3707. deprecated now.
  3708. - String and unicode methods lstrip(), rstrip() and strip() now take
  3709. an optional argument that specifies the characters to strip. For
  3710. example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
  3711. - There's a new dictionary constructor (a class method of the dict
  3712. class), dict.fromkeys(iterable, value=None). It constructs a
  3713. dictionary with keys taken from the iterable and all values set to a
  3714. single value. It can be used for building sets and for removing
  3715. duplicates from sequences.
  3716. - Added a new dict method pop(key). This removes and returns the
  3717. value corresponding to key. [SF patch #539949]
  3718. - A new built-in type, bool, has been added, as well as built-in
  3719. names for its two values, True and False. Comparisons and sundry
  3720. other operations that return a truth value have been changed to
  3721. return a bool instead. Read PEP 285 for an explanation of why this
  3722. is backward compatible.
  3723. - Fixed two bugs reported as SF #535905: under certain conditions,
  3724. deallocating a deeply nested structure could cause a segfault in the
  3725. garbage collector, due to interaction with the "trashcan" code;
  3726. access to the current frame during destruction of a local variable
  3727. could access a pointer to freed memory.
  3728. - The optional object allocator ("pymalloc") has been enabled by
  3729. default. The recommended practice for memory allocation and
  3730. deallocation has been streamlined. A header file is included,
  3731. Misc/pymemcompat.h, which can be bundled with 3rd party extensions
  3732. and lets them use the same API with Python versions from 1.5.2
  3733. onwards.
  3734. - PyErr_Display will provide file and line information for all exceptions
  3735. that have an attribute print_file_and_line, not just SyntaxErrors.
  3736. - The UTF-8 codec will now encode and decode Unicode surrogates
  3737. correctly and without raising exceptions for unpaired ones.
  3738. - Universal newlines (PEP 278) is implemented. Briefly, using 'U'
  3739. instead of 'r' when opening a text file for reading changes the line
  3740. ending convention so that any of '\r', '\r\n', and '\n' is
  3741. recognized (even mixed in one file); all three are converted to
  3742. '\n', the standard Python line end character.
  3743. - file.xreadlines() now raises a ValueError if the file is closed:
  3744. Previously, an xreadlines object was returned which would raise
  3745. a ValueError when the xreadlines.next() method was called.
  3746. - sys.exit() inadvertently allowed more than one argument.
  3747. An exception will now be raised if more than one argument is used.
  3748. - Changed evaluation order of dictionary literals to conform to the
  3749. general left to right evaluation order rule. Now {f1(): f2()} will
  3750. evaluate f1 first.
  3751. - Fixed bug #521782: when a file was in non-blocking mode, file.read()
  3752. could silently lose data or wrongly throw an unknown error.
  3753. - The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
  3754. slots are now always tried after trying the corresponding nb_* slots.
  3755. This fixes a number of minor bugs (see bug #624807).
  3756. - Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
  3757. Extension modules
  3758. -----------------
  3759. - Added three operators to the operator module:
  3760. operator.pow(a,b) which is equivalent to: a**b.
  3761. operator.is_(a,b) which is equivalent to: a is b.
  3762. operator.is_not(a,b) which is equivalent to: a is not b.
  3763. - posix.openpty now works on all systems that have /dev/ptmx.
  3764. - A module zipimport exists to support importing code from zip
  3765. archives.
  3766. - The new datetime module supplies classes for manipulating dates and
  3767. times. The basic design came from the Zope "fishbowl process", and
  3768. favors practical commercial applications over calendar esoterica. See
  3769. http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
  3770. - _tkinter now returns Tcl objects, instead of strings. Objects which
  3771. have Python equivalents are converted to Python objects, other objects
  3772. are wrapped. This can be configured through the wantobjects method,
  3773. or Tkinter.wantobjects.
  3774. - The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
  3775. been added as the package bsddb. The traditional bsddb module is
  3776. still available in source code, but not built automatically anymore,
  3777. and is now named bsddb185. This supports Berkeley DB versions from
  3778. 3.0 to 4.1. For help converting your databases from the old module (which
  3779. probably used an obsolete version of Berkeley DB) to the new module, see
  3780. the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
  3781. section above.
  3782. - unicodedata was updated to Unicode 3.2. It supports normalization
  3783. and names for Hangul syllables and CJK unified ideographs.
  3784. - resource.getrlimit() now returns longs instead of ints.
  3785. - readline now dynamically adjusts its input/output stream if
  3786. sys.stdin/stdout changes.
  3787. - The _tkinter module (and hence Tkinter) has dropped support for
  3788. Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
  3789. supported.
  3790. - cPickle.BadPickleGet is now a class.
  3791. - The time stamps in os.stat_result are floating point numbers
  3792. after stat_float_times has been called.
  3793. - If the size passed to mmap.mmap() is larger than the length of the
  3794. file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
  3795. - The xreadlines module is slated for obsolescence.
  3796. - The strptime function in the time module is now always available (a
  3797. Python implementation is used when the C library doesn't define it).
  3798. - The 'new' module is no longer an extension, but a Python module that
  3799. only exists for backwards compatibility. Its contents are no longer
  3800. functions but callable type objects.
  3801. - The bsddb.*open functions can now take 'None' as a filename.
  3802. This will create a temporary in-memory bsddb that won't be
  3803. written to disk.
  3804. - posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
  3805. posix.getpgid have been added where available.
  3806. - The locale module now exposes the C library's gettext interface. It
  3807. also has a new function getpreferredencoding.
  3808. - A security hole ("double free") was found in zlib-1.1.3, a popular
  3809. third party compression library used by some Python modules. The
  3810. hole was quickly plugged in zlib-1.1.4, and the Windows build of
  3811. Python now ships with zlib-1.1.4.
  3812. - pwd, grp, and resource return enhanced tuples now, with symbolic
  3813. field names.
  3814. - array.array is now a type object. A new format character
  3815. 'u' indicates Py_UNICODE arrays. For those, .tounicode and
  3816. .fromunicode methods are available. Arrays now support __iadd__
  3817. and __imul__.
  3818. - dl now builds on every system that has dlfcn.h. Failure in case
  3819. of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
  3820. is called.
  3821. - The sys module acquired a new attribute, api_version, which evaluates
  3822. to the value of the PYTHON_API_VERSION macro with which the
  3823. interpreter was compiled.
  3824. - Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
  3825. when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
  3826. returns (None, None, 'ab'), as expected. Also fixed handling of
  3827. lastindex/lastgroup match attributes in similar cases. For example,
  3828. when running the expression r'(a)(b)?b' over 'ab', lastindex must be
  3829. 1, not 2.
  3830. - Fixed bug #581080: sre scanner was not checking the buffer limit
  3831. before increasing the current pointer. This was creating an infinite
  3832. loop in the search function, once the pointer exceeded the buffer
  3833. limit.
  3834. - The os.fdopen function now enforces a file mode starting with the
  3835. letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
  3836. bug #623464.
  3837. - The linuxaudiodev module is now deprecated; it is being replaced by
  3838. ossaudiodev. The interface has been extended to cover a lot more of
  3839. OSS (see www.opensound.com), including most DSP ioctls and the
  3840. OSS mixer API. Documentation forthcoming in 2.3a2.
  3841. Library
  3842. -------
  3843. - imaplib.py now supports SSL (Tino Lange and Piers Lauder).
  3844. - Freeze's modulefinder.py has been moved to the standard library;
  3845. slightly improved so it will issue less false missing submodule
  3846. reports (see sf path #643711 for details). Documentation will follow
  3847. with Python 2.3a2.
  3848. - os.path exposes getctime.
  3849. - unittest.py now has two additional methods called assertAlmostEqual()
  3850. and failIfAlmostEqual(). They implement an approximate comparison
  3851. by rounding the difference between the two arguments and comparing
  3852. the result to zero. Approximate comparison is essential for
  3853. unit tests of floating point results.
  3854. - calendar.py now depends on the new datetime module rather than
  3855. the time module. As a result, the range of allowable dates
  3856. has been increased.
  3857. - pdb has a new 'j(ump)' command to select the next line to be
  3858. executed.
  3859. - The distutils created windows installers now can run a
  3860. postinstallation script.
  3861. - doctest.testmod can now be called without argument, which means to
  3862. test the current module.
  3863. - When canceling a server that implemented threading with a keyboard
  3864. interrupt, the server would shut down but not terminate (waiting on
  3865. client threads). A new member variable, daemon_threads, was added to
  3866. the ThreadingMixIn class in SocketServer.py to make it explicit that
  3867. this behavior needs to be controlled.
  3868. - A new module, optparse, provides a fancy alternative to getopt for
  3869. command line parsing. It is a slightly modified version of Greg
  3870. Ward's Optik package.
  3871. - UserDict.py now defines a DictMixin class which defines all dictionary
  3872. methods for classes that already have a minimum mapping interface.
  3873. This greatly simplifies writing classes that need to be substitutable
  3874. for dictionaries (such as the shelve module).
  3875. - shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
  3876. all dictionary methods. This eases the transition to persistent
  3877. storage for scripts originally written with dictionaries in mind.
  3878. - shelve.open and the various classes in shelve.py now accept an optional
  3879. binary flag, which defaults to False. If True, the values stored in the
  3880. shelf are binary pickles.
  3881. - A new package, logging, implements the logging API defined by PEP
  3882. 282. The code is written by Vinay Sajip.
  3883. - StreamReader, StreamReaderWriter and StreamRecoder in the codecs
  3884. modules are iterators now.
  3885. - gzip.py now handles files exceeding 2GB. Files over 4GB also work
  3886. now (provided the OS supports it, and Python is configured with large
  3887. file support), but in that case the underlying gzip file format can
  3888. record only the least-significant 32 bits of the file size, so that
  3889. some tools working with gzipped files may report an incorrect file
  3890. size.
  3891. - xml.sax.saxutils.unescape has been added, to replace entity references
  3892. with their entity value.
  3893. - Queue.Queue.{put,get} now support an optional timeout argument.
  3894. - Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
  3895. option of tkFileDialog is exposed as function askopenfile{,name}s.
  3896. - Various configure methods of Tkinter have been stream-lined, so that
  3897. tag_configure, image_configure, window_configure now return a
  3898. dictionary when invoked with no argument.
  3899. - Importing the readline module now no longer has the side effect of
  3900. calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
  3901. whatever locale is explicitly set by the user, is preserved. If you
  3902. want repr() of 8-bit strings in your preferred encoding to preserve
  3903. all printable characters of that encoding, you have to add the
  3904. following code to your $PYTHONSTARTUP file or to your application's
  3905. main():
  3906. import locale
  3907. locale.setlocale(locale.LC_CTYPE, "")
  3908. - shutil.move was added. shutil.copytree now reports errors as an
  3909. exception at the end, instead of printing error messages.
  3910. - Encoding name normalization was generalized to not only
  3911. replace hyphens with underscores, but also all other non-alphanumeric
  3912. characters (with the exception of the dot which is used for Python
  3913. package names during lookup). The aliases.py mapping was updated
  3914. to the new standard.
  3915. - mimetypes has two new functions: guess_all_extensions() which
  3916. returns a list of all known extensions for a mime type, and
  3917. add_type() which adds one mapping between a mime type and
  3918. an extension to the database.
  3919. - New module: sets, defines the class Set that implements a mutable
  3920. set type using the keys of a dict to represent the set. There's
  3921. also a class ImmutableSet which is useful when you need sets of sets
  3922. or when you need to use sets as dict keys, and a class BaseSet which
  3923. is the base class of the two.
  3924. - Added random.sample(population,k) for random sampling without replacement.
  3925. Returns a k length list of unique elements chosen from the population.
  3926. - random.randrange(-sys.maxint-1, sys.maxint) no longer raises
  3927. OverflowError. That is, it now accepts any combination of 'start'
  3928. and 'stop' arguments so long as each is in the range of Python's
  3929. bounded integers.
  3930. - Thanks to Raymond Hettinger, random.random() now uses a new core
  3931. generator. The Mersenne Twister algorithm is implemented in C,
  3932. threadsafe, faster than the previous generator, has an astronomically
  3933. large period (2**19937-1), creates random floats to full 53-bit
  3934. precision, and may be the most widely tested random number generator
  3935. in existence.
  3936. The random.jumpahead(n) method has different semantics for the new
  3937. generator. Instead of jumping n steps ahead, it uses n and the
  3938. existing state to create a new state. This means that jumpahead()
  3939. continues to support multi-threaded code needing generators of
  3940. non-overlapping sequences. However, it will break code which relies
  3941. on jumpahead moving a specific number of steps forward.
  3942. The attributes random.whseed and random.__whseed have no meaning for
  3943. the new generator. Code using these attributes should switch to a
  3944. new class, random.WichmannHill which is provided for backward
  3945. compatibility and to make an alternate generator available.
  3946. - New "algorithms" module: heapq, implements a heap queue. Thanks to
  3947. Kevin O'Connor for the code and François Pinard for an entertaining
  3948. write-up explaining the theory and practical uses of heaps.
  3949. - New encoding for the Palm OS character set: palmos.
  3950. - binascii.crc32() and the zipfile module had problems on some 64-bit
  3951. platforms. These have been fixed. On a platform with 8-byte C longs,
  3952. crc32() now returns a signed-extended 4-byte result, so that its value
  3953. as a Python int is equal to the value computed a 32-bit platform.
  3954. - xml.dom.minidom.toxml and toprettyxml now take an optional encoding
  3955. argument.
  3956. - Some fixes in the copy module: when an object is copied through its
  3957. __reduce__ method, there was no check for a __setstate__ method on
  3958. the result [SF patch 565085]; deepcopy should treat instances of
  3959. custom metaclasses the same way it treats instances of type 'type'
  3960. [SF patch 560794].
  3961. - Sockets now support timeout mode. After s.settimeout(T), where T is
  3962. a float expressing seconds, subsequent operations raise an exception
  3963. if they cannot be completed within T seconds. To disable timeout
  3964. mode, use s.settimeout(None). There's also a module function,
  3965. socket.setdefaulttimeout(T), which sets the default for all sockets
  3966. created henceforth.
  3967. - getopt.gnu_getopt was added. This supports GNU-style option
  3968. processing, where options can be mixed with non-option arguments.
  3969. - Stop using strings for exceptions. String objects used for
  3970. exceptions are now classes deriving from Exception. The objects
  3971. changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
  3972. tabnanny.NannyNag, and xdrlib.Error.
  3973. - Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
  3974. BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
  3975. Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
  3976. big endian systems were added to the codecs module. The old names
  3977. BOM32_* and BOM64_* were off by a factor of 2.
  3978. - Added conversion functions math.degrees() and math.radians().
  3979. - math.log() now takes an optional argument: math.log(x[, base]).
  3980. - ftplib.retrlines() now tests for callback is None rather than testing
  3981. for False. Was causing an error when given a callback object which
  3982. was callable but also returned len() as zero. The change may
  3983. create new breakage if the caller relied on the undocumented behavior
  3984. and called with callback set to [] or some other False value not
  3985. identical to None.
  3986. - random.gauss() uses a piece of hidden state used by nothing else,
  3987. and the .seed() and .whseed() methods failed to reset it. In other
  3988. words, setting the seed didn't completely determine the sequence of
  3989. results produced by random.gauss(). It does now. Programs repeatedly
  3990. mixing calls to a seed method with calls to gauss() may see different
  3991. results now.
  3992. - The pickle.Pickler class grew a clear_memo() method to mimic that
  3993. provided by cPickle.Pickler.
  3994. - difflib's SequenceMatcher class now does a dynamic analysis of
  3995. which elements are so frequent as to constitute noise. For
  3996. comparing files as sequences of lines, this generally works better
  3997. than the IS_LINE_JUNK function, and function ndiff's linejunk
  3998. argument defaults to None now as a result. A happy benefit is
  3999. that SequenceMatcher may run much faster now when applied
  4000. to large files with many duplicate lines (for example, C program
  4001. text with lots of repeated "}" and "return NULL;" lines).
  4002. - New Text.dump() method in Tkinter module.
  4003. - New distutils commands for building packagers were added to
  4004. support pkgtool on Solaris and swinstall on HP-UX.
  4005. - distutils now has a new abstract binary packager base class
  4006. command/bdist_packager, which simplifies writing packagers.
  4007. This will hopefully provide the missing bits to encourage
  4008. people to submit more packagers, e.g. for Debian, FreeBSD
  4009. and other systems.
  4010. - The UTF-16, -LE and -BE stream readers now raise a
  4011. NotImplementedError for all calls to .readline(). Previously, they
  4012. used to just produce garbage or fail with an encoding error --
  4013. UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
  4014. work well with these.
  4015. - compileall now supports quiet operation.
  4016. - The BaseHTTPServer now implements optional HTTP/1.1 persistent
  4017. connections.
  4018. - socket module: the SSL support was broken out of the main
  4019. _socket module C helper and placed into a new _ssl helper
  4020. which now gets imported by socket.py if available and working.
  4021. - encodings package: added aliases for all supported IANA character
  4022. sets
  4023. - ftplib: to safeguard the user's privacy, anonymous login will use
  4024. "anonymous@" as default password, rather than the real user and host
  4025. name.
  4026. - webbrowser: tightened up the command passed to os.system() so that
  4027. arbitrary shell code can't be executed because a bogus URL was
  4028. passed in.
  4029. - gettext.translation has an optional fallback argument, and
  4030. gettext.find an optional all argument. Translations will now fallback
  4031. on a per-message basis. The module supports plural forms, by means
  4032. of gettext.[d]ngettext and Translation.[u]ngettext.
  4033. - distutils bdist commands now offer a --skip-build option.
  4034. - warnings.warn now accepts a Warning instance as first argument.
  4035. - The xml.sax.expatreader.ExpatParser class will no longer create
  4036. circular references by using itself as the locator that gets passed
  4037. to the content handler implementation. [SF bug #535474]
  4038. - The email.Parser.Parser class now properly parses strings regardless
  4039. of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
  4040. or CRLF). Also, the Header class's constructor default arguments
  4041. has changed slightly so that an explicit maxlinelen value is always
  4042. honored, and so unicode conversion error handling can be specified.
  4043. - distutils' build_ext command now links C++ extensions with the C++
  4044. compiler available in the Makefile or CXX environment variable, if
  4045. running under \*nix.
  4046. - New module bz2: provides a comprehensive interface for the bz2 compression
  4047. library. It implements a complete file interface, one-shot (de)compression
  4048. functions, and types for sequential (de)compression.
  4049. - New pdb command 'pp' which is like 'p' except that it pretty-prints
  4050. the value of its expression argument.
  4051. - Now bdist_rpm distutils command understands a verify_script option in
  4052. the config file, including the contents of the referred filename in
  4053. the "%verifyscript" section of the rpm spec file.
  4054. - Fixed bug #495695: webbrowser module would run graphic browsers in a
  4055. unix environment even if DISPLAY was not set. Also, support for
  4056. skipstone browser was included.
  4057. - Fixed bug #636769: rexec would run unallowed code if subclasses of
  4058. strings were used as parameters for certain functions.
  4059. Tools/Demos
  4060. -----------
  4061. - pygettext.py now supports globbing on Windows, and accepts module
  4062. names in addition to accepting file names.
  4063. - The SGI demos (Demo/sgi) have been removed. Nobody thought they
  4064. were interesting any more. (The SGI library modules and extensions
  4065. are still there; it is believed that at least some of these are
  4066. still used and useful.)
  4067. - IDLE supports the new encoding declarations (PEP 263); it can also
  4068. deal with legacy 8-bit files if they use the locale's encoding. It
  4069. allows non-ASCII strings in the interactive shell and executes them
  4070. in the locale's encoding.
  4071. - freeze.py now produces binaries which can import shared modules,
  4072. unlike before when this failed due to missing symbol exports in
  4073. the generated binary.
  4074. Build
  4075. -----
  4076. - On Unix, IDLE is now installed automatically.
  4077. - The fpectl module is not built by default; it's dangerous or useless
  4078. except in the hands of experts.
  4079. - The public Python C API will generally be declared using PyAPI_FUNC
  4080. and PyAPI_DATA macros, while Python extension module init functions
  4081. will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
  4082. are deprecated.
  4083. - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
  4084. get into infinite loops, when a new-style class got garbage-collected.
  4085. Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
  4086. that new-style classes be immortal in COUNT_ALLOCS builds. Note that
  4087. COUNT_ALLOCS is not enabled by default, in either release or debug
  4088. builds, and that new-style classes are immortal only in COUNT_ALLOCS
  4089. builds.
  4090. - Compiling out the cyclic garbage collector is no longer an option.
  4091. The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
  4092. that it's always defined (for the benefit of any extension modules
  4093. that may be conditionalizing on it). A bonus is that any extension
  4094. type participating in cyclic gc can choose to participate in the
  4095. Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
  4096. to require editing the core to teach the trashcan mechanism about the
  4097. new type.
  4098. - According to Annex F of the current C standard,
  4099. The Standard C macro HUGE_VAL and its float and long double analogs,
  4100. HUGE_VALF and HUGE_VALL, expand to expressions whose values are
  4101. positive infinities.
  4102. Python only uses the double HUGE_VAL, and only to #define its own symbol
  4103. Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
  4104. pyport.h used to try to worm around that, but the workarounds triggered
  4105. other bugs on other platforms, so we gave up. If your platform defines
  4106. HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
  4107. that works on your platform. The only instance of this I'm sure about
  4108. is on an unknown subset of Cray systems, described here:
  4109. http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
  4110. Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
  4111. - The configure option --without-doc-strings can be used to remove the
  4112. doc strings from the builtin functions and modules; this reduces the
  4113. size of the executable.
  4114. - The universal newlines option (PEP 278) is on by default. On Unix
  4115. it can be disabled by passing --without-universal-newlines to the
  4116. configure script. On other platforms, remove
  4117. WITH_UNIVERSAL_NEWLINES from pyconfig.h.
  4118. - On Unix, a shared libpython2.3.so can be created with --enable-shared.
  4119. - All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
  4120. preprocessor symbols were eliminated. The internal decisions they
  4121. controlled stopped being experimental long ago.
  4122. - The tools used to build the documentation now work under Cygwin as
  4123. well as Unix.
  4124. - The bsddb and dbm module builds have been changed to try and avoid version
  4125. skew problems and disable linkage with Berkeley DB 1.85 unless the
  4126. installer knows what s/he's doing. See the section on building these
  4127. modules in the README file for details.
  4128. C API
  4129. -----
  4130. - PyNumber_Check() now returns true for string and unicode objects.
  4131. This is a result of these types having a partially defined
  4132. tp_as_number slot. (This is not a feature, but an indication that
  4133. PyNumber_Check() is not very useful to determine numeric behavior.
  4134. It may be deprecated.)
  4135. - The string object's layout has changed: the pointer member
  4136. ob_sinterned has been replaced by an int member ob_sstate. On some
  4137. platforms (e.g. most 64-bit systems) this may change the offset of
  4138. the ob_sval member, so as a precaution the API_VERSION has been
  4139. incremented. The apparently unused feature of "indirect interned
  4140. strings", supported by the ob_sinterned member, is gone. Interned
  4141. strings are now usually mortal; there is a new API,
  4142. PyString_InternImmortal() that creates immortal interned strings.
  4143. (The ob_sstate member can only take three values; however, while
  4144. making it a char saves a few bytes per string object on average, in
  4145. it also slowed things down a bit because ob_sval was no longer
  4146. aligned.)
  4147. - The Py_InitModule*() functions now accept NULL for the 'methods'
  4148. argument. Modules without global functions are becoming more common
  4149. now that factories can be types rather than functions.
  4150. - New C API PyUnicode_FromOrdinal() which exposes unichr() at C
  4151. level.
  4152. - New functions PyErr_SetExcFromWindowsErr() and
  4153. PyErr_SetExcFromWindowsErrWithFilename(). Similar to
  4154. PyErr_SetFromWindowsErrWithFilename() and
  4155. PyErr_SetFromWindowsErr(), but they allow to specify
  4156. the exception type to raise. Available on Windows.
  4157. - Py_FatalError() is now declared as taking a const char* argument. It
  4158. was previously declared without const. This should not affect working
  4159. code.
  4160. - Added new macro PySequence_ITEM(o, i) that directly calls
  4161. sq_item without rechecking that o is a sequence and without
  4162. adjusting for negative indices.
  4163. - PyRange_New() now raises ValueError if the fourth argument is not 1.
  4164. This is part of the removal of deprecated features of the xrange
  4165. object.
  4166. - PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
  4167. coercion if both arguments have the same type but this type has the
  4168. CHECKTYPES flag set. This is to better support proxies.
  4169. - The type of tp_free has been changed from "``void (*)(PyObject *)``" to
  4170. "``void (*)(void *)``".
  4171. - PyObject_Del, PyObject_GC_Del are now functions instead of macros.
  4172. - A type can now inherit its metatype from its base type. Previously,
  4173. when PyType_Ready() was called, if ob_type was found to be NULL, it
  4174. was always set to &PyType_Type; now it is set to base->ob_type,
  4175. where base is tp_base, defaulting to &PyObject_Type.
  4176. - PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
  4177. - The PyCore_* family of APIs have been removed.
  4178. - The "u#" parser marker will now pass through Unicode objects as-is
  4179. without going through the buffer API.
  4180. - The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
  4181. - An old #define of ANY as void has been removed from pyport.h. This
  4182. hasn't been used since Python's pre-ANSI days, and the #define has
  4183. been marked as obsolete since then. SF bug 495548 says it created
  4184. conflicts with other packages, so keeping it around wasn't harmless.
  4185. - Because Python's magic number scheme broke on January 1st, we decided
  4186. to stop Python development. Thanks for all the fish!
  4187. - Some of us don't like fish, so we changed Python's magic number
  4188. scheme to a new one. See Python/import.c for details.
  4189. New platforms
  4190. -------------
  4191. - OpenVMS is now supported.
  4192. - AtheOS is now supported.
  4193. - the EMX runtime environment on OS/2 is now supported.
  4194. - GNU/Hurd is now supported.
  4195. Tests
  4196. -----
  4197. - The regrtest.py script's -u option now provides a way to say "allow
  4198. all resources except this one." For example, to allow everything
  4199. except bsddb, give the option '-uall,-bsddb'.
  4200. Windows
  4201. -------
  4202. - The Windows distribution now ships with version 4.0.14 of the
  4203. Sleepycat Berkeley database library. This should be a huge
  4204. improvement over the previous Berkeley DB 1.85, which had many
  4205. bugs.
  4206. XXX What are the licensing issues here?
  4207. XXX If a user has a database created with a previous version of
  4208. XXX Python, what must they do to convert it?
  4209. XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
  4210. XXX The version # is likely to change before 2.3a1.
  4211. - The Windows distribution now ships with a Secure Sockets Library (SLL)
  4212. module (_ssl.pyd)
  4213. - The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
  4214. previously shipped with Tcl/Tk 8.3.2).
  4215. - When Python is built under a Microsoft compiler, sys.version now
  4216. includes the compiler version number (_MSC_VER). For example, under
  4217. MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
  4218. the value of _MSC_VER under MSVC 6.
  4219. - Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
  4220. of that has been fixed in the installer (disabled Wise's "delete in-
  4221. use files" uninstall option).
  4222. - Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
  4223. - The installer now installs Start menu shortcuts under (the local
  4224. equivalent of) "All Users" when doing an Admin install.
  4225. - file.truncate([newsize]) now works on Windows for all newsize values.
  4226. It used to fail if newsize didn't fit in 32 bits, reflecting a
  4227. limitation of MS _chsize (which is no longer used).
  4228. - os.waitpid() is now implemented for Windows, and can be used to block
  4229. until a specified process exits. This is similar to, but not exactly
  4230. the same as, os.waitpid() on POSIX systems. If you're waiting for
  4231. a specific process whose pid was obtained from one of the spawn()
  4232. functions, the same Python os.waitpid() code works across platforms.
  4233. See the docs for details. The docs were changed to clarify that
  4234. spawn functions return, and waitpid requires, a process handle on
  4235. Windows (not the same thing as a Windows process id).
  4236. - New tempfile.TemporaryFile implementation for Windows: this doesn't
  4237. need a TemporaryFileWrapper wrapper anymore, and should be immune
  4238. to a nasty problem: before 2.3, if you got a temp file on Windows, it
  4239. got wrapped in an object whose close() method first closed the
  4240. underlying file, then deleted the file. This usually worked fine.
  4241. However, the spawn family of functions on Windows create (at a low C
  4242. level) the same set of open files in the spawned process Q as were
  4243. open in the spawning process P. If a temp file f was among them, then
  4244. doing f.close() in P first closed P's C-level file handle on f, but Q's
  4245. C-level file handle on f remained open, so the attempt in P to delete f
  4246. blew up with a "Permission denied" error (Windows doesn't allow
  4247. deleting open files). This was surprising, subtle, and difficult to
  4248. work around.
  4249. - The os module now exports all the symbolic constants usable with the
  4250. low-level os.open() on Windows: the new constants in 2.3 are
  4251. O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
  4252. The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
  4253. O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
  4254. to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
  4255. (so specify both if you want both; note that neither is useful unless
  4256. specified with O_CREAT too).
  4257. Mac
  4258. ----
  4259. - Mac/Relnotes is gone, the release notes are now here.
  4260. - Python (the OSX-only, unix-based version, not the OS9-compatible CFM
  4261. version) now fully supports unicode strings as arguments to various file
  4262. system calls, eg. open(), file(), os.stat() and os.listdir().
  4263. - The current naming convention for Python on the Macintosh is that MacPython
  4264. refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
  4265. CFM-based version that runs on both OS9 and OSX.
  4266. - All MacPython-OS9 functionality is now available in an OSX unix build,
  4267. including the Carbon modules, the IDE, OSA support, etc. A lot of this
  4268. will only work correctly in a framework build, though, because you cannot
  4269. talk to the window manager unless your application is run from a .app
  4270. bundle. There is a command line tool "pythonw" that runs your script
  4271. with an interpreter living in such a .app bundle, this interpreter should
  4272. be used to run any Python script using the window manager (including
  4273. Tkinter or wxPython scripts).
  4274. - Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
  4275. MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
  4276. are specifically for MacPython-OS9 (CFM support, preference resources, etc).
  4277. - A new utility PythonLauncher will start a Python interpreter when a .py or
  4278. .pyw script is double-clicked in the Finder. By default .py scripts are
  4279. run with a normal Python interpreter in a Terminal window and .pyw
  4280. files are run with a window-aware pythonw interpreter without a Terminal
  4281. window, but all this can be customized.
  4282. - MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
  4283. possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
  4284. releases.
  4285. - Many tools such as BuildApplet.py and gensuitemodule.py now support a command
  4286. line interface too.
  4287. - All the Carbon classes are now PEP253 compliant, meaning that you can
  4288. subclass them from Python. Most of the attributes have gone, you should
  4289. now use the accessor function call API, which is also what Apple's
  4290. documentation uses. Some attributes such as grafport.visRgn are still
  4291. available for convenience.
  4292. - New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
  4293. and Folder (APIs from Folders.h). The old macfs builtin module is
  4294. gone, and replaced by a Python wrapper around the new modules.
  4295. - Pathname handling should now be fully consistent: MacPython-OSX always uses
  4296. unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
  4297. (also when running on Mac OS X).
  4298. - New Carbon modules Help and AH give access to the Carbon Help Manager.
  4299. There are hooks in the IDE to allow accessing the Python documentation
  4300. (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
  4301. See Mac/OSX/README for converting the Python documentation to a
  4302. Help Viewer compatible form and installing it.
  4303. - OSA support has been redesigned and the generated Python classes now
  4304. mirror the inheritance defined by the underlying OSA classes.
  4305. - MacPython no longer maps both \r and \n to \n on input for any text file.
  4306. This feature has been replaced by universal newline support (PEP278).
  4307. - The default encoding for Python sourcefiles in MacPython-OS9 is no longer
  4308. mac-roman (or whatever your local Mac encoding was) but "ascii", like on
  4309. other platforms. If you really need sourcefiles with Mac characters in them
  4310. you can change this in site.py.
  4311. What's New in Python 2.2 final?
  4312. ===============================
  4313. *Release date: 21-Dec-2001*
  4314. Type/class unification and new-style classes
  4315. --------------------------------------------
  4316. - pickle.py, cPickle: allow pickling instances of new-style classes
  4317. with a custom metaclass.
  4318. Core and builtins
  4319. -----------------
  4320. - weakref proxy object: when comparing, unwrap both arguments if both
  4321. are proxies.
  4322. Extension modules
  4323. -----------------
  4324. - binascii.b2a_base64(): fix a potential buffer overrun when encoding
  4325. very short strings.
  4326. - cPickle: the obscure "fast" mode was suspected of causing stack
  4327. overflows on the Mac. Hopefully fixed this by setting the recursion
  4328. limit much smaller. If the limit is too low (it only affects
  4329. performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
  4330. when compiling cPickle.c (or in pyconfig.h).
  4331. Library
  4332. -------
  4333. - dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
  4334. close or delete time).
  4335. - rfc822.py: fixed a bug where the address '<>' was converted to None
  4336. instead of an empty string (also fixes the email.Utils module).
  4337. - xmlrpclib.py: version 1.0.0; uses precision for doubles.
  4338. - test suite: the pickle and cPickle tests were not executing any code
  4339. when run from the standard regression test.
  4340. Tools/Demos
  4341. -----------
  4342. Build
  4343. -----
  4344. C API
  4345. -----
  4346. New platforms
  4347. -------------
  4348. Tests
  4349. -----
  4350. Windows
  4351. -------
  4352. - distutils package: fixed broken Windows installers (bdist_wininst).
  4353. - tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
  4354. instances are deleted at process exit time.
  4355. - socket.py: prevent mysterious warnings when socket instances are
  4356. deleted at process exit time.
  4357. - posixmodule.c: fix a Windows crash with stat() of a filename ending
  4358. in backslash.
  4359. Mac
  4360. ----
  4361. - The Carbon toolbox modules have been upgraded to Universal Headers
  4362. 3.4, and experimental CoreGraphics and CarbonEvents modules have
  4363. been added. All only for framework-enabled MacOSX.
  4364. What's New in Python 2.2c1?
  4365. ===========================
  4366. *Release date: 14-Dec-2001*
  4367. Type/class unification and new-style classes
  4368. --------------------------------------------
  4369. - Guido's tutorial introduction to the new type/class features has
  4370. been extensively updated. See
  4371. http://www.python.org/2.2/descrintro.html
  4372. That remains the primary documentation in this area.
  4373. - Fixed a leak: instance variables declared with __slots__ were never
  4374. deleted!
  4375. - The "delete attribute" method of descriptor objects is called
  4376. __delete__, not __del__. In previous releases, it was mistakenly
  4377. called __del__, which created an unfortunate overloading condition
  4378. with finalizers. (The "get attribute" and "set attribute" methods
  4379. are still called __get__ and __set__, respectively.)
  4380. - Some subtle issues with the super built-in were fixed:
  4381. (a) When super itself is subclassed, its __get__ method would still
  4382. return an instance of the base class (i.e., of super).
  4383. (b) super(C, C()).__class__ would return C rather than super. This
  4384. is confusing. To fix this, I decided to change the semantics of
  4385. super so that it only applies to code attributes, not to data
  4386. attributes. After all, overriding data attributes is not
  4387. supported anyway.
  4388. (c) The __get__ method didn't check whether the argument was an
  4389. instance of the type used in creation of the super instance.
  4390. - Previously, hash() of an instance of a subclass of a mutable type
  4391. (list or dictionary) would return some value, rather than raising
  4392. TypeError. This has been fixed. Also, directly calling
  4393. dict.__hash__ and list.__hash__ now raises the same TypeError
  4394. (previously, these were the same as object.__hash__).
  4395. - New-style objects now support deleting their __dict__. This is for
  4396. all intents and purposes equivalent to assigning a brand new empty
  4397. dictionary, but saves space if the object is not used further.
  4398. Core and builtins
  4399. -----------------
  4400. - -Qnew now works as documented in PEP 238: when -Qnew is passed on
  4401. the command line, all occurrences of "/" use true division instead
  4402. of classic division. See the PEP for details. Note that "all"
  4403. means all instances in library and 3rd-party modules, as well as in
  4404. your own code. As the PEP says, -Qnew is intended for use only in
  4405. educational environments with control over the libraries in use.
  4406. Note that test_coercion.py in the standard Python test suite fails
  4407. under -Qnew; this is expected, and won't be repaired until true
  4408. division becomes the default (in the meantime, test_coercion is
  4409. testing the current rules).
  4410. - complex() now only allows the first argument to be a string
  4411. argument, and raises TypeError if either the second arg is a string
  4412. or if the second arg is specified when the first is a string.
  4413. Extension modules
  4414. -----------------
  4415. - gc.get_referents was renamed to gc.get_referrers.
  4416. Library
  4417. -------
  4418. - Functions in the os.spawn() family now release the global interpreter
  4419. lock around calling the platform spawn. They should always have done
  4420. this, but did not before 2.2c1. Multithreaded programs calling
  4421. an os.spawn function with P_WAIT will no longer block all Python threads
  4422. until the spawned program completes. It's possible that some programs
  4423. relies on blocking, although more likely by accident than by design.
  4424. - webbrowser defaults to netscape.exe on OS/2 now.
  4425. - Tix.ResizeHandle exposes detach_widget, hide, and show.
  4426. - The charset alias windows_1252 has been added.
  4427. - types.StringTypes is a tuple containing the defined string types;
  4428. usually this will be (str, unicode), but if Python was compiled
  4429. without Unicode support it will be just (str,).
  4430. - The pulldom and minidom modules were synchronized to PyXML.
  4431. Tools/Demos
  4432. -----------
  4433. - A new script called Tools/scripts/google.py was added, which fires
  4434. off a search on Google.
  4435. Build
  4436. -----
  4437. - Note that release builds of Python should arrange to define the
  4438. preprocessor symbol NDEBUG on the command line (or equivalent).
  4439. In the 2.2 pre-release series we tried to define this by magic in
  4440. Python.h instead, but it proved to cause problems for extension
  4441. authors. The Unix, Windows and Mac builds now all define NDEBUG in
  4442. release builds via cmdline (or equivalent) instead. Ports to
  4443. other platforms should do likewise.
  4444. - It is no longer necessary to use --with-suffix when building on a
  4445. case-insensitive file system (such as Mac OS X HFS+). In the build
  4446. directory an extension is used, but not in the installed python.
  4447. C API
  4448. -----
  4449. - New function PyDict_MergeFromSeq2() exposes the builtin dict
  4450. constructor's logic for updating a dictionary from an iterable object
  4451. producing key-value pairs.
  4452. - PyArg_ParseTupleAndKeywords() requires that the number of entries in
  4453. the keyword list equal the number of argument specifiers. This
  4454. wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
  4455. dump core in some bad cases. This has been repaired. As a result,
  4456. PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
  4457. previously went unchallenged.
  4458. New platforms
  4459. -------------
  4460. Tests
  4461. -----
  4462. Windows
  4463. -------
  4464. Mac
  4465. ----
  4466. - In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
  4467. without any trailing digits.
  4468. - Changed logic for finding python home in Mac OS X framework Pythons.
  4469. Now sys.executable points to the executable again, in stead of to
  4470. the shared library. The latter is used only for locating the python
  4471. home.
  4472. What's New in Python 2.2b2?
  4473. ===========================
  4474. *Release date: 16-Nov-2001*
  4475. Type/class unification and new-style classes
  4476. --------------------------------------------
  4477. - Multiple inheritance mixing new-style and classic classes in the
  4478. list of base classes is now allowed, so this works now:
  4479. class Classic: pass
  4480. class Mixed(Classic, object): pass
  4481. The MRO (method resolution order) for each base class is respected
  4482. according to its kind, but the MRO for the derived class is computed
  4483. using new-style MRO rules if any base class is a new-style class.
  4484. This needs to be documented.
  4485. - The new builtin dictionary() constructor, and dictionary type, have
  4486. been renamed to dict. This reflects a decade of common usage.
  4487. - dict() now accepts an iterable object producing 2-sequences. For
  4488. example, dict(d.items()) == d for any dictionary d. The argument,
  4489. and the elements of the argument, can be any iterable objects.
  4490. - New-style classes can now have a __del__ method, which is called
  4491. when the instance is deleted (just like for classic classes).
  4492. - Assignment to object.__dict__ is now possible, for objects that are
  4493. instances of new-style classes that have a __dict__ (unless the base
  4494. class forbids it).
  4495. - Methods of built-in types now properly check for keyword arguments
  4496. (formerly these were silently ignored). The only built-in methods
  4497. that take keyword arguments are __call__, __init__ and __new__.
  4498. - The socket function has been converted to a type; see below.
  4499. Core and builtins
  4500. -----------------
  4501. - Assignment to __debug__ raises SyntaxError at compile-time. This
  4502. was promised when 2.1c1 was released as "What's New in Python 2.1c1"
  4503. (see below) says.
  4504. - Clarified the error messages for unsupported operands to an operator
  4505. (like 1 + '').
  4506. Extension modules
  4507. -----------------
  4508. - mmap has a new keyword argument, "access", allowing a uniform way for
  4509. both Windows and Unix users to create read-only, write-through and
  4510. copy-on-write memory mappings. This was previously possible only on
  4511. Unix. A new keyword argument was required to support this in a
  4512. uniform way because the mmap() signatures had diverged across
  4513. platforms. Thanks to Jay T Miller for repairing this!
  4514. - By default, the gc.garbage list now contains only those instances in
  4515. unreachable cycles that have __del__ methods; in 2.1 it contained all
  4516. instances in unreachable cycles. "Instances" here has been generalized
  4517. to include instances of both new-style and old-style classes.
  4518. - The socket module defines a new method for socket objects,
  4519. sendall(). This is like send() but may make multiple calls to
  4520. send() until all data has been sent. Also, the socket function has
  4521. been converted to a subclassable type, like list and tuple (etc.)
  4522. before it; socket and SocketType are now the same thing.
  4523. - Various bugfixes to the curses module. There is now a test suite
  4524. for the curses module (you have to run it manually).
  4525. - binascii.b2a_base64 no longer places an arbitrary restriction of 57
  4526. bytes on its input.
  4527. Library
  4528. -------
  4529. - tkFileDialog exposes a Directory class and askdirectory
  4530. convenience function.
  4531. - Symbolic group names in regular expressions must be unique. For
  4532. example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
  4533. single name can't mean both "group 1" and "group 2" simultaneously.
  4534. Python 2.2 detects this error at regexp compilation time;
  4535. previously, the error went undetected, and results were
  4536. unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
  4537. pattern.subn() methods have been rewritten in C. Also, an
  4538. experimental function/method finditer() has been added, which works
  4539. like findall() but returns an iterator.
  4540. - Tix exposes more commands through the classes DirSelectBox,
  4541. DirSelectDialog, ListNoteBook, Meter, CheckList, and the
  4542. methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
  4543. tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
  4544. - Traceback objects are now scanned by cyclic garbage collection, so
  4545. cycles created by casual use of sys.exc_info() no longer cause
  4546. permanent memory leaks (provided garbage collection is enabled).
  4547. - os.extsep -- a new variable needed by the RISCOS support. It is the
  4548. separator used by extensions, and is '.' on all platforms except
  4549. RISCOS, where it is '/'. There is no need to use this variable
  4550. unless you have a masochistic desire to port your code to RISCOS.
  4551. - mimetypes.py has optional support for non-standard, but commonly
  4552. found types. guess_type() and guess_extension() now accept an
  4553. optional 'strict' flag, defaulting to true, which controls whether
  4554. recognize non-standard types or not. A few non-standard types we
  4555. know about have been added. Also, when run as a script, there are
  4556. new -l and -e options.
  4557. - statcache is now deprecated.
  4558. - email.Utils.formatdate() now produces the preferred RFC 2822 style
  4559. dates with numeric timezones (it used to produce obsolete dates
  4560. hard coded to "GMT" timezone). An optional 'localtime' flag is
  4561. added to produce dates in the local timezone, with daylight savings
  4562. time properly taken into account.
  4563. - In pickle and cPickle, instead of masking errors in load() by
  4564. transforming them into SystemError, we let the original exception
  4565. propagate out. Also, implement support for __safe_for_unpickling__
  4566. in pickle, as it already was supported in cPickle.
  4567. Tools/Demos
  4568. -----------
  4569. Build
  4570. -----
  4571. - The dbm module is built using libdb1 if available. The bsddb module
  4572. is built with libdb3 if available.
  4573. - Misc/Makefile.pre.in has been removed by BDFL pronouncement.
  4574. C API
  4575. -----
  4576. - New function PySequence_Fast_GET_SIZE() returns the size of a non-
  4577. NULL result from PySequence_Fast(), more quickly than calling
  4578. PySequence_Size().
  4579. - New argument unpacking function PyArg_UnpackTuple() added.
  4580. - New functions PyObject_CallFunctionObjArgs() and
  4581. PyObject_CallMethodObjArgs() have been added to make it more
  4582. convenient and efficient to call functions and methods from C.
  4583. - PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
  4584. possible that this will propagate errors it didn't before.
  4585. - New function PyObject_CheckReadBuffer(), which returns true if its
  4586. argument supports the single-segment readable buffer interface.
  4587. New platforms
  4588. -------------
  4589. - We've finally confirmed that this release builds on HP-UX 11.00,
  4590. *with* threads, and passes the test suite.
  4591. - Thanks to a series of patches from Michael Muller, Python may build
  4592. again under OS/2 Visual Age C++.
  4593. - Updated RISCOS port by Dietmar Schwertberger.
  4594. Tests
  4595. -----
  4596. - Added a test script for the curses module. It isn't run automatically;
  4597. regrtest.py must be run with '-u curses' to enable it.
  4598. Windows
  4599. -------
  4600. Mac
  4601. ----
  4602. - PythonScript has been moved to unsupported and is slated to be
  4603. removed completely in the next release.
  4604. - It should now be possible to build applets that work on both OS9 and
  4605. OSX.
  4606. - The core is now linked with CoreServices not Carbon; as a side
  4607. result, default 8bit encoding on OSX is now ASCII.
  4608. - Python should now build on OSX 10.1.1
  4609. What's New in Python 2.2b1?
  4610. ===========================
  4611. *Release date: 19-Oct-2001*
  4612. Type/class unification and new-style classes
  4613. --------------------------------------------
  4614. - New-style classes are now always dynamic (except for built-in and
  4615. extension types). There is no longer a performance penalty, and I
  4616. no longer see another reason to keep this baggage around. One relic
  4617. remains: the __dict__ of a new-style class is a read-only proxy; you
  4618. must set the class's attribute to modify it. As a consequence, the
  4619. __defined__ attribute of new-style types no longer exists, for lack
  4620. of need: there is once again only one __dict__ (although in the
  4621. future a __cache__ may be resurrected with a similar function, if I
  4622. can prove that it actually speeds things up).
  4623. - C.__doc__ now works as expected for new-style classes (in 2.2a4 it
  4624. always returned None, even when there was a class docstring).
  4625. - doctest now finds and runs docstrings attached to new-style classes,
  4626. class methods, static methods, and properties.
  4627. Core and builtins
  4628. -----------------
  4629. - A very subtle syntactical pitfall in list comprehensions was fixed.
  4630. For example: [a+b for a in 'abc', for b in 'def']. The comma in
  4631. this example is a mistake. Previously, this would silently let 'a'
  4632. iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
  4633. 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
  4634. 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
  4635. Note that [a for a in <singleton>] is a convoluted way to say
  4636. [<singleton>] anyway, so it's not like any expressiveness is lost.
  4637. - getattr(obj, name, default) now only catches AttributeError, as
  4638. documented, rather than returning the default value for all
  4639. exceptions (which could mask bugs in a __getattr__ hook, for
  4640. example).
  4641. - Weak reference objects are now part of the core and offer a C API.
  4642. A bug which could allow a core dump when binary operations involved
  4643. proxy reference has been fixed. weakref.ReferenceError is now a
  4644. built-in exception.
  4645. - unicode(obj) now behaves more like str(obj), accepting arbitrary
  4646. objects, and calling a __unicode__ method if it exists.
  4647. unicode(obj, encoding) and unicode(obj, encoding, errors) still
  4648. require an 8-bit string or character buffer argument.
  4649. - isinstance() now allows any object as the first argument and a
  4650. class, a type or something with a __bases__ tuple attribute for the
  4651. second argument. The second argument may also be a tuple of a
  4652. class, type, or something with __bases__, in which case isinstance()
  4653. will return true if the first argument is an instance of any of the
  4654. things contained in the second argument tuple. E.g.
  4655. isinstance(x, (A, B))
  4656. returns true if x is an instance of A or B.
  4657. Extension modules
  4658. -----------------
  4659. - thread.start_new_thread() now returns the thread ID (previously None).
  4660. - binascii has now two quopri support functions, a2b_qp and b2a_qp.
  4661. - readline now supports setting the startup_hook and the
  4662. pre_event_hook, and adds the add_history() function.
  4663. - os and posix supports chroot(), setgroups() and unsetenv() where
  4664. available. The stat(), fstat(), statvfs() and fstatvfs() functions
  4665. now return "pseudo-sequences" -- the various fields can now be
  4666. accessed as attributes (e.g. os.stat("/").st_mtime) but for
  4667. backwards compatibility they also behave as a fixed-length sequence.
  4668. Some platform-specific fields (e.g. st_rdev) are only accessible as
  4669. attributes.
  4670. - time: localtime(), gmtime() and strptime() now return a
  4671. pseudo-sequence similar to the os.stat() return value, with
  4672. attributes like tm_year etc.
  4673. - Decompression objects in the zlib module now accept an optional
  4674. second parameter to decompress() that specifies the maximum amount
  4675. of memory to use for the uncompressed data.
  4676. - optional SSL support in the socket module now exports OpenSSL
  4677. functions RAND_add(), RAND_egd(), and RAND_status(). These calls
  4678. are useful on platforms like Solaris where OpenSSL does not
  4679. automatically seed its PRNG. Also, the keyfile and certfile
  4680. arguments to socket.ssl() are now optional.
  4681. - posixmodule (and by extension, the os module on POSIX platforms) now
  4682. exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
  4683. Library
  4684. -------
  4685. - doctest now excludes functions and classes not defined by the module
  4686. being tested, thanks to Tim Hochberg.
  4687. - HotShot, a new profiler implemented using a C-based callback, has
  4688. been added. This substantially reduces the overhead of profiling,
  4689. but it is still quite preliminary. Support modules and
  4690. documentation will be added in upcoming releases (before 2.2 final).
  4691. - profile now produces correct output in situations where an exception
  4692. raised in Python is cleared by C code (e.g. hasattr()). This used
  4693. to cause wrong output, including spurious claims of recursive
  4694. functions and attribution of time spent to the wrong function.
  4695. The code and documentation for the derived OldProfile and HotProfile
  4696. profiling classes was removed. The code hasn't worked for years (if
  4697. you tried to use them, they raised exceptions). OldProfile
  4698. intended to reproduce the behavior of the profiler Python used more
  4699. than 7 years ago, and isn't interesting anymore. HotProfile intended
  4700. to provide a faster profiler (but producing less information), and
  4701. that's a worthy goal we intend to meet via a different approach (but
  4702. without losing information).
  4703. - Profile.calibrate() has a new implementation that should deliver
  4704. a much better system-specific calibration constant. The constant can
  4705. now be specified in an instance constructor, or as a Profile class or
  4706. instance variable, instead of by editing profile.py's source code.
  4707. Calibration must still be done manually (see the docs for the profile
  4708. module).
  4709. Note that Profile.calibrate() must be overridden by subclasses.
  4710. Improving the accuracy required exploiting detailed knowledge of
  4711. profiler internals; the earlier method abstracted away the details
  4712. and measured a simplified model instead, but consequently computed
  4713. a constant too small by a factor of 2 on some modern machines.
  4714. - quopri's encode and decode methods take an optional header parameter,
  4715. which indicates whether output is intended for the header 'Q'
  4716. encoding.
  4717. - The SocketServer.ThreadingMixIn class now closes the request after
  4718. finish_request() returns. (Not when it errors out though.)
  4719. - The nntplib module's NNTP.body() method has grown a 'file' argument
  4720. to allow saving the message body to a file.
  4721. - The email package has added a class email.Parser.HeaderParser which
  4722. only parses headers and does not recurse into the message's body.
  4723. Also, the module/class MIMEAudio has been added for representing
  4724. audio data (contributed by Anthony Baxter).
  4725. - ftplib should be able to handle files > 2GB.
  4726. - ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
  4727. ON, and OFF.
  4728. - xml.dom.minidom NodeList objects now support the length attribute
  4729. and item() method as required by the DOM specifications.
  4730. Tools/Demos
  4731. -----------
  4732. - Demo/dns was removed. It no longer serves any purpose; a package
  4733. derived from it is now maintained by Anthony Baxter, see
  4734. http://PyDNS.SourceForge.net.
  4735. - The freeze tool has been made more robust, and two new options have
  4736. been added: -X and -E.
  4737. Build
  4738. -----
  4739. - configure will use CXX in LINKCC if CXX is used to build main() and
  4740. the system requires to link a C++ main using the C++ compiler.
  4741. C API
  4742. -----
  4743. - The documentation for the tp_compare slot is updated to require that
  4744. the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
  4745. not correct. This is not yet enforced but will be enforced in
  4746. Python 2.3; even later, we may use -2 to indicate errors and +2 for
  4747. "NotImplemented". Right now, -1 should be used for an error return.
  4748. - PyLong_AsLongLong() now accepts int (as well as long) arguments.
  4749. Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
  4750. as long) arguments.
  4751. - PyThread_start_new_thread() now returns a long int giving the thread
  4752. ID, if one can be calculated; it returns -1 for error, 0 if no
  4753. thread ID is calculated (this is an incompatible change, but only
  4754. the thread module used this API). This code has only really been
  4755. tested on Linux and Windows; other platforms please beware (and
  4756. report any bugs or strange behavior).
  4757. - PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
  4758. input.
  4759. New platforms
  4760. -------------
  4761. Tests
  4762. -----
  4763. Windows
  4764. -------
  4765. - Installer: If you install IDLE, and don't disable file-extension
  4766. registration, a new "Edit with IDLE" context (right-click) menu entry
  4767. is created for .py and .pyw files.
  4768. - The signal module now supports SIGBREAK on Windows, thanks to Steven
  4769. Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
  4770. action remains to call Win32 ExitProcess(). This can be changed via
  4771. signal.signal(). For example::
  4772. # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
  4773. # (SIGINT) behavior.
  4774. import signal
  4775. signal.signal(signal.SIGBREAK, signal.default_int_handler)
  4776. try:
  4777. while 1:
  4778. pass
  4779. except KeyboardInterrupt:
  4780. # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
  4781. # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
  4782. # program without the possibility for any Python-level cleanup).
  4783. print "Clean exit"
  4784. What's New in Python 2.2a4?
  4785. ===========================
  4786. *Release date: 28-Sep-2001*
  4787. Type/class unification and new-style classes
  4788. --------------------------------------------
  4789. - pydoc and inspect are now aware of new-style classes;
  4790. e.g. help(list) at the interactive prompt now shows proper
  4791. documentation for all operations on list objects.
  4792. - Applications using Jim Fulton's ExtensionClass module can now safely
  4793. be used with Python 2.2. In particular, Zope 2.4.1 now works with
  4794. Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
  4795. examples also work again. It is hoped that Gtk and Boost also work
  4796. with 2.2a4 and beyond. (If you can confirm this, please write
  4797. webmaster@python.org; if there are still problems, please open a bug
  4798. report on SourceForge.)
  4799. - property() now takes 4 keyword arguments: fget, fset, fdel and doc.
  4800. These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
  4801. in the constructed property object. fget, fset and fdel weren't
  4802. discoverable from Python in 2.2a3. __doc__ is new, and allows to
  4803. associate a docstring with a property.
  4804. - Comparison overloading is now more completely implemented. For
  4805. example, a str subclass instance can properly be compared to a str
  4806. instance, and it can properly overload comparison. Ditto for most
  4807. other built-in object types.
  4808. - The repr() of new-style classes has changed; instead of <type
  4809. 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
  4810. *except* for built-in types, which are still rendered as <type
  4811. 'Foo'> (to avoid upsetting existing code that might parse or
  4812. otherwise rely on repr() of certain type objects).
  4813. - The repr() of new-style objects is now always <Foo object at XXX>;
  4814. previously, it was sometimes <Foo instance at XXX>.
  4815. - For new-style classes, what was previously called __getattr__ is now
  4816. called __getattribute__. This method, if defined, is called for
  4817. *every* attribute access. A new __getattr__ hook more similar to the
  4818. one in classic classes is defined which is called only if regular
  4819. attribute access raises AttributeError; to catch *all* attribute
  4820. access, you can use __getattribute__ (for new-style classes). If
  4821. both are defined, __getattribute__ is called first, and if it raises
  4822. AttributeError, __getattr__ is called.
  4823. - The __class__ attribute of new-style objects can be assigned to.
  4824. The new class must have the same C-level object layout as the old
  4825. class.
  4826. - The builtin file type can be subclassed now. In the usual pattern,
  4827. "file" is the name of the builtin type, and file() is a new builtin
  4828. constructor, with the same signature as the builtin open() function.
  4829. file() is now the preferred way to open a file.
  4830. - Previously, __new__ would only see sequential arguments passed to
  4831. the type in a constructor call; __init__ would see both sequential
  4832. and keyword arguments. This made no sense whatsoever any more, so
  4833. now both __new__ and __init__ see all arguments.
  4834. - Previously, hash() applied to an instance of a subclass of str or
  4835. unicode always returned 0. This has been repaired.
  4836. - Previously, an operation on an instance of a subclass of an
  4837. immutable type (int, long, float, complex, tuple, str, unicode),
  4838. where the subtype didn't override the operation (and so the
  4839. operation was handled by the builtin type), could return that
  4840. instance instead a value of the base type. For example, if s was of
  4841. a str subclass type, s[:] returned s as-is. Now it returns a str
  4842. with the same value as s.
  4843. - Provisional support for pickling new-style objects has been added.
  4844. Core
  4845. ----
  4846. - file.writelines() now accepts any iterable object producing strings.
  4847. - PyUnicode_FromEncodedObject() now works very much like
  4848. PyObject_Str(obj) in that it tries to use __str__/tp_str
  4849. on the object if the object is not a string or buffer. This
  4850. makes unicode() behave like str() when applied to non-string/buffer
  4851. objects.
  4852. - PyFile_WriteObject now passes Unicode objects to the file's write
  4853. method. As a result, all file-like objects which may be the target
  4854. of a print statement must support Unicode objects, i.e. they must
  4855. at least convert them into ASCII strings.
  4856. - Thread scheduling on Solaris should be improved; it is no longer
  4857. necessary to insert a small sleep at the start of a thread in order
  4858. to let other runnable threads be scheduled.
  4859. Library
  4860. -------
  4861. - StringIO.StringIO instances and cStringIO.StringIO instances support
  4862. read character buffer compatible objects for their .write() methods.
  4863. These objects are converted to strings and then handled as such
  4864. by the instances.
  4865. - The "email" package has been added. This is basically a port of the
  4866. mimelib package <http://sf.net/projects/mimelib> with API changes
  4867. and some implementations updated to use iterators and generators.
  4868. - difflib.ndiff() and difflib.Differ.compare() are generators now. This
  4869. restores the ability of Tools/scripts/ndiff.py to start producing output
  4870. before the entire comparison is complete.
  4871. - StringIO.StringIO instances and cStringIO.StringIO instances support
  4872. iteration just like file objects (i.e. their .readline() method is
  4873. called for each iteration until it returns an empty string).
  4874. - The codecs module has grown four new helper APIs to access
  4875. builtin codecs: getencoder(), getdecoder(), getreader(),
  4876. getwriter().
  4877. - SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
  4878. simplifies writing XML RPC servers.
  4879. - os.path.realpath(): a new function that returns the absolute pathname
  4880. after interpretation of symbolic links. On non-Unix systems, this
  4881. is an alias for os.path.abspath().
  4882. - operator.indexOf() (PySequence_Index() in the C API) now works with any
  4883. iterable object.
  4884. - smtplib now supports various authentication and security features of
  4885. the SMTP protocol through the new login() and starttls() methods.
  4886. - hmac: a new module implementing keyed hashing for message
  4887. authentication.
  4888. - mimetypes now recognizes more extensions and file types. At the
  4889. same time, some mappings not sanctioned by IANA were removed.
  4890. - The "compiler" package has been brought up to date to the state of
  4891. Python 2.2 bytecode generation. It has also been promoted from a
  4892. Tool to a standard library package. (Tools/compiler still exists as
  4893. a sample driver.)
  4894. Build
  4895. -----
  4896. - Large file support (LFS) is now automatic when the platform supports
  4897. it; no more manual configuration tweaks are needed. On Linux, at
  4898. least, it's possible to have a system whose C library supports large
  4899. files but whose kernel doesn't; in this case, large file support is
  4900. still enabled but doesn't do you any good unless you upgrade your
  4901. kernel or share your Python executable with another system whose
  4902. kernel has large file support.
  4903. - The configure script now supplies plausible defaults in a
  4904. cross-compilation environment. This doesn't mean that the supplied
  4905. values are always correct, or that cross-compilation now works
  4906. flawlessly -- but it's a first step (and it shuts up most of
  4907. autoconf's warnings about AC_TRY_RUN).
  4908. - The Unix build is now a bit less chatty, courtesy of the parser
  4909. generator. The build is completely silent (except for errors) when
  4910. using "make -s", thanks to a -q option to setup.py.
  4911. C API
  4912. -----
  4913. - The "structmember" API now supports some new flag bits to deny read
  4914. and/or write access to attributes in restricted execution mode.
  4915. New platforms
  4916. -------------
  4917. - Compaq's iPAQ handheld, running the "familiar" Linux distribution
  4918. (http://familiar.handhelds.org).
  4919. Tests
  4920. -----
  4921. - The "classic" standard tests, which work by comparing stdout to
  4922. an expected-output file under Lib/test/output/, no longer stop at
  4923. the first mismatch. Instead the test is run to completion, and a
  4924. variant of ndiff-style comparison is used to report all differences.
  4925. This is much easier to understand than the previous style of reporting.
  4926. - The unittest-based standard tests now use regrtest's test_main()
  4927. convention, instead of running as a side-effect of merely being
  4928. imported. This allows these tests to be run in more natural and
  4929. flexible ways as unittests, outside the regrtest framework.
  4930. - regrtest.py is much better integrated with unittest and doctest now,
  4931. especially in regard to reporting errors.
  4932. Windows
  4933. -------
  4934. - Large file support now also works for files > 4GB, on filesystems
  4935. that support it (NTFS under Windows 2000). See "What's New in
  4936. Python 2.2a3" for more detail.
  4937. What's New in Python 2.2a3?
  4938. ===========================
  4939. *Release Date: 07-Sep-2001*
  4940. Core
  4941. ----
  4942. - Conversion of long to float now raises OverflowError if the long is too
  4943. big to represent as a C double.
  4944. - The 3-argument builtin pow() no longer allows a third non-None argument
  4945. if either of the first two arguments is a float, or if both are of
  4946. integer types and the second argument is negative (in which latter case
  4947. the arguments are converted to float, so this is really the same
  4948. restriction).
  4949. - The builtin dir() now returns more information, and sometimes much
  4950. more, generally naming all attributes of an object, and all attributes
  4951. reachable from the object via its class, and from its class's base
  4952. classes, and so on from them too. Example: in 2.2a2, dir([]) returned
  4953. an empty list. In 2.2a3,
  4954. >>> dir([])
  4955. ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
  4956. '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
  4957. '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
  4958. '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
  4959. '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
  4960. 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
  4961. 'reverse', 'sort']
  4962. dir(module) continues to return only the module's attributes, though.
  4963. - Overflowing operations on plain ints now return a long int rather
  4964. than raising OverflowError. This is a partial implementation of PEP
  4965. 237. You can use -Wdefault::OverflowWarning to enable a warning for
  4966. this situation, and -Werror::OverflowWarning to revert to the old
  4967. OverflowError exception.
  4968. - A new command line option, -Q<arg>, is added to control run-time
  4969. warnings for the use of classic division. (See PEP 238.) Possible
  4970. values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
  4971. -Qold, meaning the / operator has its classic meaning and no
  4972. warnings are issued. Using -Qwarn issues a run-time warning about
  4973. all uses of classic division for int and long arguments; -Qwarnall
  4974. also warns about classic division for float and complex arguments
  4975. (for use with fixdiv.py).
  4976. [Note: the remainder of this item (preserved below) became
  4977. obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
  4978. Using -Qnew is questionable; it turns on new division by default, but
  4979. only in the __main__ module. You can usefully combine -Qwarn or
  4980. -Qwarnall and -Qnew: this gives the __main__ module new division, and
  4981. warns about classic division everywhere else.
  4982. - Many built-in types can now be subclassed. This applies to int,
  4983. long, float, str, unicode, and tuple. (The types complex, list and
  4984. dictionary can also be subclassed; this was introduced earlier.)
  4985. Note that restrictions apply when subclassing immutable built-in
  4986. types: you can only affect the value of the instance by overloading
  4987. __new__. You can add mutable attributes, and the subclass instances
  4988. will have a __dict__ attribute, but you cannot change the "value"
  4989. (as implemented by the base class) of an immutable subclass instance
  4990. once it is created.
  4991. - The dictionary constructor now takes an optional argument, a
  4992. mapping-like object, and initializes the dictionary from its
  4993. (key, value) pairs.
  4994. - A new built-in type, super, has been added. This facilitates making
  4995. "cooperative super calls" in a multiple inheritance setting. For an
  4996. explanation, see http://www.python.org/2.2/descrintro.html#cooperation
  4997. - A new built-in type, property, has been added. This enables the
  4998. creation of "properties". These are attributes implemented by
  4999. getter and setter functions (or only one of these for read-only or
  5000. write-only attributes), without the need to override __getattr__.
  5001. See http://www.python.org/2.2/descrintro.html#property
  5002. - The syntax of floating-point and imaginary literals has been
  5003. liberalized, to allow leading zeroes. Examples of literals now
  5004. legal that were SyntaxErrors before:
  5005. 00.0 0e3 0100j 07.5 00000000000000000008.
  5006. - An old tokenizer bug allowed floating point literals with an incomplete
  5007. exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
  5008. Library
  5009. -------
  5010. - telnetlib includes symbolic names for the options, and support for
  5011. setting an option negotiation callback. It also supports processing
  5012. of suboptions.
  5013. - The new C standard no longer requires that math libraries set errno to
  5014. ERANGE on overflow. For platform libraries that exploit this new
  5015. freedom, Python's overflow-checking was wholly broken. A new overflow-
  5016. checking scheme attempts to repair that, but may not be reliable on all
  5017. platforms (C doesn't seem to provide anything both useful and portable
  5018. in this area anymore).
  5019. - Asynchronous timeout actions are available through the new class
  5020. threading.Timer.
  5021. - math.log and math.log10 now return sensible results for even huge
  5022. long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
  5023. - A new function, imp.lock_held(), returns 1 when the import lock is
  5024. currently held. See the docs for the imp module.
  5025. - pickle, cPickle and marshal on 32-bit platforms can now correctly read
  5026. dumps containing ints written on platforms where Python ints are 8 bytes.
  5027. When read on a box where Python ints are 4 bytes, such values are
  5028. converted to Python longs.
  5029. - In restricted execution mode (using the rexec module), unmarshalling
  5030. code objects is no longer allowed. This plugs a security hole.
  5031. - unittest.TestResult instances no longer store references to tracebacks
  5032. generated by test failures. This prevents unexpected dangling references
  5033. to objects that should be garbage collected between tests.
  5034. Tools
  5035. -----
  5036. - Tools/scripts/fixdiv.py has been added which can be used to fix
  5037. division operators as per PEP 238.
  5038. Build
  5039. -----
  5040. - If you are an adventurous person using Mac OS X you may want to look at
  5041. Mac/OSX. There is a Makefile there that will build Python as a real Mac
  5042. application, which can be used for experimenting with Carbon or Cocoa.
  5043. Discussion of this on pythonmac-sig, please.
  5044. C API
  5045. -----
  5046. - New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
  5047. - Note that PyLong_AsDouble can fail! This has always been true, but no
  5048. callers checked for it. It's more likely to fail now, because overflow
  5049. errors are properly detected now. The proper way to check::
  5050. double x = PyLong_AsDouble(some_long_object);
  5051. if (x == -1.0 && PyErr_Occurred()) {
  5052. /* The conversion failed. */
  5053. }
  5054. - The GC API has been changed. Extensions that use the old API will still
  5055. compile but will not participate in GC. To upgrade an extension
  5056. module:
  5057. - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
  5058. - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
  5059. PyObject_GC_Del to deallocate them
  5060. - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
  5061. to PyObject_GC_UnTrack
  5062. - remove PyGC_HEAD_SIZE from object size calculations
  5063. - remove calls to PyObject_AS_GC and PyObject_FROM_GC
  5064. - Two new functions: PyString_FromFormat() and PyString_FromFormatV().
  5065. These can be used safely to construct string objects from a
  5066. sprintf-style format string (similar to the format string supported
  5067. by PyErr_Format()).
  5068. New platforms
  5069. -------------
  5070. - Stephen Hansen contributed patches sufficient to get a clean compile
  5071. under Borland C (Windows), but he reports problems running it and ran
  5072. out of time to complete the port. Volunteers? Expect a MemoryError
  5073. when importing the types module; this is probably shallow, and
  5074. causing later failures too.
  5075. Tests
  5076. -----
  5077. Windows
  5078. -------
  5079. - Large file support is now enabled on Win32 platforms as well as on
  5080. Win64. This means that, for example, you can use f.tell() and f.seek()
  5081. to manipulate files larger than 2 gigabytes (provided you have enough
  5082. disk space, and are using a Windows filesystem that supports large
  5083. partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
  5084. filesize limit, and large file support makes no difference there.
  5085. FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
  5086. NTFS has no practical limit on file size, and files of any size can be
  5087. used from Python now.
  5088. - The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
  5089. points to command.com (patch from Brian Quinlan).
  5090. What's New in Python 2.2a2?
  5091. ===========================
  5092. *Release Date: 22-Aug-2001*
  5093. Build
  5094. -----
  5095. - Tim Peters developed a brand new Windows installer using Wise 8.1,
  5096. generously donated to us by Wise Solutions.
  5097. - configure supports a new option --enable-unicode, with the values
  5098. ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
  5099. type and supporting code is completely removed from the interpreter.
  5100. - A new configure option --enable-framework builds a Mac OS X framework,
  5101. which "make frameworkinstall" will install. This provides a starting
  5102. point for more mac-like functionality, join pythonmac-sig@python.org
  5103. if you are interested in helping.
  5104. - The NeXT platform is no longer supported.
  5105. - The 'new' module is now statically linked.
  5106. Tools
  5107. -----
  5108. - The new Tools/scripts/cleanfuture.py can be used to automatically
  5109. edit out obsolete future statements from Python source code. See
  5110. the module docstring for details.
  5111. Tests
  5112. -----
  5113. - regrtest.py now knows which tests are expected to be skipped on some
  5114. platforms, allowing to give clearer test result output. regrtest
  5115. also has optional --use/-u switch to run normally disabled tests
  5116. which require network access or consume significant disk resources.
  5117. - Several new tests in the standard test suite, with special thanks to
  5118. Nick Mathewson.
  5119. Core
  5120. ----
  5121. - The floor division operator // has been added as outlined in PEP
  5122. 238. The / operator still provides classic division (and will until
  5123. Python 3.0) unless "from __future__ import division" is included, in
  5124. which case the / operator will provide true division. The operator
  5125. module provides truediv() and floordiv() functions. Augmented
  5126. assignment variants are included, as are the equivalent overloadable
  5127. methods and C API methods. See the PEP for a full discussion:
  5128. <http://python.sf.net/peps/pep-0238.html>
  5129. - Future statements are now effective in simulated interactive shells
  5130. (like IDLE). This should "just work" by magic, but read Michael
  5131. Hudson's "Future statements in simulated shells" PEP 264 for full
  5132. details: <http://python.sf.net/peps/pep-0264.html>.
  5133. - The type/class unification (PEP 252-253) was integrated into the
  5134. trunk and is not so tentative any more (the exact specification of
  5135. some features is still tentative). A lot of work has done on fixing
  5136. bugs and adding robustness and features (performance still has to
  5137. come a long way).
  5138. - Warnings about a mismatch in the Python API during extension import
  5139. now use the Python warning framework (which makes it possible to
  5140. write filters for these warnings).
  5141. - A function's __dict__ (aka func_dict) will now always be a
  5142. dictionary. It used to be possible to delete it or set it to None,
  5143. but now both actions raise TypeErrors. It is still legal to set it
  5144. to a dictionary object. Getting func.__dict__ before any attributes
  5145. have been assigned now returns an empty dictionary instead of None.
  5146. - A new command line option, -E, was added which disables the use of
  5147. all environment variables, or at least those that are specifically
  5148. significant to Python. Usually those have a name starting with
  5149. "PYTHON". This was used to fix a problem where the tests fail if
  5150. the user happens to have PYTHONHOME or PYTHONPATH pointing to an
  5151. older distribution.
  5152. Library
  5153. -------
  5154. - New class Differ and new functions ndiff() and restore() in difflib.py.
  5155. These package the algorithms used by the popular Tools/scripts/ndiff.py,
  5156. for programmatic reuse.
  5157. - New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
  5158. value using the minimal quoting required for the value; more
  5159. reliable than using xml.sax.saxutils.escape() for attribute values.
  5160. - Readline completion support for cmd.Cmd was added.
  5161. - Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
  5162. - Added function threading.BoundedSemaphore()
  5163. - Added Ka-Ping Yee's cgitb.py module.
  5164. - The 'new' module now exposes the CO_xxx flags.
  5165. - The gc module offers the get_referents function.
  5166. New platforms
  5167. -------------
  5168. C API
  5169. -----
  5170. - Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
  5171. which provide a cross-platform implementations for the
  5172. relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
  5173. the standard sprintf() and vsprintf() C lib APIs, these versions
  5174. apply bounds checking on the used buffer which enhances protection
  5175. against buffer overruns.
  5176. - Unicode APIs now use name mangling to assure that mixing interpreters
  5177. and extensions using different Unicode widths is rendered next to
  5178. impossible. Trying to import an incompatible Unicode-aware extension
  5179. will result in an ImportError. Unicode extensions writers must make
  5180. sure to check the Unicode width compatibility in their extensions by
  5181. using at least one of the mangled Unicode APIs in the extension.
  5182. - Two new flags METH_NOARGS and METH_O are available in method definition
  5183. tables to simplify implementation of methods with no arguments and a
  5184. single untyped argument. Calling such methods is more efficient than
  5185. calling corresponding METH_VARARGS methods. METH_OLDARGS is now
  5186. deprecated.
  5187. Windows
  5188. -------
  5189. - "import module" now compiles module.pyw if it exists and nothing else
  5190. relevant is found.
  5191. What's New in Python 2.2a1?
  5192. ===========================
  5193. *Release date: 18-Jul-2001*
  5194. Core
  5195. ----
  5196. - TENTATIVELY, a large amount of code implementing much of what's
  5197. described in PEP 252 (Making Types Look More Like Classes) and PEP
  5198. 253 (Subtyping Built-in Types) was added. This will be released
  5199. with Python 2.2a1. Documentation will be provided separately
  5200. through http://www.python.org/2.2/. The purpose of releasing this
  5201. with Python 2.2a1 is to test backwards compatibility. It is
  5202. possible, though not likely, that a decision is made not to release
  5203. this code as part of 2.2 final, if any serious backwards
  5204. incompatibilities are found during alpha testing that cannot be
  5205. repaired.
  5206. - Generators were added; this is a new way to create an iterator (see
  5207. below) using what looks like a simple function containing one or
  5208. more 'yield' statements. See PEP 255. Since this adds a new
  5209. keyword to the language, this feature must be enabled by including a
  5210. future statement: "from __future__ import generators" (see PEP 236).
  5211. Generators will become a standard feature in a future release
  5212. (probably 2.3). Without this future statement, 'yield' remains an
  5213. ordinary identifier, but a warning is issued each time it is used.
  5214. (These warnings currently don't conform to the warnings framework of
  5215. PEP 230; we intend to fix this in 2.2a2.)
  5216. - The UTF-16 codec was modified to be more RFC compliant. It will now
  5217. only remove BOM characters at the start of the string and then
  5218. only if running in native mode (UTF-16-LE and -BE won't remove a
  5219. leading BMO character).
  5220. - Strings now have a new method .decode() to complement the already
  5221. existing .encode() method. These two methods provide direct access
  5222. to the corresponding decoders and encoders of the registered codecs.
  5223. To enhance the usability of the .encode() method, the special
  5224. casing of Unicode object return values was dropped (Unicode objects
  5225. were auto-magically converted to string using the default encoding).
  5226. Both methods will now return whatever the codec in charge of the
  5227. requested encoding returns as object, e.g. Unicode codecs will
  5228. return Unicode objects when decoding is requested ("äöü".decode("latin-1")
  5229. will return u"äöü"). This enables codec writer to create codecs
  5230. for various simple to use conversions.
  5231. New codecs were added to demonstrate these new features (the .encode()
  5232. and .decode() columns indicate the type of the returned objects):
  5233. +---------+-----------+-----------+-----------------------------+
  5234. |Name | .encode() | .decode() | Description |
  5235. +=========+===========+===========+=============================+
  5236. |uu | string | string | UU codec (e.g. for email) |
  5237. +---------+-----------+-----------+-----------------------------+
  5238. |base64 | string | string | base64 codec |
  5239. +---------+-----------+-----------+-----------------------------+
  5240. |quopri | string | string | quoted-printable codec |
  5241. +---------+-----------+-----------+-----------------------------+
  5242. |zlib | string | string | zlib compression |
  5243. +---------+-----------+-----------+-----------------------------+
  5244. |hex | string | string | 2-byte hex codec |
  5245. +---------+-----------+-----------+-----------------------------+
  5246. |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
  5247. +---------+-----------+-----------+-----------------------------+
  5248. - Some operating systems now support the concept of a default Unicode
  5249. encoding for file system operations. Notably, Windows supports 'mbcs'
  5250. as the default. The Macintosh will also adopt this concept in the medium
  5251. term, although the default encoding for that platform will be other than
  5252. 'mbcs'.
  5253. On operating system that support non-ASCII filenames, it is common for
  5254. functions that return filenames (such as os.listdir()) to return Python
  5255. string objects pre-encoded using the default file system encoding for
  5256. the platform. As this encoding is likely to be different from Python's
  5257. default encoding, converting this name to a Unicode object before passing
  5258. it back to the Operating System would result in a Unicode error, as Python
  5259. would attempt to use its default encoding (generally ASCII) rather than
  5260. the default encoding for the file system.
  5261. In general, this change simply removes surprises when working with
  5262. Unicode and the file system, making these operations work as you expect,
  5263. increasing the transparency of Unicode objects in this context.
  5264. See [????] for more details, including examples.
  5265. - Float (and complex) literals in source code were evaluated to full
  5266. precision only when running from a .py file; the same code loaded from a
  5267. .pyc (or .pyo) file could suffer numeric differences starting at about the
  5268. 12th significant decimal digit. For example, on a machine with IEEE-754
  5269. floating arithmetic,
  5270. x = 9007199254740992.0
  5271. print long(x)
  5272. printed 9007199254740992 if run directly from .py, but 9007199254740000
  5273. if from a compiled (.pyc or .pyo) file. This was due to marshal using
  5274. str(float) instead of repr(float) when building code objects. marshal
  5275. now uses repr(float) instead, which should reproduce floats to full
  5276. machine precision (assuming the platform C float<->string I/O conversion
  5277. functions are of good quality).
  5278. This may cause floating-point results to change in some cases, and
  5279. usually for the better, but may also cause numerically unstable
  5280. algorithms to break.
  5281. - The implementation of dicts suffers fewer collisions, which has speed
  5282. benefits. However, the order in which dict entries appear in dict.keys(),
  5283. dict.values() and dict.items() may differ from previous releases for a
  5284. given dict. Nothing is defined about this order, so no program should
  5285. rely on it. Nevertheless, it's easy to write test cases that rely on the
  5286. order by accident, typically because of printing the str() or repr() of a
  5287. dict to an "expected results" file. See Lib/test/test_support.py's new
  5288. sortdict(dict) function for a simple way to display a dict in sorted
  5289. order.
  5290. - Many other small changes to dicts were made, resulting in faster
  5291. operation along the most common code paths.
  5292. - Dictionary objects now support the "in" operator: "x in dict" means
  5293. the same as dict.has_key(x).
  5294. - The update() method of dictionaries now accepts generic mapping
  5295. objects. Specifically the argument object must support the .keys()
  5296. and __getitem__() methods. This allows you to say, for example,
  5297. {}.update(UserDict())
  5298. - Iterators were added; this is a generalized way of providing values
  5299. to a for loop. See PEP 234. There's a new built-in function iter()
  5300. to return an iterator. There's a new protocol to get the next value
  5301. from an iterator using the next() method (in Python) or the
  5302. tp_iternext slot (in C). There's a new protocol to get iterators
  5303. using the __iter__() method (in Python) or the tp_iter slot (in C).
  5304. Iterating (i.e. a for loop) over a dictionary generates its keys.
  5305. Iterating over a file generates its lines.
  5306. - The following functions were generalized to work nicely with iterator
  5307. arguments::
  5308. map(), filter(), reduce(), zip()
  5309. list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
  5310. max(), min()
  5311. join() method of strings
  5312. extend() method of lists
  5313. 'x in y' and 'x not in y' (PySequence_Contains() in C API)
  5314. operator.countOf() (PySequence_Count() in C API)
  5315. right-hand side of assignment statements with multiple targets, such as ::
  5316. x, y, z = some_iterable_object_returning_exactly_3_values
  5317. - Accessing module attributes is significantly faster (for example,
  5318. random.random or os.path or yourPythonModule.yourAttribute).
  5319. - Comparing dictionary objects via == and != is faster, and now works even
  5320. if the keys and values don't support comparisons other than ==.
  5321. - Comparing dictionaries in ways other than == and != is slower: there were
  5322. insecurities in the dict comparison implementation that could cause Python
  5323. to crash if the element comparison routines for the dict keys and/or
  5324. values mutated the dicts. Making the code bulletproof slowed it down.
  5325. - Collisions in dicts are resolved via a new approach, which can help
  5326. dramatically in bad cases. For example, looking up every key in a dict
  5327. d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
  5328. faster now. Thanks to Christian Tismer for pointing out the cause and
  5329. the nature of an effective cure (last December! better late than never).
  5330. - repr() is much faster for large containers (dict, list, tuple).
  5331. Library
  5332. -------
  5333. - The constants ascii_letters, ascii_lowercase. and ascii_uppercase
  5334. were added to the string module. These a locale-independent
  5335. constants, unlike letters, lowercase, and uppercase. These are now
  5336. use in appropriate locations in the standard library.
  5337. - The flags used in dlopen calls can now be configured using
  5338. sys.setdlopenflags and queried using sys.getdlopenflags.
  5339. - Fredrik Lundh's xmlrpclib is now a standard library module. This
  5340. provides full client-side XML-RPC support. In addition,
  5341. Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
  5342. one asyncore-based). Thanks to Eric Raymond for the documentation.
  5343. - The xrange() object is simplified: it no longer supports slicing,
  5344. repetition, comparisons, efficient 'in' checking, the tolist()
  5345. method, or the start, stop and step attributes. See PEP 260.
  5346. - A new function fnmatch.filter to filter lists of file names was added.
  5347. - calendar.py uses month and day names based on the current locale.
  5348. - strop is now *really* obsolete (this was announced before with 1.6),
  5349. and issues DeprecationWarning when used (except for the four items
  5350. that are still imported into string.py).
  5351. - Cookie.py now sorts key+value pairs by key in output strings.
  5352. - pprint.isrecursive(object) didn't correctly identify recursive objects.
  5353. Now it does.
  5354. - pprint functions now much faster for large containers (tuple, list, dict).
  5355. - New 'q' and 'Q' format codes in the struct module, corresponding to C
  5356. types "long long" and "unsigned long long" (on Windows, __int64). In
  5357. native mode, these can be used only when the platform C compiler supports
  5358. these types (when HAVE_LONG_LONG is #define'd by the Python config
  5359. process), and then they inherit the sizes and alignments of the C types.
  5360. In standard mode, 'q' and 'Q' are supported on all platforms, and are
  5361. 8-byte integral types.
  5362. - The site module installs a new built-in function 'help' that invokes
  5363. pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
  5364. it displays a message reminding the user to use 'help()' or
  5365. 'help(object)'.
  5366. Tests
  5367. -----
  5368. - New test_mutants.py runs dict comparisons where the key and value
  5369. comparison operators mutate the dicts randomly during comparison. This
  5370. rapidly causes Python to crash under earlier releases (not for the faint
  5371. of heart: it can also cause Win9x to freeze or reboot!).
  5372. - New test_pprint.py verifies that pprint.isrecursive() and
  5373. pprint.isreadable() return sensible results. Also verifies that simple
  5374. cases produce correct output.
  5375. C API
  5376. -----
  5377. - Removed the unused last_is_sticky argument from the internal
  5378. _PyTuple_Resize(). If this affects you, you were cheating.
  5379. What's New in Python 2.1 (final)?
  5380. =================================
  5381. We only changed a few things since the last release candidate, all in
  5382. Python library code:
  5383. - A bug in the locale module was fixed that affected locales which
  5384. define no grouping for numeric formatting.
  5385. - A few bugs in the weakref module's implementations of weak
  5386. dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
  5387. and the test suite was updated to check for these bugs.
  5388. - An old bug in the os.path.walk() function (introduced in Python
  5389. 2.0!) was fixed: a non-existent file would cause an exception
  5390. instead of being ignored.
  5391. - Fixed a few bugs in the new symtable module found by Neil Norwitz's
  5392. PyChecker.
  5393. What's New in Python 2.1c2?
  5394. ===========================
  5395. A flurry of small changes, and one showstopper fixed in the nick of
  5396. time made it necessary to release another release candidate. The list
  5397. here is the *complete* list of patches (except version updates):
  5398. Core
  5399. - Tim discovered a nasty bug in the dictionary code, caused by
  5400. PyDict_Next() calling dict_resize(), and the GC code's use of
  5401. PyDict_Next() violating an assumption in dict_items(). This was
  5402. fixed with considerable amounts of band-aid, but the net effect is a
  5403. saner and more robust implementation.
  5404. - Made a bunch of symbols static that were accidentally global.
  5405. Build and Ports
  5406. - The setup.py script didn't check for a new enough version of zlib
  5407. (1.1.3 is needed). Now it does.
  5408. - Changed "make clean" target to also remove shared libraries.
  5409. - Added a more general warning about the SGI Irix optimizer to README.
  5410. Library
  5411. - Fix a bug in urllib.basejoin("http://host", "../file.html") which
  5412. omitted the slash between host and file.html.
  5413. - The mailbox module's _Mailbox class contained a completely broken
  5414. and undocumented seek() method. Ripped it out.
  5415. - Fixed a bunch of typos in various library modules (urllib2, smtpd,
  5416. sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
  5417. - Fixed a few last-minute bugs in unittest.
  5418. Extensions
  5419. - Reverted the patch to the OpenSSL code in socketmodule.c to support
  5420. RAND_status() and the EGD, and the subsequent patch that tried to
  5421. fix it for pre-0.9.5 versions; the problem with the patch is that on
  5422. some systems it issues a warning whenever socket is imported, and
  5423. that's unacceptable.
  5424. Tests
  5425. - Fixed the pickle tests to work with "import test.test_pickle".
  5426. - Tweaked test_locale.py to actually run the test Windows.
  5427. - In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
  5428. not "wb" (which is not a valid mode at all).
  5429. - Fix pstats browser crashes. Import readline if it exists to make
  5430. the user interface nicer.
  5431. - Add "import thread" to the top of test modules that import the
  5432. threading module (test_asynchat and test_threadedtempfile). This
  5433. prevents test failures caused by a broken threading module resulting
  5434. from a previously caught failed import.
  5435. - Changed test_asynchat.py to set the SO_REUSEADDR option; this was
  5436. needed on some platforms (e.g. Solaris 8) when the tests are run
  5437. twice in succession.
  5438. - Skip rather than fail test_sunaudiodev if no audio device is found.
  5439. What's New in Python 2.1c1?
  5440. ===========================
  5441. This list was significantly updated when 2.1c2 was released; the 2.1c1
  5442. release didn't mention most changes that were actually part of 2.1c1:
  5443. Legal
  5444. - Copyright was assigned to the Python Software Foundation (PSF) and a
  5445. PSF license (very similar to the CNRI license) was added.
  5446. - The CNRI copyright notice was updated to include 2001.
  5447. Core
  5448. - After a public outcry, assignment to __debug__ is no longer illegal;
  5449. instead, a warning is issued. It will become illegal in 2.2.
  5450. - Fixed a core dump with "%#x" % 0, and changed the semantics so that
  5451. "%#x" now always prepends "0x", even if the value is zero.
  5452. - Fixed some nits in the bytecode compiler.
  5453. - Fixed core dumps when calling certain kinds of non-functions.
  5454. - Fixed various core dumps caused by reference count bugs.
  5455. Build and Ports
  5456. - Use INSTALL_SCRIPT to install script files.
  5457. - New port: SCO Unixware 7, by Billy G. Allie.
  5458. - Updated RISCOS port.
  5459. - Updated BeOS port and notes.
  5460. - Various other porting problems resolved.
  5461. Library
  5462. - The TERMIOS and SOCKET modules are now truly obsolete and
  5463. unnecessary. Their symbols are incorporated in the termios and
  5464. socket modules.
  5465. - Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
  5466. better tests for pickling.
  5467. - threading: make Condition.wait() robust against KeyboardInterrupt.
  5468. - zipfile: add support to zipfile to support opening an archive
  5469. represented by an open file rather than a file name. Fix bug where
  5470. the archive was not properly closed. Fixed a bug in this bugfix
  5471. where flush() was called for a read-only file.
  5472. - imputil: added an uninstall() method to the ImportManager.
  5473. - Canvas: fixed bugs in lower() and tkraise() methods.
  5474. - SocketServer: API change (added overridable close_request() method)
  5475. so that the TCP server can explicitly close the request.
  5476. - pstats: Eric Raymond added a simple interactive statistics browser,
  5477. invoked when the module is run as a script.
  5478. - locale: fixed a problem in format().
  5479. - webbrowser: made it work when the BROWSER environment variable has a
  5480. value like "/usr/bin/netscape". Made it auto-detect Konqueror for
  5481. KDE 2. Fixed some other nits.
  5482. - unittest: changes to allow using a different exception than
  5483. AssertionError, and added a few more function aliases. Some other
  5484. small changes.
  5485. - urllib, urllib2: fixed redirect problems and a coupleof other nits.
  5486. - asynchat: fixed a critical bug in asynchat that slipped through the
  5487. 2.1b2 release. Fixed another rare bug.
  5488. - Fix some unqualified except: clauses (always a bad code example).
  5489. XML
  5490. - pyexpat: new API get_version_string().
  5491. - Fixed some minidom bugs.
  5492. Extensions
  5493. - Fixed a core dump in _weakref. Removed the weakref.mapping()
  5494. function (it adds nothing to the API).
  5495. - Rationalized the use of header files in the readline module, to make
  5496. it compile (albeit with some warnings) with the very recent readline
  5497. 4.2, without breaking for earlier versions.
  5498. - Hopefully fixed a buffering problem in linuxaudiodev.
  5499. - Attempted a fix to make the OpenSSL support in the socket module
  5500. work again with pre-0.9.5 versions of OpenSSL.
  5501. Tests
  5502. - Added a test case for asynchat and asyncore.
  5503. - Removed coupling between tests where one test failing could break
  5504. another.
  5505. Tools
  5506. - Ping added an interactive help browser to pydoc, fixed some nits
  5507. in the rest of the pydoc code, and added some features to his
  5508. inspect module.
  5509. - An updated python-mode.el version 4.1 which integrates Ken
  5510. Manheimer's pdbtrack.el. This makes debugging Python code via pdb
  5511. much nicer in XEmacs and Emacs. When stepping through your program
  5512. with pdb, in either the shell window or the *Python* window, the
  5513. source file and line will be tracked by an arrow. Very cool!
  5514. - IDLE: syntax warnings in interactive mode are changed into errors.
  5515. - Some improvements to Tools/webchecker (ignore some more URL types,
  5516. follow some more links).
  5517. - Brought the Tools/compiler package up to date.
  5518. What's New in Python 2.1 beta 2?
  5519. ================================
  5520. (Unlisted are many fixed bugs, more documentation, etc.)
  5521. Core language, builtins, and interpreter
  5522. - The nested scopes work (enabled by "from __future__ import
  5523. nested_scopes") is completed; in particular, the future now extends
  5524. into code executed through exec, eval() and execfile(), and into the
  5525. interactive interpreter.
  5526. - When calling a base class method (e.g. BaseClass.__init__(self)),
  5527. this is now allowed even if self is not strictly spoken a class
  5528. instance (e.g. when using metaclasses or the Don Beaudry hook).
  5529. - Slice objects are now comparable but not hashable; this prevents
  5530. dict[:] from being accepted but meaningless.
  5531. - Complex division is now calculated using less braindead algorithms.
  5532. This doesn't change semantics except it's more likely to give useful
  5533. results in extreme cases. Complex repr() now uses full precision
  5534. like float repr().
  5535. - sgmllib.py now calls handle_decl() for simple <!...> declarations.
  5536. - It is illegal to assign to the name __debug__, which is set when the
  5537. interpreter starts. It is effectively a compile-time constant.
  5538. - A warning will be issued if a global statement for a variable
  5539. follows a use or assignment of that variable.
  5540. Standard library
  5541. - unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
  5542. inspired by JUnit), is now part of the standard library. You now
  5543. have a choice of two testing frameworks: unittest requires you to
  5544. write testcases as separate code, doctest gathers them from
  5545. docstrings. Both approaches have their advantages and
  5546. disadvantages.
  5547. - A new module Tix was added, which wraps the Tix extension library
  5548. for Tk. With that module, it is not necessary to statically link
  5549. Tix with _tkinter, since Tix will be loaded with Tcl's "package
  5550. require" command. See Demo/tix/.
  5551. - tzparse.py is now obsolete.
  5552. - In gzip.py, the seek() and tell() methods are removed -- they were
  5553. non-functional anyway, and it's better if callers can test for their
  5554. existence with hasattr().
  5555. Python/C API
  5556. - PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
  5557. that's already in the dictionary during a PyDict_Next() iteration.
  5558. This used to fail occasionally when a dictionary resize operation
  5559. could be triggered that would rehash all the keys. All other
  5560. modifications to the dictionary are still off-limits during a
  5561. PyDict_Next() iteration!
  5562. - New extended APIs related to passing compiler variables around.
  5563. - New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
  5564. implement isinstance() and issubclass().
  5565. - Py_BuildValue() now has a "D" conversion to create a Python complex
  5566. number from a Py_complex C value.
  5567. - Extensions types which support weak references must now set the
  5568. field allocated for the weak reference machinery to NULL themselves;
  5569. this is done to avoid the cost of checking each object for having a
  5570. weakly referencable type in PyObject_INIT(), since most types are
  5571. not weakly referencable.
  5572. - PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
  5573. free variables and cell variables to and from the frame's f_locals.
  5574. - Variants of several functions defined in pythonrun.h have been added
  5575. to support the nested_scopes future statement. The variants all end
  5576. in Flags and take an extra argument, a PyCompilerFlags *; examples:
  5577. PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
  5578. variants may be removed in Python 2.2, when nested scopes are
  5579. mandatory.
  5580. Distutils
  5581. - the sdist command now writes a PKG-INFO file, as described in PEP 241,
  5582. into the release tree.
  5583. - several enhancements to the bdist_wininst command from Thomas Heller
  5584. (an uninstaller, more customization of the installer's display)
  5585. - from Jack Jansen: added Mac-specific code to generate a dialog for
  5586. users to specify the command-line (because providing a command-line with
  5587. MacPython is awkward). Jack also made various fixes for the Mac
  5588. and the Metrowerks compiler.
  5589. - added 'platforms' and 'keywords' to the set of metadata that can be
  5590. specified for a distribution.
  5591. - applied patches from Jason Tishler to make the compiler class work with
  5592. Cygwin.
  5593. What's New in Python 2.1 beta 1?
  5594. ================================
  5595. Core language, builtins, and interpreter
  5596. - Following an outcry from the community about the amount of code
  5597. broken by the nested scopes feature introduced in 2.1a2, we decided
  5598. to make this feature optional, and to wait until Python 2.2 (or at
  5599. least 6 months) to make it standard. The option can be enabled on a
  5600. per-module basis by adding "from __future__ import nested_scopes" at
  5601. the beginning of a module (before any other statements, but after
  5602. comments and an optional docstring). See PEP 236 (Back to the
  5603. __future__) for a description of the __future__ statement. PEP 227
  5604. (Statically Nested Scopes) has been updated to reflect this change,
  5605. and to clarify the semantics in a number of endcases.
  5606. - The nested scopes code, when enabled, has been hardened, and most
  5607. bugs and memory leaks in it have been fixed.
  5608. - Compile-time warnings are now generated for a number of conditions
  5609. that will break or change in meaning when nested scopes are enabled:
  5610. - Using "from...import *" or "exec" without in-clause in a function
  5611. scope that also defines a lambda or nested function with one or
  5612. more free (non-local) variables. The presence of the import* or
  5613. bare exec makes it impossible for the compiler to determine the
  5614. exact set of local variables in the outer scope, which makes it
  5615. impossible to determine the bindings for free variables in the
  5616. inner scope. To avoid the warning about import *, change it into
  5617. an import of explicitly name object, or move the import* statement
  5618. to the global scope; to avoid the warning about bare exec, use
  5619. exec...in... (a good idea anyway -- there's a possibility that
  5620. bare exec will be deprecated in the future).
  5621. - Use of a global variable in a nested scope with the same name as a
  5622. local variable in a surrounding scope. This will change in
  5623. meaning with nested scopes: the name in the inner scope will
  5624. reference the variable in the outer scope rather than the global
  5625. of the same name. To avoid the warning, either rename the outer
  5626. variable, or use a global statement in the inner function.
  5627. - An optional object allocator has been included. This allocator is
  5628. optimized for Python objects and should be faster and use less memory
  5629. than the standard system allocator. It is not enabled by default
  5630. because of possible thread safety problems. The allocator is only
  5631. protected by the Python interpreter lock and it is possible that some
  5632. extension modules require a thread safe allocator. The object
  5633. allocator can be enabled by providing the "--with-pymalloc" option to
  5634. configure.
  5635. Standard library
  5636. - pyexpat now detects the expat version if expat.h defines it. A
  5637. number of additional handlers are provided, which are only available
  5638. since expat 1.95. In addition, the methods SetParamEntityParsing and
  5639. GetInputContext of Parser objects are available with 1.95.x
  5640. only. Parser objects now provide the ordered_attributes and
  5641. specified_attributes attributes. A new module expat.model was added,
  5642. which offers a number of additional constants if 1.95.x is used.
  5643. - xml.dom offers the new functions registerDOMImplementation and
  5644. getDOMImplementation.
  5645. - xml.dom.minidom offers a toprettyxml method. A number of DOM
  5646. conformance issues have been resolved. In particular, Element now
  5647. has an hasAttributes method, and the handling of namespaces was
  5648. improved.
  5649. - Ka-Ping Yee contributed two new modules: inspect.py, a module for
  5650. getting information about live Python code, and pydoc.py, a module
  5651. for interactively converting docstrings to HTML or text.
  5652. Tools/scripts/pydoc, which is now automatically installed into
  5653. <prefix>/bin, uses pydoc.py to display documentation; try running
  5654. "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
  5655. lets you browse the module docstrings using a web browser.
  5656. - New library module difflib.py, primarily packaging the SequenceMatcher
  5657. class at the heart of the popular ndiff.py file-comparison tool.
  5658. - doctest.py (a framework for verifying Python code examples in docstrings)
  5659. is now part of the std library.
  5660. Windows changes
  5661. - A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
  5662. small GUI that lets you browse the module docstrings using your
  5663. default web browser.
  5664. - Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
  5665. Platforms) is implemented. See
  5666. http://python.sourceforge.net/peps/pep-0235.html
  5667. for full details, especially the "Current Lower-Left Semantics" section.
  5668. The new Windows import rules are simpler than before:
  5669. A. If the PYTHONCASEOK environment variable exists, same as
  5670. before: silently accept the first case-insensitive match of any
  5671. kind; raise ImportError if none found.
  5672. B. Else search sys.path for the first case-sensitive match; raise
  5673. ImportError if none found.
  5674. The same rules have been implemented on other platforms with case-
  5675. insensitive but case-preserving filesystems too (including Cygwin, and
  5676. several flavors of Macintosh operating systems).
  5677. - winsound module: Under Win9x, winsound.Beep() now attempts to simulate
  5678. what it's supposed to do (and does do under NT and 2000) via direct
  5679. port manipulation. It's unknown whether this will work on all systems,
  5680. but it does work on my Win98SE systems now and was known to be useless on
  5681. all Win9x systems before.
  5682. - Build: Subproject _test (effectively) renamed to _testcapi.
  5683. New platforms
  5684. - 2.1 should compile and run out of the box under MacOS X, even using HFS+.
  5685. Thanks to Steven Majewski!
  5686. - 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
  5687. Tishler!
  5688. - 2.1 contains new files and patches for RISCOS, thanks to Dietmar
  5689. Schwertberger! See RISCOS/README for more information -- it seems
  5690. that because of the bizarre filename conventions on RISCOS, no port
  5691. to that platform is easy.
  5692. What's New in Python 2.1 alpha 2?
  5693. =================================
  5694. Core language, builtins, and interpreter
  5695. - Scopes nest. If a name is used in a function or class, but is not
  5696. local, the definition in the nearest enclosing function scope will
  5697. be used. One consequence of this change is that lambda statements
  5698. could reference variables in the namespaces where the lambda is
  5699. defined. In some unusual cases, this change will break code.
  5700. In all previous version of Python, names were resolved in exactly
  5701. three namespaces -- the local namespace, the global namespace, and
  5702. the builtin namespace. According to this old definition, if a
  5703. function A is defined within a function B, the names bound in B are
  5704. not visible in A. The new rules make names bound in B visible in A,
  5705. unless A contains a name binding that hides the binding in B.
  5706. Section 4.1 of the reference manual describes the new scoping rules
  5707. in detail. The test script in Lib/test/test_scope.py demonstrates
  5708. some of the effects of the change.
  5709. The new rules will cause existing code to break if it defines nested
  5710. functions where an outer function has local variables with the same
  5711. name as globals or builtins used by the inner function. Example:
  5712. def munge(str):
  5713. def helper(x):
  5714. return str(x)
  5715. if type(str) != type(''):
  5716. str = helper(str)
  5717. return str.strip()
  5718. Under the old rules, the name str in helper() is bound to the
  5719. builtin function str(). Under the new rules, it will be bound to
  5720. the argument named str and an error will occur when helper() is
  5721. called.
  5722. - The compiler will report a SyntaxError if "from ... import *" occurs
  5723. in a function or class scope. The language reference has documented
  5724. that this case is illegal, but the compiler never checked for it.
  5725. The recent introduction of nested scope makes the meaning of this
  5726. form of name binding ambiguous. In a future release, the compiler
  5727. may allow this form when there is no possibility of ambiguity.
  5728. - repr(string) is easier to read, now using hex escapes instead of octal,
  5729. and using \t, \n and \r instead of \011, \012 and \015 (respectively):
  5730. >>> "\texample \r\n" + chr(0) + chr(255)
  5731. '\texample \r\n\x00\xff' # in 2.1
  5732. '\011example \015\012\000\377' # in 2.0
  5733. - Functions are now compared and hashed by identity, not by value, since
  5734. the func_code attribute is writable.
  5735. - Weak references (PEP 205) have been added. This involves a few
  5736. changes in the core, an extension module (_weakref), and a Python
  5737. module (weakref). The weakref module is the public interface. It
  5738. includes support for "explicit" weak references, proxy objects, and
  5739. mappings with weakly held values.
  5740. - A 'continue' statement can now appear in a try block within the body
  5741. of a loop. It is still not possible to use continue in a finally
  5742. clause.
  5743. Standard library
  5744. - mailbox.py now has a new class, PortableUnixMailbox which is
  5745. identical to UnixMailbox but uses a more portable scheme for
  5746. determining From_ separators. Also, the constructors for all the
  5747. classes in this module have a new optional `factory' argument, which
  5748. is a callable used when new message classes must be instantiated by
  5749. the next() method.
  5750. - random.py is now self-contained, and offers all the functionality of
  5751. the now-deprecated whrandom.py. See the docs for details. random.py
  5752. also supports new functions getstate() and setstate(), for saving
  5753. and restoring the internal state of the generator; and jumpahead(n),
  5754. for quickly forcing the internal state to be the same as if n calls to
  5755. random() had been made. The latter is particularly useful for multi-
  5756. threaded programs, creating one instance of the random.Random() class for
  5757. each thread, then using .jumpahead() to force each instance to use a
  5758. non-overlapping segment of the full period.
  5759. - random.py's seed() function is new. For bit-for-bit compatibility with
  5760. prior releases, use the whseed function instead. The new seed function
  5761. addresses two problems: (1) The old function couldn't produce more than
  5762. about 2**24 distinct internal states; the new one about 2**45 (the best
  5763. that can be done in the Wichmann-Hill generator). (2) The old function
  5764. sometimes produced identical internal states when passed distinct
  5765. integers, and there was no simple way to predict when that would happen;
  5766. the new one guarantees to produce distinct internal states for all
  5767. arguments in [0, 27814431486576L).
  5768. - The socket module now supports raw packets on Linux. The socket
  5769. family is AF_PACKET.
  5770. - test_capi.py is a start at running tests of the Python C API. The tests
  5771. are implemented by the new Modules/_testmodule.c.
  5772. - A new extension module, _symtable, provides provisional access to the
  5773. internal symbol table used by the Python compiler. A higher-level
  5774. interface will be added on top of _symtable in a future release.
  5775. - Removed the obsolete soundex module.
  5776. - xml.dom.minidom now uses the standard DOM exceptions. Node supports
  5777. the isSameNode method; NamedNodeMap the get method.
  5778. - xml.sax.expatreader supports the lexical handler property; it
  5779. generates comment, startCDATA, and endCDATA events.
  5780. Windows changes
  5781. - Build procedure: the zlib project is built in a different way that
  5782. ensures the zlib header files used can no longer get out of synch with
  5783. the zlib binary used. See PCbuild\readme.txt for details. Your old
  5784. zlib-related directories can be deleted; you'll need to download fresh
  5785. source for zlib and unpack it into a new directory.
  5786. - Build: New subproject _test for the benefit of test_capi.py (see above).
  5787. - Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
  5788. interface to some Python compiler internals).
  5789. - Build: Subproject ucnhash is gone, since the code was folded into the
  5790. unicodedata subproject.
  5791. What's New in Python 2.1 alpha 1?
  5792. =================================
  5793. Core language, builtins, and interpreter
  5794. - There is a new Unicode companion to the PyObject_Str() API
  5795. called PyObject_Unicode(). It behaves in the same way as the
  5796. former, but assures that the returned value is an Unicode object
  5797. (applying the usual coercion if necessary).
  5798. - The comparison operators support "rich comparison overloading" (PEP
  5799. 207). C extension types can provide a rich comparison function in
  5800. the new tp_richcompare slot in the type object. The cmp() function
  5801. and the C function PyObject_Compare() first try the new rich
  5802. comparison operators before trying the old 3-way comparison. There
  5803. is also a new C API PyObject_RichCompare() (which also falls back on
  5804. the old 3-way comparison, but does not constrain the outcome of the
  5805. rich comparison to a Boolean result).
  5806. The rich comparison function takes two objects (at least one of
  5807. which is guaranteed to have the type that provided the function) and
  5808. an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
  5809. Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
  5810. object, which may be NotImplemented (in which case the tp_compare
  5811. slot function is used as a fallback, if defined).
  5812. Classes can overload individual comparison operators by defining one
  5813. or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
  5814. __ge__. There are no explicit "reflected argument" versions of
  5815. these; instead, __lt__ and __gt__ are each other's reflection,
  5816. likewise for__le__ and __ge__; __eq__ and __ne__ are their own
  5817. reflection (similar at the C level). No other implications are
  5818. made; in particular, Python does not assume that == is the Boolean
  5819. inverse of !=, or that < is the Boolean inverse of >=. This makes
  5820. it possible to define types with partial orderings.
  5821. Classes or types that want to implement (in)equality tests but not
  5822. the ordering operators (i.e. unordered types) should implement ==
  5823. and !=, and raise an error for the ordering operators.
  5824. It is possible to define types whose rich comparison results are not
  5825. Boolean; e.g. a matrix type might want to return a matrix of bits
  5826. for A < B, giving elementwise comparisons. Such types should ensure
  5827. that any interpretation of their value in a Boolean context raises
  5828. an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
  5829. at the C level) to always raise an exception.
  5830. - Complex numbers use rich comparisons to define == and != but raise
  5831. an exception for <, <=, > and >=. Unfortunately, this also means
  5832. that cmp() of two complex numbers raises an exception when the two
  5833. numbers differ. Since it is not mathematically meaningful to compare
  5834. complex numbers except for equality, I hope that this doesn't break
  5835. too much code.
  5836. - The outcome of comparing non-numeric objects of different types is
  5837. not defined by the language, other than that it's arbitrary but
  5838. consistent (see the Reference Manual). An implementation detail changed
  5839. in 2.1a1 such that None now compares less than any other object. Code
  5840. relying on this new behavior (like code that relied on the previous
  5841. behavior) does so at its own risk.
  5842. - Functions and methods now support getting and setting arbitrarily
  5843. named attributes (PEP 232). Functions have a new __dict__
  5844. (a.k.a. func_dict) which hold the function attributes. Methods get
  5845. and set attributes on their underlying im_func. It is a TypeError
  5846. to set an attribute on a bound method.
  5847. - The xrange() object implementation has been improved so that
  5848. xrange(sys.maxint) can be used on 64-bit platforms. There's still a
  5849. limitation that in this case len(xrange(sys.maxint)) can't be
  5850. calculated, but the common idiom "for i in xrange(sys.maxint)" will
  5851. work fine as long as the index i doesn't actually reach 2**31.
  5852. (Python uses regular ints for sequence and string indices; fixing
  5853. that is much more work.)
  5854. - Two changes to from...import:
  5855. 1) "from M import X" now works even if (after loading module M)
  5856. sys.modules['M'] is not a real module; it's basically a getattr()
  5857. operation with AttributeError exceptions changed into ImportError.
  5858. 2) "from M import *" now looks for M.__all__ to decide which names to
  5859. import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
  5860. filters out names starting with '_' as before. Whether or not
  5861. __all__ exists, there's no restriction on the type of M.
  5862. - File objects have a new method, xreadlines(). This is the fastest
  5863. way to iterate over all lines in a file:
  5864. for line in file.xreadlines():
  5865. ...do something to line...
  5866. See the xreadlines module (mentioned below) for how to do this for
  5867. other file-like objects.
  5868. - Even if you don't use file.xreadlines(), you may expect a speedup on
  5869. line-by-line input. The file.readline() method has been optimized
  5870. quite a bit in platform-specific ways: on systems (like Linux) that
  5871. support flockfile(), getc_unlocked(), and funlockfile(), those are
  5872. used by default. On systems (like Windows) without getc_unlocked(),
  5873. a complicated (but still thread-safe) method using fgets() is used by
  5874. default.
  5875. You can force use of the fgets() method by #define'ing
  5876. USE_FGETS_IN_GETLINE at build time (it may be faster than
  5877. getc_unlocked()).
  5878. You can force fgets() not to be used by #define'ing
  5879. DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
  5880. test_bufio.py fails -- and let us know if it does!).
  5881. - In addition, the fileinput module, while still slower than the other
  5882. methods on most platforms, has been sped up too, by using
  5883. file.readlines(sizehint).
  5884. - Support for run-time warnings has been added, including a new
  5885. command line option (-W) to specify the disposition of warnings.
  5886. See the description of the warnings module below.
  5887. - Extensive changes have been made to the coercion code. This mostly
  5888. affects extension modules (which can now implement mixed-type
  5889. numerical operators without having to use coercion), but
  5890. occasionally, in boundary cases the coercion semantics have changed
  5891. subtly. Since this was a terrible gray area of the language, this
  5892. is considered an improvement. Also note that __rcmp__ is no longer
  5893. supported -- instead of calling __rcmp__, __cmp__ is called with
  5894. reflected arguments.
  5895. - In connection with the coercion changes, a new built-in singleton
  5896. object, NotImplemented is defined. This can be returned for
  5897. operations that wish to indicate they are not implemented for a
  5898. particular combination of arguments. From C, this is
  5899. Py_NotImplemented.
  5900. - The interpreter accepts now bytecode files on the command line even
  5901. if they do not have a .pyc or .pyo extension. On Linux, after executing
  5902. import imp,sys,string
  5903. magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
  5904. reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
  5905. open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
  5906. any byte code file can be used as an executable (i.e. as an argument
  5907. to execve(2)).
  5908. - %[xXo] formats of negative Python longs now produce a sign
  5909. character. In 1.6 and earlier, they never produced a sign,
  5910. and raised an error if the value of the long was too large
  5911. to fit in a Python int. In 2.0, they produced a sign if and
  5912. only if too large to fit in an int. This was inconsistent
  5913. across platforms (because the size of an int varies across
  5914. platforms), and inconsistent with hex() and oct(). Example:
  5915. >>> "%x" % -0x42L
  5916. '-42' # in 2.1
  5917. 'ffffffbe' # in 2.0 and before, on 32-bit machines
  5918. >>> hex(-0x42L)
  5919. '-0x42L' # in all versions of Python
  5920. The behavior of %d formats for negative Python longs remains
  5921. the same as in 2.0 (although in 1.6 and before, they raised
  5922. an error if the long didn't fit in a Python int).
  5923. %u formats don't make sense for Python longs, but are allowed
  5924. and treated the same as %d in 2.1. In 2.0, a negative long
  5925. formatted via %u produced a sign if and only if too large to
  5926. fit in an int. In 1.6 and earlier, a negative long formatted
  5927. via %u raised an error if it was too big to fit in an int.
  5928. - Dictionary objects have an odd new method, popitem(). This removes
  5929. an arbitrary item from the dictionary and returns it (in the form of
  5930. a (key, value) pair). This can be useful for algorithms that use a
  5931. dictionary as a bag of "to do" items and repeatedly need to pick one
  5932. item. Such algorithms normally end up running in quadratic time;
  5933. using popitem() they can usually be made to run in linear time.
  5934. Standard library
  5935. - In the time module, the time argument to the functions strftime,
  5936. localtime, gmtime, asctime and ctime is now optional, defaulting to
  5937. the current time (in the local timezone).
  5938. - The ftplib module now defaults to passive mode, which is deemed a
  5939. more useful default given that clients are often inside firewalls
  5940. these days. Note that this could break if ftplib is used to connect
  5941. to a *server* that is inside a firewall, from outside; this is
  5942. expected to be a very rare situation. To fix that, you can call
  5943. ftp.set_pasv(0).
  5944. - The module site now treats .pth files not only for path configuration,
  5945. but also supports extensions to the initialization code: Lines starting
  5946. with import are executed.
  5947. - There's a new module, warnings, which implements a mechanism for
  5948. issuing and filtering warnings. There are some new built-in
  5949. exceptions that serve as warning categories, and a new command line
  5950. option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
  5951. turns warnings into errors). warnings.warn(message[, category])
  5952. issues a warning message; this can also be called from C as
  5953. PyErr_Warn(category, message).
  5954. - A new module xreadlines was added. This exports a single factory
  5955. function, xreadlines(). The intention is that this code is the
  5956. absolutely fastest way to iterate over all lines in an open
  5957. file(-like) object:
  5958. import xreadlines
  5959. for line in xreadlines.xreadlines(file):
  5960. ...do something to line...
  5961. This is equivalent to the previous the speed record holder using
  5962. file.readlines(sizehint). Note that if file is a real file object
  5963. (as opposed to a file-like object), this is equivalent:
  5964. for line in file.xreadlines():
  5965. ...do something to line...
  5966. - The bisect module has new functions bisect_left, insort_left,
  5967. bisect_right and insort_right. The old names bisect and insort
  5968. are now aliases for bisect_right and insort_right. XXX_right
  5969. and XXX_left methods differ in what happens when the new element
  5970. compares equal to one or more elements already in the list: the
  5971. XXX_left methods insert to the left, the XXX_right methods to the
  5972. right. Code that doesn't care where equal elements end up should
  5973. continue to use the old, short names ("bisect" and "insort").
  5974. - The new curses.panel module wraps the panel library that forms part
  5975. of SYSV curses and ncurses. Contributed by Thomas Gellekum.
  5976. - The SocketServer module now sets the allow_reuse_address flag by
  5977. default in the TCPServer class.
  5978. - A new function, sys._getframe(), returns the stack frame pointer of
  5979. the caller. This is intended only as a building block for
  5980. higher-level mechanisms such as string interpolation.
  5981. - The pyexpat module supports a number of new handlers, which are
  5982. available only in expat 1.2. If invocation of a callback fails, it
  5983. will report an additional frame in the traceback. Parser objects
  5984. participate now in garbage collection. If expat reports an unknown
  5985. encoding, pyexpat will try to use a Python codec; that works only
  5986. for single-byte charsets. The parser type objects is exposed as
  5987. XMLParserObject.
  5988. - xml.dom now offers standard definitions for symbolic node type and
  5989. exception code constants, and a hierarchy of DOM exceptions. minidom
  5990. was adjusted to use them.
  5991. - The conformance of xml.dom.minidom to the DOM specification was
  5992. improved. It detects a number of additional error cases; the
  5993. previous/next relationship works even when the tree is modified;
  5994. Node supports the normalize() method; NamedNodeMap, DocumentType and
  5995. DOMImplementation classes were added; Element supports the
  5996. hasAttribute and hasAttributeNS methods; and Text supports the splitText
  5997. method.
  5998. Build issues
  5999. - For Unix (and Unix-compatible) builds, configuration and building of
  6000. extension modules is now greatly automated. Rather than having to
  6001. edit the Modules/Setup file to indicate which modules should be
  6002. built and where their include files and libraries are, a
  6003. distutils-based setup.py script now takes care of building most
  6004. extension modules. All extension modules built this way are built
  6005. as shared libraries. Only a few modules that must be linked
  6006. statically are still listed in the Setup file; you won't need to
  6007. edit their configuration.
  6008. - Python should now build out of the box on Cygwin. If it doesn't,
  6009. mail to Jason Tishler (jlt63 at users.sourceforge.net).
  6010. - Python now always uses its own (renamed) implementation of getopt()
  6011. -- there's too much variation among C library getopt()
  6012. implementations.
  6013. - C++ compilers are better supported; the CXX macro is always set to a
  6014. C++ compiler if one is found.
  6015. Windows changes
  6016. - select module: By default under Windows, a select() call
  6017. can specify no more than 64 sockets. Python now boosts
  6018. this Microsoft default to 512. If you need even more than
  6019. that, see the MS docs (you'll need to #define FD_SETSIZE
  6020. and recompile Python from source).
  6021. - Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
  6022. subdirectory is no more!
  6023. What's New in Python 2.0?
  6024. =========================
  6025. Below is a list of all relevant changes since release 1.6. Older
  6026. changes are in the file HISTORY. If you are making the jump directly
  6027. from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
  6028. HISTORY file! Many important changes listed there.
  6029. Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
  6030. the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
  6031. http://www.amk.ca/python/2.0/.
  6032. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
  6033. ======================================================================
  6034. What's new in 2.0 (since release candidate 1)?
  6035. ==============================================
  6036. Standard library
  6037. - The copy_reg module was modified to clarify its intended use: to
  6038. register pickle support for extension types, not for classes.
  6039. pickle() will raise a TypeError if it is passed a class.
  6040. - Fixed a bug in gettext's "normalize and expand" code that prevented
  6041. it from finding an existing .mo file.
  6042. - Restored support for HTTP/0.9 servers in httplib.
  6043. - The math module was changed to stop raising OverflowError in case of
  6044. underflow, and return 0 instead in underflow cases. Whether Python
  6045. used to raise OverflowError in case of underflow was platform-
  6046. dependent (it did when the platform math library set errno to ERANGE
  6047. on underflow).
  6048. - Fixed a bug in StringIO that occurred when the file position was not
  6049. at the end of the file and write() was called with enough data to
  6050. extend past the end of the file.
  6051. - Fixed a bug that caused Tkinter error messages to get lost on
  6052. Windows. The bug was fixed by replacing direct use of
  6053. interp->result with Tcl_GetStringResult(interp).
  6054. - Fixed bug in urllib2 that caused it to fail when it received an HTTP
  6055. redirect response.
  6056. - Several changes were made to distutils: Some debugging code was
  6057. removed from util. Fixed the installer used when an external zip
  6058. program (like WinZip) is not found; the source code for this
  6059. installer is in Misc/distutils. check_lib() was modified to behave
  6060. more like AC_CHECK_LIB by add other_libraries() as a parameter. The
  6061. test for whether installed modules are on sys.path was changed to
  6062. use both normcase() and normpath().
  6063. - Several minor bugs were fixed in the xml package (the minidom,
  6064. pulldom, expatreader, and saxutils modules).
  6065. - The regression test driver (regrtest.py) behavior when invoked with
  6066. -l changed: It now reports a count of objects that are recognized as
  6067. garbage but not freed by the garbage collector.
  6068. - The regression test for the math module was changed to test
  6069. exceptional behavior when the test is run in verbose mode. Python
  6070. cannot yet guarantee consistent exception behavior across platforms,
  6071. so the exception part of test_math is run only in verbose mode, and
  6072. may fail on your platform.
  6073. Internals
  6074. - PyOS_CheckStack() has been disabled on Win64, where it caused
  6075. test_sre to fail.
  6076. Build issues
  6077. - Changed compiler flags, so that gcc is always invoked with -Wall and
  6078. -Wstrict-prototypes. Users compiling Python with GCC should see
  6079. exactly one warning, except if they have passed configure the
  6080. --with-pydebug flag. The expected warning is for getopt() in
  6081. Modules/main.c. This warning will be fixed for Python 2.1.
  6082. - Fixed configure to add -threads argument during linking on OSF1.
  6083. Tools and other miscellany
  6084. - The compiler in Tools/compiler was updated to support the new
  6085. language features introduced in 2.0: extended print statement, list
  6086. comprehensions, and augmented assignments. The new compiler should
  6087. also be backwards compatible with Python 1.5.2; the compiler will
  6088. always generate code for the version of the interpreter it runs
  6089. under.
  6090. What's new in 2.0 release candidate 1 (since beta 2)?
  6091. =====================================================
  6092. What is release candidate 1?
  6093. We believe that release candidate 1 will fix all known bugs that we
  6094. intend to fix for the 2.0 final release. This release should be a bit
  6095. more stable than the previous betas. We would like to see even more
  6096. widespread testing before the final release, so we are producing this
  6097. release candidate. The final release will be exactly the same unless
  6098. any show-stopping (or brown bag) bugs are found by testers of the
  6099. release candidate.
  6100. All the changes since the last beta release are bug fixes or changes
  6101. to support building Python for specific platforms.
  6102. Core language, builtins, and interpreter
  6103. - A bug that caused crashes when __coerce__ was used with augmented
  6104. assignment, e.g. +=, was fixed.
  6105. - Raise ZeroDivisionError when raising zero to a negative number,
  6106. e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the builtin
  6107. power operator and the result of math.pow(0.0, -2.0) will vary by
  6108. platform. On Linux, it raises a ValueError.
  6109. - A bug in Unicode string interpolation was fixed that occasionally
  6110. caused errors with formats including "%%". For example, the
  6111. following expression "%% %s" % u"abc" no longer raises a TypeError.
  6112. - Compilation of deeply nested expressions raises MemoryError instead
  6113. of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
  6114. - In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
  6115. rendering them useless. They are now written in binary mode again.
  6116. Standard library
  6117. - Keyword arguments are now accepted for most pattern and match object
  6118. methods in SRE, the standard regular expression engine.
  6119. - In SRE, fixed error with negative lookahead and lookbehind that
  6120. manifested itself as a runtime error in patterns like "(?<!abc)(def)".
  6121. - Several bugs in the Unicode handling and error handling in _tkinter
  6122. were fixed.
  6123. - Fix memory management errors in Merge() and Tkapp_Call() routines.
  6124. - Several changes were made to cStringIO to make it compatible with
  6125. the file-like object interface and with StringIO. If operations are
  6126. performed on a closed object, an exception is raised. The truncate
  6127. method now accepts a position argument and readline accepts a size
  6128. argument.
  6129. - There were many changes made to the linuxaudiodev module and its
  6130. test suite; as a result, a short, unexpected audio sample should now
  6131. play when the regression test is run.
  6132. Note that this module is named poorly, because it should work
  6133. correctly on any platform that supports the Open Sound System
  6134. (OSS).
  6135. The module now raises exceptions when errors occur instead of
  6136. crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
  6137. audio) and defines a getptr() method that calls the
  6138. SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
  6139. - The library_version attribute, introduced in an earlier beta, was
  6140. removed because it can not be supported with early versions of the C
  6141. readline library, which provides no way to determine the version at
  6142. compile-time.
  6143. - The binascii module is now enabled on Win64.
  6144. - tokenize.py no longer suffers "recursion depth" errors when parsing
  6145. programs with very long string literals.
  6146. Internals
  6147. - Fixed several buffer overflow vulnerabilities in calculate_path(),
  6148. which is called when the interpreter starts up to determine where
  6149. the standard library is installed. These vulnerabilities affect all
  6150. previous versions of Python and can be exploited by setting very
  6151. long values for PYTHONHOME or argv[0]. The risk is greatest for a
  6152. setuid Python script, although use of the wrapper in
  6153. Misc/setuid-prog.c will eliminate the vulnerability.
  6154. - Fixed garbage collection bugs in instance creation that were
  6155. triggered when errors occurred during initialization. The solution,
  6156. applied in cPickle and in PyInstance_New(), is to call
  6157. PyObject_GC_Init() after the initialization of the object's
  6158. container attributes is complete.
  6159. - pyexpat adds definitions of PyModule_AddStringConstant and
  6160. PyModule_AddObject if the Python version is less than 2.0, which
  6161. provides compatibility with PyXML on Python 1.5.2.
  6162. - If the platform has a bogus definition for LONG_BIT (the number of
  6163. bits in a long), an error will be reported at compile time.
  6164. - Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
  6165. collection crashes and possibly other, unreported crashes.
  6166. - Fixed a memory leak in _PyUnicode_Fini().
  6167. Build issues
  6168. - configure now accepts a --with-suffix option that specifies the
  6169. executable suffix. This is useful for builds on Cygwin and Mac OS
  6170. X, for example.
  6171. - The mmap.PAGESIZE constant is now initialized using sysconf when
  6172. possible, which eliminates a dependency on -lucb for Reliant UNIX.
  6173. - The md5 file should now compile on all platforms.
  6174. - The select module now compiles on platforms that do not define
  6175. POLLRDNORM and related constants.
  6176. - Darwin (Mac OS X): Initial support for static builds on this
  6177. platform.
  6178. - BeOS: A number of changes were made to the build and installation
  6179. process. ar-fake now operates on a directory of object files.
  6180. dl_export.h is gone, and its macros now appear on the mwcc command
  6181. line during build on PPC BeOS.
  6182. - Platform directory in lib/python2.0 is "plat-beos5" (or
  6183. "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
  6184. - Cygwin: Support for shared libraries, Tkinter, and sockets.
  6185. - SunOS 4.1.4_JL: Fix test for directory existence in configure.
  6186. Tools and other miscellany
  6187. - Removed debugging prints from main used with freeze.
  6188. - IDLE auto-indent no longer crashes when it encounters Unicode
  6189. characters.
  6190. What's new in 2.0 beta 2 (since beta 1)?
  6191. ========================================
  6192. Core language, builtins, and interpreter
  6193. - Add support for unbounded ints in %d,i,u,x,X,o formats; for example
  6194. "%d" % 2L**64 == "18446744073709551616".
  6195. - Add -h and -V command line options to print the usage message and
  6196. Python version number and exit immediately.
  6197. - eval() and exec accept Unicode objects as code parameters.
  6198. - getattr() and setattr() now also accept Unicode objects for the
  6199. attribute name, which are converted to strings using the default
  6200. encoding before lookup.
  6201. - Multiplication on string and Unicode now does proper bounds
  6202. checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
  6203. string is too long."
  6204. - Better error message when continue is found in try statement in a
  6205. loop.
  6206. Standard library and extensions
  6207. - socket module: the OpenSSL code now adds support for RAND_status()
  6208. and EGD (Entropy Gathering Device).
  6209. - array: reverse() method of array now works. buffer_info() now does
  6210. argument checking; it still takes no arguments.
  6211. - asyncore/asynchat: Included most recent version from Sam Rushing.
  6212. - cgi: Accept '&' or ';' as separator characters when parsing form data.
  6213. - CGIHTTPServer: Now works on Windows (and perhaps even Mac).
  6214. - ConfigParser: When reading the file, options spelled in upper case
  6215. letters are now correctly converted to lowercase.
  6216. - copy: Copy Unicode objects atomically.
  6217. - cPickle: Fail gracefully when copy_reg can't be imported.
  6218. - cStringIO: Implemented readlines() method.
  6219. - dbm: Add get() and setdefault() methods to dbm object. Add constant
  6220. `library' to module that names the library used. Added doc strings
  6221. and method names to error messages. Uses configure to determine
  6222. which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
  6223. now available options.
  6224. - distutils: Update to version 0.9.3.
  6225. - dl: Add several dl.RTLD_ constants.
  6226. - fpectl: Now supported on FreeBSD.
  6227. - gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
  6228. found by the collector will be saved in gc.garbage. This is useful
  6229. for debugging a program that creates reference cycles.
  6230. - httplib: Three changes: Restore support for set_debuglevel feature
  6231. of HTTP class. Do not close socket on zero-length response. Do not
  6232. crash when server sends invalid content-length header.
  6233. - mailbox: Mailbox class conforms better to qmail specifications.
  6234. - marshal: When reading a short, sign-extend on platforms where shorts
  6235. are bigger than 16 bits. When reading a long, repair the unportable
  6236. sign extension that was being done for 64-bit machines. (It assumed
  6237. that signed right shift sign-extends.)
  6238. - operator: Add contains(), invert(), __invert__() as aliases for
  6239. __contains__(), inv(), and __inv__() respectively.
  6240. - os: Add support for popen2() and popen3() on all platforms where
  6241. fork() exists. (popen4() is still in the works.)
  6242. - os: (Windows only:) Add startfile() function that acts like double-
  6243. clicking on a file in Explorer (or passing the file name to the
  6244. DOS "start" command).
  6245. - os.path: (Windows, DOS:) Treat trailing colon correctly in
  6246. os.path.join. os.path.join("a:", "b") yields "a:b".
  6247. - pickle: Now raises ValueError when an invalid pickle that contains
  6248. a non-string repr where a string repr was expected. This behavior
  6249. matches cPickle.
  6250. - posixfile: Remove broken __del__() method.
  6251. - py_compile: support CR+LF line terminators in source file.
  6252. - readline: Does not immediately exit when ^C is hit when readline and
  6253. threads are configured. Adds definition of rl_library_version. (The
  6254. latter addition requires GNU readline 2.2 or later.)
  6255. - rfc822: Domain literals returned by AddrlistClass method
  6256. getdomainliteral() are now properly wrapped in brackets.
  6257. - site: sys.setdefaultencoding() should only be called in case the
  6258. standard default encoding ("ascii") is changed. This saves quite a
  6259. few cycles during startup since the first call to
  6260. setdefaultencoding() will initialize the codec registry and the
  6261. encodings package.
  6262. - socket: Support for size hint in readlines() method of object returned
  6263. by makefile().
  6264. - sre: Added experimental expand() method to match objects. Does not
  6265. use buffer interface on Unicode strings. Does not hang if group id
  6266. is followed by whitespace.
  6267. - StringIO: Size hint in readlines() is now supported as documented.
  6268. - struct: Check ranges for bytes and shorts.
  6269. - urllib: Improved handling of win32 proxy settings. Fixed quote and
  6270. quote_plus functions so that the always encode a comma.
  6271. - Tkinter: Image objects are now guaranteed to have unique ids. Set
  6272. event.delta to zero if Tk version doesn't support mousewheel.
  6273. Removed some debugging prints.
  6274. - UserList: now implements __contains__().
  6275. - webbrowser: On Windows, use os.startfile() instead of os.popen(),
  6276. which works around a bug in Norton AntiVirus 2000 that leads directly
  6277. to a Blue Screen freeze.
  6278. - xml: New version detection code allows PyXML to override standard
  6279. XML package if PyXML version is greater than 0.6.1.
  6280. - xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
  6281. (conventional DOM), and xml.dom.pulldom, which allows building the DOM
  6282. tree only for nodes which are sufficiently interesting to a specific
  6283. application. Does not provide the HTML-specific extensions. Still
  6284. undocumented.
  6285. - xml.sax: SAX 2 support for Python, including all the handler
  6286. interfaces needed to process XML 1.0 compliant XML. Some
  6287. documentation is already available.
  6288. - pyexpat: Renamed to xml.parsers.expat since this is part of the new,
  6289. packagized XML support.
  6290. C API
  6291. - Add three new convenience functions for module initialization --
  6292. PyModule_AddObject(), PyModule_AddIntConstant(), and
  6293. PyModule_AddStringConstant().
  6294. - Cleaned up definition of NULL in C source code; all definitions were
  6295. removed and add #error to Python.h if NULL isn't defined after
  6296. #include of stdio.h.
  6297. - Py_PROTO() macros that were removed in 2.0b1 have been restored for
  6298. backwards compatibility (at the source level) with old extensions.
  6299. - A wrapper API was added for signal() and sigaction(). Instead of
  6300. either function, always use PyOS_getsig() to get a signal handler
  6301. and PyOS_setsig() to set one. A new convenience typedef
  6302. PyOS_sighandler_t is defined for the type of signal handlers.
  6303. - Add PyString_AsStringAndSize() function that provides access to the
  6304. internal data buffer and size of a string object -- or the default
  6305. encoded version of a Unicode object.
  6306. - PyString_Size() and PyString_AsString() accept Unicode objects.
  6307. - The standard header <limits.h> is now included by Python.h (if it
  6308. exists). INT_MAX and LONG_MAX will always be defined, even if
  6309. <limits.h> is not available.
  6310. - PyFloat_FromString takes a second argument, pend, that was
  6311. effectively useless. It is now officially useless but preserved for
  6312. backwards compatibility. If the pend argument is not NULL, *pend is
  6313. set to NULL.
  6314. - PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
  6315. for the attribute name. See note on getattr() above.
  6316. - A few bug fixes to argument processing for Unicode.
  6317. PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
  6318. PyArg_Parse() special cases "s#" for Unicode objects; it returns a
  6319. pointer to the default encoded string data instead of to the raw
  6320. UTF-16.
  6321. - Py_BuildValue accepts B format (for bgen-generated code).
  6322. Internals
  6323. - On Unix, fix code for finding Python installation directory so that
  6324. it works when argv[0] is a relative path.
  6325. - Added a true unicode_internal_encode() function and fixed the
  6326. unicode_internal_decode function() to support Unicode objects directly
  6327. rather than by generating a copy of the object.
  6328. - Several of the internal Unicode tables are much smaller now, and
  6329. the source code should be much friendlier to weaker compilers.
  6330. - In the garbage collector: Fixed bug in collection of tuples. Fixed
  6331. bug that caused some instances to be removed from the container set
  6332. while they were still live. Fixed parsing in gc.set_debug() for
  6333. platforms where sizeof(long) > sizeof(int).
  6334. - Fixed refcount problem in instance deallocation that only occurred
  6335. when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
  6336. - On Windows, getpythonregpath is now protected against null data in
  6337. registry key.
  6338. - On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
  6339. condition.
  6340. Build and platform-specific issues
  6341. - Better support of GNU Pth via --with-pth configure option.
  6342. - Python/C API now properly exposed to dynamically-loaded extension
  6343. modules on Reliant UNIX.
  6344. - Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
  6345. Don't define MS_SYNC to be zero when it is undefined. Added missing
  6346. prototypes in posixmodule.c.
  6347. - Improved support for HP-UX build. Threads should now be correctly
  6348. configured (on HP-UX 10.20 and 11.00).
  6349. - Fix largefile support on older NetBSD systems and OpenBSD by adding
  6350. define for TELL64.
  6351. Tools and other miscellany
  6352. - ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
  6353. - freeze: The modulefinder now works with 2.0 opcodes.
  6354. - IDLE:
  6355. Move hackery of sys.argv until after the Tk instance has been
  6356. created, which allows the application-specific Tkinter
  6357. initialization to be executed if present; also pass an explicit
  6358. className parameter to the Tk() constructor.
  6359. What's new in 2.0 beta 1?
  6360. =========================
  6361. Source Incompatibilities
  6362. ------------------------
  6363. None. Note that 1.6 introduced several incompatibilities with 1.5.2,
  6364. such as single-argument append(), connect() and bind(), and changes to
  6365. str(long) and repr(float).
  6366. Binary Incompatibilities
  6367. ------------------------
  6368. - Third party extensions built for Python 1.5.x or 1.6 cannot be used
  6369. with Python 2.0; these extensions will have to be rebuilt for Python
  6370. 2.0.
  6371. - On Windows, attempting to import a third party extension built for
  6372. Python 1.5.x or 1.6 results in an immediate crash; there's not much we
  6373. can do about this. Check your PYTHONPATH environment variable!
  6374. - Python bytecode files (*.pyc and *.pyo) are not compatible between
  6375. releases.
  6376. Overview of Changes Since 1.6
  6377. -----------------------------
  6378. There are many new modules (including brand new XML support through
  6379. the xml package, and i18n support through the gettext module); a list
  6380. of all new modules is included below. Lots of bugs have been fixed.
  6381. The process for making major new changes to the language has changed
  6382. since Python 1.6. Enhancements must now be documented by a Python
  6383. Enhancement Proposal (PEP) before they can be accepted.
  6384. There are several important syntax enhancements, described in more
  6385. detail below:
  6386. - Augmented assignment, e.g. x += 1
  6387. - List comprehensions, e.g. [x**2 for x in range(10)]
  6388. - Extended import statement, e.g. import Module as Name
  6389. - Extended print statement, e.g. print >> file, "Hello"
  6390. Other important changes:
  6391. - Optional collection of cyclical garbage
  6392. Python Enhancement Proposal (PEP)
  6393. ---------------------------------
  6394. PEP stands for Python Enhancement Proposal. A PEP is a design
  6395. document providing information to the Python community, or describing
  6396. a new feature for Python. The PEP should provide a concise technical
  6397. specification of the feature and a rationale for the feature.
  6398. We intend PEPs to be the primary mechanisms for proposing new
  6399. features, for collecting community input on an issue, and for
  6400. documenting the design decisions that have gone into Python. The PEP
  6401. author is responsible for building consensus within the community and
  6402. documenting dissenting opinions.
  6403. The PEPs are available at http://python.sourceforge.net/peps/.
  6404. Augmented Assignment
  6405. --------------------
  6406. This must have been the most-requested feature of the past years!
  6407. Eleven new assignment operators were added:
  6408. += -= *= /= %= **= <<= >>= &= ^= |=
  6409. For example,
  6410. A += B
  6411. is similar to
  6412. A = A + B
  6413. except that A is evaluated only once (relevant when A is something
  6414. like dict[index].attr).
  6415. However, if A is a mutable object, A may be modified in place. Thus,
  6416. if A is a number or a string, A += B has the same effect as A = A+B
  6417. (except A is only evaluated once); but if a is a list, A += B has the
  6418. same effect as A.extend(B)!
  6419. Classes and built-in object types can override the new operators in
  6420. order to implement the in-place behavior; the not-in-place behavior is
  6421. used automatically as a fallback when an object doesn't implement the
  6422. in-place behavior. For classes, the method name is derived from the
  6423. method name for the corresponding not-in-place operator by inserting
  6424. an 'i' in front of the name, e.g. __iadd__ implements in-place
  6425. __add__.
  6426. Augmented assignment was implemented by Thomas Wouters.
  6427. List Comprehensions
  6428. -------------------
  6429. This is a flexible new notation for lists whose elements are computed
  6430. from another list (or lists). The simplest form is:
  6431. [<expression> for <variable> in <sequence>]
  6432. For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
  6433. This is more efficient than a for loop with a list.append() call.
  6434. You can also add a condition:
  6435. [<expression> for <variable> in <sequence> if <condition>]
  6436. For example, [w for w in words if w == w.lower()] would yield the list
  6437. of words that contain no uppercase characters. This is more efficient
  6438. than a for loop with an if statement and a list.append() call.
  6439. You can also have nested for loops and more than one 'if' clause. For
  6440. example, here's a function that flattens a sequence of sequences::
  6441. def flatten(seq):
  6442. return [x for subseq in seq for x in subseq]
  6443. flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
  6444. This prints
  6445. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  6446. List comprehensions originated as a patch set from Greg Ewing; Skip
  6447. Montanaro and Thomas Wouters also contributed. Described by PEP 202.
  6448. Extended Import Statement
  6449. -------------------------
  6450. Many people have asked for a way to import a module under a different
  6451. name. This can be accomplished like this:
  6452. import foo
  6453. bar = foo
  6454. del foo
  6455. but this common idiom gets old quickly. A simple extension of the
  6456. import statement now allows this to be written as follows:
  6457. import foo as bar
  6458. There's also a variant for 'from ... import':
  6459. from foo import bar as spam
  6460. This also works with packages; e.g. you can write this:
  6461. import test.regrtest as regrtest
  6462. Note that 'as' is not a new keyword -- it is recognized only in this
  6463. context (this is only possible because the syntax for the import
  6464. statement doesn't involve expressions).
  6465. Implemented by Thomas Wouters. Described by PEP 221.
  6466. Extended Print Statement
  6467. ------------------------
  6468. Easily the most controversial new feature, this extension to the print
  6469. statement adds an option to make the output go to a different file
  6470. than the default sys.stdout.
  6471. For example, to write an error message to sys.stderr, you can now
  6472. write:
  6473. print >> sys.stderr, "Error: bad dog!"
  6474. As a special feature, if the expression used to indicate the file
  6475. evaluates to None, the current value of sys.stdout is used. Thus:
  6476. print >> None, "Hello world"
  6477. is equivalent to
  6478. print "Hello world"
  6479. Design and implementation by Barry Warsaw. Described by PEP 214.
  6480. Optional Collection of Cyclical Garbage
  6481. ---------------------------------------
  6482. Python is now equipped with a garbage collector that can hunt down
  6483. cyclical references between Python objects. It's no replacement for
  6484. reference counting; in fact, it depends on the reference counts being
  6485. correct, and decides that a set of objects belong to a cycle if all
  6486. their reference counts can be accounted for from their references to
  6487. each other. This devious scheme was first proposed by Eric Tiedemann,
  6488. and brought to implementation by Neil Schemenauer.
  6489. There's a module "gc" that lets you control some parameters of the
  6490. garbage collection. There's also an option to the configure script
  6491. that lets you enable or disable the garbage collection. In 2.0b1,
  6492. it's on by default, so that we (hopefully) can collect decent user
  6493. experience with this new feature. There are some questions about its
  6494. performance. If it proves to be too much of a problem, we'll turn it
  6495. off by default in the final 2.0 release.
  6496. Smaller Changes
  6497. ---------------
  6498. A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
  6499. map(None, seq1, seq2, ...) when the sequences have the same length;
  6500. i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
  6501. the lists are not all the same length, the shortest list wins:
  6502. zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
  6503. sys.version_info is a tuple (major, minor, micro, level, serial).
  6504. Dictionaries have an odd new method, setdefault(key, default).
  6505. dict.setdefault(key, default) returns dict[key] if it exists; if not,
  6506. it sets dict[key] to default and returns that value. Thus:
  6507. dict.setdefault(key, []).append(item)
  6508. does the same work as this common idiom:
  6509. if not dict.has_key(key):
  6510. dict[key] = []
  6511. dict[key].append(item)
  6512. There are two new variants of SyntaxError that are raised for
  6513. indentation-related errors: IndentationError and TabError.
  6514. Changed \x to consume exactly two hex digits; see PEP 223. Added \U
  6515. escape that consumes exactly eight hex digits.
  6516. The limits on the size of expressions and file in Python source code
  6517. have been raised from 2**16 to 2**32. Previous versions of Python
  6518. were limited because the maximum argument size the Python VM accepted
  6519. was 2**16. This limited the size of object constructor expressions,
  6520. e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
  6521. limit was raised thanks to a patch by Charles Waldman that effectively
  6522. fixes the problem. It is now much more likely that you will be
  6523. limited by available memory than by an arbitrary limit in Python.
  6524. The interpreter's maximum recursion depth can be modified by Python
  6525. programs using sys.getrecursionlimit and sys.setrecursionlimit. This
  6526. limit is the maximum number of recursive calls that can be made by
  6527. Python code. The limit exists to prevent infinite recursion from
  6528. overflowing the C stack and causing a core dump. The default value is
  6529. 1000. The maximum safe value for a particular platform can be found
  6530. by running Misc/find_recursionlimit.py.
  6531. New Modules and Packages
  6532. ------------------------
  6533. atexit - for registering functions to be called when Python exits.
  6534. imputil - Greg Stein's alternative API for writing custom import
  6535. hooks.
  6536. pyexpat - an interface to the Expat XML parser, contributed by Paul
  6537. Prescod.
  6538. xml - a new package with XML support code organized (so far) in three
  6539. subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
  6540. would fill a volume. There's a special feature whereby a
  6541. user-installed package named _xmlplus overrides the standard
  6542. xmlpackage; this is intended to give the XML SIG a hook to distribute
  6543. backwards-compatible updates to the standard xml package.
  6544. webbrowser - a platform-independent API to launch a web browser.
  6545. Changed Modules
  6546. ---------------
  6547. array -- new methods for array objects: count, extend, index, pop, and
  6548. remove
  6549. binascii -- new functions b2a_hex and a2b_hex that convert between
  6550. binary data and its hex representation
  6551. calendar -- Many new functions that support features including control
  6552. over which day of the week is the first day, returning strings instead
  6553. of printing them. Also new symbolic constants for days of week,
  6554. e.g. MONDAY, ..., SUNDAY.
  6555. cgi -- FieldStorage objects have a getvalue method that works like a
  6556. dictionary's get method and returns the value attribute of the object.
  6557. ConfigParser -- The parser object has new methods has_option,
  6558. remove_section, remove_option, set, and write. They allow the module
  6559. to be used for writing config files as well as reading them.
  6560. ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
  6561. optionally support the RFC 959 REST command.
  6562. gzip -- readline and readlines now accept optional size arguments
  6563. httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
  6564. the module doc strings for details.
  6565. locale -- implement getdefaultlocale for Win32 and Macintosh
  6566. marshal -- no longer dumps core when marshaling deeply nested or
  6567. recursive data structures
  6568. os -- new functions isatty, seteuid, setegid, setreuid, setregid
  6569. os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
  6570. support under Unix.
  6571. os/pty -- support for openpty and forkpty
  6572. os.path -- fix semantics of os.path.commonprefix
  6573. smtplib -- support for sending very long messages
  6574. socket -- new function getfqdn()
  6575. readline -- new functions to read, write and truncate history files.
  6576. The readline section of the library reference manual contains an
  6577. example.
  6578. select -- add interface to poll system call
  6579. shutil -- new copyfileobj function
  6580. SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
  6581. HTTP server.
  6582. Tkinter -- optimization of function flatten
  6583. urllib -- scans environment variables for proxy configuration,
  6584. e.g. http_proxy.
  6585. whichdb -- recognizes dumbdbm format
  6586. Obsolete Modules
  6587. ----------------
  6588. None. However note that 1.6 made a whole slew of modules obsolete:
  6589. stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
  6590. poly, zmod, strop, util, whatsound.
  6591. Changed, New, Obsolete Tools
  6592. ----------------------------
  6593. None.
  6594. C-level Changes
  6595. ---------------
  6596. Several cleanup jobs were carried out throughout the source code.
  6597. All C code was converted to ANSI C; we got rid of all uses of the
  6598. Py_PROTO() macro, which makes the header files a lot more readable.
  6599. Most of the portability hacks were moved to a new header file,
  6600. pyport.h; several other new header files were added and some old
  6601. header files were removed, in an attempt to create a more rational set
  6602. of header files. (Few of these ever need to be included explicitly;
  6603. they are all included by Python.h.)
  6604. Trent Mick ensured portability to 64-bit platforms, under both Linux
  6605. and Win64, especially for the new Intel Itanium processor. Mick also
  6606. added large file support for Linux64 and Win64.
  6607. The C APIs to return an object's size have been update to consistently
  6608. use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
  6609. previous versions, the abstract interfaces used PyXXX_Length and the
  6610. concrete interfaces used PyXXX_Size. The old names,
  6611. e.g. PyObject_Length, are still available for backwards compatibility
  6612. at the API level, but are deprecated.
  6613. The PyOS_CheckStack function has been implemented on Windows by
  6614. Fredrik Lundh. It prevents Python from failing with a stack overflow
  6615. on Windows.
  6616. The GC changes resulted in creation of two new slots on object,
  6617. tp_traverse and tp_clear. The augmented assignment changes result in
  6618. the creation of a new slot for each in-place operator.
  6619. The GC API creates new requirements for container types implemented in
  6620. C extension modules. See Include/objimpl.h for details.
  6621. PyErr_Format has been updated to automatically calculate the size of
  6622. the buffer needed to hold the formatted result string. This change
  6623. prevents crashes caused by programmer error.
  6624. New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
  6625. PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
  6626. that are the same as their non-Ex counterparts except they take an
  6627. extra flag argument that tells them to close the file when done.
  6628. XXX There were other API changes that should be fleshed out here.
  6629. Windows Changes
  6630. ---------------
  6631. New popen2/popen3/peopen4 in os module (see Changed Modules above).
  6632. os.popen is much more usable on Windows 95 and 98. See Microsoft
  6633. Knowledge Base article Q150956. The Win9x workaround described there
  6634. is implemented by the new w9xpopen.exe helper in the root of your
  6635. Python installation. Note that Python uses this internally; it is not
  6636. a standalone program.
  6637. Administrator privileges are no longer required to install Python
  6638. on Windows NT or Windows 2000. If you have administrator privileges,
  6639. Python's registry info will be written under HKEY_LOCAL_MACHINE.
  6640. Otherwise the installer backs off to writing Python's registry info
  6641. under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
  6642. uses of Python, but will prevent some advanced uses from working
  6643. (for example, running a Python script as an NT service, or possibly
  6644. from CGI).
  6645. [This was new in 1.6] The installer no longer runs a separate Tcl/Tk
  6646. installer; instead, it installs the needed Tcl/Tk files directly in the
  6647. Python directory. If you already have a Tcl/Tk installation, this
  6648. wastes some disk space (about 4 Megs) but avoids problems with
  6649. conflicting Tcl/Tk installations, and makes it much easier for Python
  6650. to ensure that Tcl/Tk can find all its files.
  6651. [This was new in 1.6] The Windows installer now installs by default in
  6652. \Python20\ on the default volume, instead of \Program Files\Python-2.0\.
  6653. Updates to the changes between 1.5.2 and 1.6
  6654. --------------------------------------------
  6655. The 1.6 NEWS file can't be changed after the release is done, so here
  6656. is some late-breaking news:
  6657. New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
  6658. and changes to getlocale() and setlocale().
  6659. The new module is now enabled per default.
  6660. It is not true that the encodings codecs cannot be used for normal
  6661. strings: the string.encode() (which is also present on 8-bit strings
  6662. !) allows using them for 8-bit strings too, e.g. to convert files from
  6663. cp1252 (Windows) to latin-1 or vice-versa.
  6664. Japanese codecs are available from Tamito KAJIYAMA:
  6665. http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
  6666. ======================================================================
  6667. =======================================
  6668. ==> Release 1.6 (September 5, 2000) <==
  6669. =======================================
  6670. What's new in release 1.6?
  6671. ==========================
  6672. Below is a list of all relevant changes since release 1.5.2.
  6673. Source Incompatibilities
  6674. ------------------------
  6675. Several small incompatible library changes may trip you up:
  6676. - The append() method for lists can no longer be invoked with more
  6677. than one argument. This used to append a single tuple made out of
  6678. all arguments, but was undocumented. To append a tuple, use
  6679. e.g. l.append((a, b, c)).
  6680. - The connect(), connect_ex() and bind() methods for sockets require
  6681. exactly one argument. Previously, you could call s.connect(host,
  6682. port), but this was undocumented. You must now write
  6683. s.connect((host, port)).
  6684. - The str() and repr() functions are now different more often. For
  6685. long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
  6686. which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
  6687. For floats, repr() now gives 17 digits of precision, to ensure no
  6688. precision is lost (on all current hardware).
  6689. - The -X option is gone. Built-in exceptions are now always
  6690. classes. Many more library modules also have been converted to
  6691. class-based exceptions.
  6692. Binary Incompatibilities
  6693. ------------------------
  6694. - Third party extensions built for Python 1.5.x cannot be used with
  6695. Python 1.6; these extensions will have to be rebuilt for Python 1.6.
  6696. - On Windows, attempting to import a third party extension built for
  6697. Python 1.5.x results in an immediate crash; there's not much we can do
  6698. about this. Check your PYTHONPATH environment variable!
  6699. Overview of Changes since 1.5.2
  6700. -------------------------------
  6701. For this overview, I have borrowed from the document "What's New in
  6702. Python 2.0" by Andrew Kuchling and Moshe Zadka:
  6703. http://www.amk.ca/python/2.0/ .
  6704. There are lots of new modules and lots of bugs have been fixed. A
  6705. list of all new modules is included below.
  6706. Probably the most pervasive change is the addition of Unicode support.
  6707. We've added a new fundamental datatype, the Unicode string, a new
  6708. build-in function unicode(), an numerous C APIs to deal with Unicode
  6709. and encodings. See the file Misc/unicode.txt for details, or
  6710. http://starship.python.net/crew/lemburg/unicode-proposal.txt.
  6711. Two other big changes, related to the Unicode support, are the
  6712. addition of string methods and (yet another) new regular expression
  6713. engine.
  6714. - String methods mean that you can now say s.lower() etc. instead of
  6715. importing the string module and saying string.lower(s) etc. One
  6716. peculiarity is that the equivalent of string.join(sequence,
  6717. delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
  6718. the effect of string.join(sequence); to make this more readable, try
  6719. space=" " first. Note that the maxsplit argument defaults in
  6720. split() and replace() have changed from 0 to -1.
  6721. - The new regular expression engine, SRE by Fredrik Lundh, is fully
  6722. backwards compatible with the old engine, and is in fact invoked
  6723. using the same interface (the "re" module). You can explicitly
  6724. invoke the old engine by import pre, or the SRE engine by importing
  6725. sre. SRE is faster than pre, and supports Unicode (which was the
  6726. main reason to put effort in yet another new regular expression
  6727. engine -- this is at least the fourth!).
  6728. Other Changes
  6729. -------------
  6730. Other changes that won't break code but are nice to know about:
  6731. Deleting objects is now safe even for deeply nested data structures.
  6732. Long/int unifications: long integers can be used in seek() calls, as
  6733. slice indexes.
  6734. String formatting (s % args) has a new formatting option, '%r', which
  6735. acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
  6736. alpha 1.)
  6737. Greg Ward's "distutils" package is included: this will make
  6738. installing, building and distributing third party packages much
  6739. simpler.
  6740. There's now special syntax that you can use instead of the apply()
  6741. function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
  6742. You can also use variations f(a1, a2, *args, **kwds) and you can leave
  6743. one or the other out: f(*args), f(**kwds).
  6744. The built-ins int() and long() take an optional second argument to
  6745. indicate the conversion base -- of course only if the first argument
  6746. is a string. This makes string.atoi() and string.atol() obsolete.
  6747. (string.atof() was already obsolete).
  6748. When a local variable is known to the compiler but undefined when
  6749. used, a new exception UnboundLocalError is raised. This is a class
  6750. derived from NameError so code catching NameError should still work.
  6751. The purpose is to provide better diagnostics in the following example:
  6752. x = 1
  6753. def f():
  6754. print x
  6755. x = x+1
  6756. This used to raise a NameError on the print statement, which confused
  6757. even experienced Python programmers (especially if there are several
  6758. hundreds of lines of code between the reference and the assignment to
  6759. x :-).
  6760. You can now override the 'in' operator by defining a __contains__
  6761. method. Note that it has its arguments backwards: x in a causes
  6762. a.__contains__(x) to be called. That's why the name isn't __in__.
  6763. The exception AttributeError will have a more friendly error message,
  6764. e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
  6765. <b>break code</b> that expects the message to be exactly the attribute
  6766. name.
  6767. New Modules in 1.6
  6768. ------------------
  6769. UserString - base class for deriving from the string type.
  6770. distutils - tools for distributing Python modules.
  6771. robotparser - parse a robots.txt file, for writing web spiders.
  6772. (Moved from Tools/webchecker/.)
  6773. linuxaudiodev - audio for Linux.
  6774. mmap - treat a file as a memory buffer. (Windows and Unix.)
  6775. sre - regular expressions (fast, supports unicode). Currently, this
  6776. code is very rough. Eventually, the re module will be reimplemented
  6777. using sre (without changes to the re API).
  6778. filecmp - supersedes the old cmp.py and dircmp.py modules.
  6779. tabnanny - check Python sources for tab-width dependance. (Moved from
  6780. Tools/scripts/.)
  6781. urllib2 - new and improved but incompatible version of urllib (still
  6782. experimental).
  6783. zipfile - read and write zip archives.
  6784. codecs - support for Unicode encoders/decoders.
  6785. unicodedata - provides access to the Unicode 3.0 database.
  6786. _winreg - Windows registry access.
  6787. encodings - package which provides a large set of standard codecs --
  6788. currently only for the new Unicode support. It has a drop-in extension
  6789. mechanism which allows you to add new codecs by simply copying them
  6790. into the encodings package directory. Asian codec support will
  6791. probably be made available as separate distribution package built upon
  6792. this technique and the new distutils package.
  6793. Changed Modules
  6794. ---------------
  6795. readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
  6796. chunk, wave, random, shelve, nntplib - minor enhancements.
  6797. socket, httplib, urllib - optional OpenSSL support (Unix only).
  6798. _tkinter - support for 8.0 up to 8.3. Support for versions older than
  6799. 8.0 has been dropped.
  6800. string - most of this module is deprecated now that strings have
  6801. methods. This no longer uses the built-in strop module, but takes
  6802. advantage of the new string methods to provide transparent support for
  6803. both Unicode and ordinary strings.
  6804. Changes on Windows
  6805. ------------------
  6806. The installer no longer runs a separate Tcl/Tk installer; instead, it
  6807. installs the needed Tcl/Tk files directly in the Python directory. If
  6808. you already have a Tcl/Tk installation, this wastes some disk space
  6809. (about 4 Megs) but avoids problems with conflincting Tcl/Tk
  6810. installations, and makes it much easier for Python to ensure that
  6811. Tcl/Tk can find all its files. Note: the alpha installers don't
  6812. include the documentation.
  6813. The Windows installer now installs by default in \Python16\ on the
  6814. default volume, instead of \Program Files\Python-1.6\.
  6815. Changed Tools
  6816. -------------
  6817. IDLE - complete overhaul. See the <a href="../idle/">IDLE home
  6818. page</a> for more information. (Python 1.6 alpha 1 will come with
  6819. IDLE 0.6.)
  6820. Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
  6821. text extraction tool used for internationalizing applications written
  6822. in Python.
  6823. Obsolete Modules
  6824. ----------------
  6825. stdwin and everything that uses it. (Get Python 1.5.2 if you need
  6826. it. :-)
  6827. soundex. (Skip Montanaro has a version in Python but it won't be
  6828. included in the Python release.)
  6829. cmp, cmpcache, dircmp. (Replaced by filecmp.)
  6830. dump. (Use pickle.)
  6831. find. (Easily coded using os.walk().)
  6832. grep. (Not very useful as a library module.)
  6833. packmail. (No longer has any use.)
  6834. poly, zmod. (These were poor examples at best.)
  6835. strop. (No longer needed by the string module.)
  6836. util. (This functionality was long ago built in elsewhere).
  6837. whatsound. (Use sndhdr.)
  6838. Detailed Changes from 1.6b1 to 1.6
  6839. ----------------------------------
  6840. - Slight changes to the CNRI license. A copyright notice has been
  6841. added; the requirement to indicate the nature of modifications now
  6842. applies when making a derivative work available "to others" instead of
  6843. just "to the public"; the version and date are updated. The new
  6844. license has a new handle.
  6845. - Added the Tools/compiler package. This is a project led by Jeremy
  6846. Hylton to write the Python bytecode generator in Python.
  6847. - The function math.rint() is removed.
  6848. - In Python.h, "#define _GNU_SOURCE 1" was added.
  6849. - Version 0.9.1 of Greg Ward's distutils is included (instead of
  6850. version 0.9).
  6851. - A new version of SRE is included. It is more stable, and more
  6852. compatible with the old RE module. Non-matching ranges are indicated
  6853. by -1, not None. (The documentation said None, but the PRE
  6854. implementation used -1; changing to None would break existing code.)
  6855. - The winreg module has been renamed to _winreg. (There are plans for
  6856. a higher-level API called winreg, but this has not yet materialized in
  6857. a form that is acceptable to the experts.)
  6858. - The _locale module is enabled by default.
  6859. - Fixed the configuration line for the _curses module.
  6860. - A few crashes have been fixed, notably <file>.writelines() with a
  6861. list containing non-string objects would crash, and there were
  6862. situations where a lost SyntaxError could dump core.
  6863. - The <list>.extend() method now accepts an arbitrary sequence
  6864. argument.
  6865. - If __str__() or __repr__() returns a Unicode object, this is
  6866. converted to an 8-bit string.
  6867. - Unicode string comparisons is no longer aware of UTF-16
  6868. encoding peculiarities; it's a straight 16-bit compare.
  6869. - The Windows installer now installs the LICENSE file and no longer
  6870. registers the Python DLL version in the registry (this is no longer
  6871. needed). It now uses Tcl/Tk 8.3.2.
  6872. - A few portability problems have been fixed, in particular a
  6873. compilation error involving socklen_t.
  6874. - The PC configuration is slightly friendlier to non-Microsoft
  6875. compilers.
  6876. ======================================================================
  6877. ======================================
  6878. ==> Release 1.5.2 (April 13, 1999) <==
  6879. ======================================
  6880. From 1.5.2c1 to 1.5.2 (final)
  6881. =============================
  6882. Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6883. * PCbuild/python15.wse: Bump version to 1.5.2 (final)
  6884. * PCbuild/python15.dsp: Added shamodule.c
  6885. * PC/config.c: Added sha module!
  6886. * README, Include/patchlevel.h: Prepare for final release.
  6887. * Misc/ACKS:
  6888. More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
  6889. * Python/thread_solaris.h:
  6890. While I can't really test this thoroughly, Pat Knight and the Solaris
  6891. man pages suggest that the proper thing to do is to add THR_NEW_LWP to
  6892. the flags on thr_create(), and that there really isn't a downside, so
  6893. I'll do that.
  6894. * Misc/ACKS:
  6895. Bunch of new names who helped iron out the last wrinkles of 1.5.2.
  6896. * PC/python_nt.rc:
  6897. Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
  6898. (I can't even display this on NT, maybe Win/98 can?)
  6899. * Lib/pstats.py:
  6900. Fix mysterious references to jprofile that were in the source since
  6901. its creation. I'm assuming these were once valid references to "Jim
  6902. Roskind's profile"...
  6903. * Lib/Attic/threading_api.py:
  6904. Removed; since long subsumed in Doc/lib/libthreading.tex
  6905. * Modules/socketmodule.c:
  6906. Put back __osf__ support for gethostbyname_r(); the real bug was that
  6907. it was being used even without threads. This of course might be an
  6908. all-platform problem so now we only use the _r variant when we are
  6909. using threads.
  6910. Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6911. * Modules/cPickle.c:
  6912. Fix accidentally reversed NULL test in load_mark(). Suggested by
  6913. Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
  6914. returns NULL.)
  6915. * README:
  6916. Add note about popen2 problem on Linux noticed by Pablo Bleyer.
  6917. * README: Add note about -D_REENTRANT for HP-UX 10.20.
  6918. * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
  6919. * PC/Attic/vc40.mak, PC/readme.txt:
  6920. Remove all VC++ info (except VC 1.5) from readme.txt;
  6921. remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
  6922. * README: Clarify PC build instructions (point to PCbuild).
  6923. * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
  6924. * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
  6925. Forgot to add this file. CDROM device parameters.
  6926. * Lib/gzip.py: Two different changes.
  6927. 1. Jack Jansen reports that on the Mac, the time may be negative, and
  6928. solves this by adding a write32u() function that writes an unsigned
  6929. long.
  6930. 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
  6931. casting both values to be compared to "unsigned long" i.e. modulo
  6932. 0x100000000L.
  6933. Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6934. * PC/Attic/_tkinter.def: No longer needed.
  6935. * Misc/ACKS: Correct missed character in Andrew Dalke's name.
  6936. * README: Add DEC Ultrix notes (from Donn Cave's email).
  6937. * configure: The usual
  6938. * configure.in:
  6939. Quote a bunch of shell variables used in test, related to long-long.
  6940. * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
  6941. casts for picky compilers.
  6942. * Modules/socketmodule.c:
  6943. 3-arg gethostbyname_r doesn't really work on OSF/1.
  6944. * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
  6945. Avoid totally empty files.
  6946. Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6947. * Tools/scripts/fixps.py: Use re instead of regex.
  6948. Don't rewrite the file in place.
  6949. (Reported by Andy Dustman.)
  6950. * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
  6951. Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6952. * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
  6953. Add a variable %_TCL_% that makes it easier to switch to a different version.
  6954. ======================================================================
  6955. From 1.5.2b2 to 1.5.2c1
  6956. =======================
  6957. Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6958. * PCbuild/python15.wse:
  6959. Release 1.5.2c1. Add IDLE and Uninstall to program group.
  6960. Don't distribute zlib.dll. Tweak some comments.
  6961. * PCbuild/zlib.dsp: Now using static zlib 1.1.3
  6962. * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
  6963. The usual
  6964. * Include/patchlevel.h: Release 1.5.2c1
  6965. * README: Release 1.5.2c1.
  6966. * Misc/NEWS: News for the 1.5.2c1 release.
  6967. * Lib/test/test_strftime.py:
  6968. On Windows, we suddenly find, strftime() may return "" for an
  6969. unsupported format string. (I guess this is because the logic for
  6970. deciding whether to reallocate the buffer or not has been improved.)
  6971. This caused the test code to crash on result[0]. Fix this by assuming
  6972. an empty result also means the format is not supported.
  6973. * Demo/tkinter/matt/window-creation-w-location.py:
  6974. This demo imported some private code from Matt. Make it cripple along.
  6975. * Lib/lib-tk/Tkinter.py:
  6976. Delete an accidentally checked-in feature that actually broke more
  6977. than was worth it: when deleting a canvas item, it would try to
  6978. automatically delete the bindings for that item. Since there's
  6979. nothing that says you can't reuse the tag and still have the bindings,
  6980. this is not correct. Also, it broke at least one demo
  6981. (Demo/tkinter/matt/rubber-band-box-demo-1.py).
  6982. * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
  6983. Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  6984. * Modules/zlibmodule.c:
  6985. Patch by Andrew Kuchling to unflush() (flush() for deflating).
  6986. Without this, if inflate() returned Z_BUF_ERROR asking for more output
  6987. space, we would report the error; now, we increase the buffer size and
  6988. try again, just as for Z_OK.
  6989. * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
  6990. * Tools/idle/ChangeLog: New change log.
  6991. * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
  6992. * Python/pythonrun.c:
  6993. Alas, get rid of the Win specific hack to ask the user to press Return
  6994. before exiting when an error happened. This didn't work right when
  6995. Python is invoked from a daemon.
  6996. * Tools/idle/idlever.py: Version bump awaiting impending new release.
  6997. (Not much has changed :-( )
  6998. * Lib/lib-tk/Tkinter.py:
  6999. lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
  7000. so the preferred name for them is tag_lower, tag_raise
  7001. (similar to tag_bind, and similar to the Text widget);
  7002. unfortunately can't delete the old ones yet (maybe in 1.6)
  7003. * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
  7004. Changes by Mark Hammond for Windows CE. Mostly of the form
  7005. #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
  7006. * Python/bltinmodule.c:
  7007. Remove unused variable from complex_from_string() code.
  7008. * Include/patchlevel.h:
  7009. Add the possibility of a gamma release (release candidate).
  7010. Add '+' to string version number to indicate we're beyond b2 now.
  7011. * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
  7012. * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
  7013. Per writes:
  7014. """
  7015. The application where Signum Support uses smtplib needs to be able to
  7016. report good error messages to the user when sending email fails. To
  7017. help in diagnosing problems it is useful to be able to report the
  7018. entire message sent by the server, not only the SMTP error code of the
  7019. offending command.
  7020. A lot of the functions in sendmail.py unfortunately discards the
  7021. message, leaving only the code. The enclosed patch fixes that
  7022. problem.
  7023. The enclosed patch also introduces a base class for exceptions that
  7024. include an SMTP error code and error message, and make the code and
  7025. message available on separate attributes, so that surrounding code can
  7026. deal with them in whatever way it sees fit. I've also added some
  7027. documentation to the exception classes.
  7028. The constructor will now raise an exception if it cannot connect to
  7029. the SMTP server.
  7030. The data() method will raise an SMTPDataError if it doesn't receive
  7031. the expected 354 code in the middle of the exchange.
  7032. According to section 5.2.10 of RFC 1123 a smtp client must accept "any
  7033. text, including no text at all" after the error code. If the response
  7034. of a HELO command contains no text self.helo_resp will be set to the
  7035. empty string (""). The patch fixes the test in the sendmail() method
  7036. so that helo_resp is tested against None; if it has the empty string
  7037. as value the sendmail() method would invoke the helo() method again.
  7038. The code no longer accepts a -1 reply from the ehlo() method in
  7039. sendmail().
  7040. [Text about removing SMTPRecipientsRefused deleted --GvR]
  7041. """
  7042. and also:
  7043. """
  7044. smtplib.py appends an extra blank line to the outgoing mail if the
  7045. `msg' argument to the sendmail method already contains a trailing
  7046. newline. This patch should fix the problem.
  7047. """
  7048. The Dragon writes:
  7049. """
  7050. Mostly I just re-added the SMTPRecipientsRefused exception
  7051. (the exeption object now has the appropriate info in it ) [Per had
  7052. removed this in his patch --GvR] and tweaked the behavior of the
  7053. sendmail method whence it throws the newly added SMTPHeloException (it
  7054. was closing the connection, which it shouldn't. whatever catches the
  7055. exception should do that. )
  7056. I pondered the change of the return values to tuples all around,
  7057. and after some thinking I decided that regularizing the return values was
  7058. too much of the Right Thing (tm) to not do.
  7059. My one concern is that code expecting an integer & getting a tuple
  7060. may fail silently.
  7061. (i.e. if it's doing :
  7062. x.somemethod() >= 400:
  7063. expecting an integer, the expression will always be true if it gets a
  7064. tuple instead. )
  7065. However, most smtplib code I've seen only really uses the
  7066. sendmail() method, so this wouldn't bother it. Usually code I've seen
  7067. that calls the other methods usually only calls helo() and ehlo() for
  7068. doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
  7069. and thus I would think not much code uses it yet.
  7070. """
  7071. Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7072. * Lib/test/test_ntpath.py:
  7073. Fix the tests now that splitdrive() no longer treats UNC paths special.
  7074. (Some tests converted to splitunc() tests.)
  7075. * Lib/ntpath.py:
  7076. Withdraw the UNC support from splitdrive(). Instead, a new function
  7077. splitunc() parses UNC paths. The contributor of the UNC parsing in
  7078. splitdrive() doesn't like it, but I haven't heard a good reason to
  7079. keep it, and it causes some problems. (I think there's a
  7080. philosophical problem -- to me, the split*() functions are purely
  7081. syntactical, and the fact that \\foo is not a valid path doesn't mean
  7082. that it shouldn't be considered an absolute path.)
  7083. Also (quite separately, but strangely related to the philosophical
  7084. issue above) fix abspath() so that if win32api exists, it doesn't fail
  7085. when the path doesn't actually exist -- if GetFullPathName() fails,
  7086. fall back on the old strategy (join with getcwd() if necessary, and
  7087. then use normpath()).
  7088. * configure.in, configure, config.h.in, acconfig.h:
  7089. For BeOS PowerPC. Chris Herborth.
  7090. Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7091. * Modules/timemodule.c:
  7092. Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
  7093. #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
  7094. * Misc/ACKS:
  7095. Bunch of new contributors, including 9 who contributed to the Docs,
  7096. reported by Fred.
  7097. Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7098. * Lib/gzip.py:
  7099. Oops, missed mode parameter to open().
  7100. * Lib/gzip.py:
  7101. Made the default mode 'rb' instead of 'r', for better cross-platform
  7102. support. (Based on comment on the documentation by Bernhard Reiter
  7103. <bernhard@csd.uwm.edu>).
  7104. Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7105. * Tools/scripts/dutree.py:
  7106. For reasons I dare not explain, this script should always execute
  7107. main() when imported (in other words, it is not usable as a module).
  7108. Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7109. * Lib/test/test_cpickle.py: Jonathan Giddy write:
  7110. In test_cpickle.py, the module os got imported, but the line to remove
  7111. the temp file has gone missing.
  7112. Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7113. * Lib/BaseHTTPServer.py: Per Cederqvist writes:
  7114. If you send something like "PUT / HTTP/1.0" to something derived from
  7115. BaseHTTPServer that doesn't define do_PUT, you will get a response
  7116. that begins like this:
  7117. HTTP/1.0 501 Unsupported method ('do_PUT')
  7118. Server: SimpleHTTP/0.3 Python/1.5
  7119. Date: Tue, 30 Mar 1999 18:53:53 GMT
  7120. The server should complain about 'PUT' instead of 'do_PUT'. This
  7121. patch should fix the problem.
  7122. Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7123. * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
  7124. """
  7125. - It needlessly used the makefile() method for each response that is
  7126. read from the SMTP server.
  7127. - If the remote SMTP server closes the connection unexpectedly the
  7128. code raised an IndexError. It now raises an SMTPServerDisconnected
  7129. exception instead.
  7130. - The code now checks that all lines in a multiline response actually
  7131. contains an error code.
  7132. """
  7133. The Dragon approves.
  7134. Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7135. * Lib/compileall.py:
  7136. When run as a script, report failures in the exit code as well.
  7137. Patch largely based on changes by Andrew Dalke, as discussed in the
  7138. distutils-sig.
  7139. Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7140. * Lib/urllib.py:
  7141. Hack so that if a 302 or 301 redirect contains a relative URL, the
  7142. right thing "just happens" (basejoin() with old URL).
  7143. * Modules/cPickle.c:
  7144. Protection against picling to/from closed (real) file.
  7145. The problem was reported by Moshe Zadka.
  7146. * Lib/test/test_cpickle.py:
  7147. Test protection against picling to/from closed (real) file.
  7148. * Modules/timemodule.c: Chris Lawrence writes:
  7149. """
  7150. The GNU folks, in their infinite wisdom, have decided not to implement
  7151. altzone in libc6; this would not be horrible, except that timezone
  7152. (which is implemented) includes the current DST setting (i.e. timezone
  7153. for Central is 18000 in summer and 21600 in winter). So Python's
  7154. timezone and altzone variables aren't set correctly during DST.
  7155. Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
  7156. show the "right" thing on Linux (by using the tm_gmtoff stuff
  7157. available in BSD, which is how the GLIBC manual claims things should
  7158. be done) and (b) should cope with the southern hemisphere. In pursuit
  7159. of (b), I also took the liberty of renaming the "summer" and "winter"
  7160. variables to "july" and "jan". This patch should also make certain
  7161. time calculations on Linux actually work right (like the tz-aware
  7162. functions in the rfc822 module).
  7163. (It's hard to find DST that's currently being used in the southern
  7164. hemisphere; I tested using Africa/Windhoek.)
  7165. """
  7166. * Lib/test/output/test_gzip:
  7167. Jonathan Giddy discovered this file was missing.
  7168. * Modules/shamodule.c:
  7169. Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
  7170. middlename) Marangozov, patch coded by Greg Stein.
  7171. * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
  7172. At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
  7173. Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7174. * Tools/scripts/ndiff.py: Tim Peters writes:
  7175. I should have waited overnight <wink/sigh>. Nothing wrong with the one I
  7176. sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
  7177. for recreating the original files from ndiff's output. That's attached, if
  7178. you're game! Us Windows guys don't usually have a sed sitting around
  7179. <wink>.
  7180. Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7181. * Tools/scripts/ndiff.py: Tim Peters writes:
  7182. Attached is a cleaned-up version of ndiff (added useful module
  7183. docstring, now echo'ed in case of cmd line mistake); added -q option
  7184. to suppress initial file identification lines; + other minor cleanups,
  7185. & a slightly faster match engine.
  7186. Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7187. * Tools/scripts/dutree.py:
  7188. During display, if EPIPE is raised, it's probably because a pager was
  7189. killed. Discard the error in that case, but propogate it otherwise.
  7190. Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7191. * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
  7192. Test suite for UserList.
  7193. * Lib/UserList.py: Use isinstance() where appropriate.
  7194. Reformatted with 4-space indent.
  7195. Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
  7196. * Tools/pynche/PyncheWidget.py:
  7197. Helpwin.__init__(): The text widget should get focus.
  7198. * Tools/pynche/pyColorChooser.py:
  7199. Removed unnecessary import `from PyncheWidget import PyncheWidget'
  7200. Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7201. * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
  7202. Test suite for UserDict
  7203. * Lib/UserDict.py: Improved a bunch of things.
  7204. The constructor now takes an optional dictionary.
  7205. Use isinstance() where appropriate.
  7206. Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7207. * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
  7208. Basic regr tests for pickle/cPickle
  7209. * Lib/pickle.py:
  7210. Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
  7211. points out) it doesn't work in JPython Applets.
  7212. Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
  7213. * Lib/test/test_gzip.py:
  7214. Added a simple test suite for gzip. It simply opens a temp file,
  7215. writes a chunk of compressed data, closes it, writes another chunk, and
  7216. reads the contents back to verify that they are the same.
  7217. * Lib/gzip.py:
  7218. Based on a suggestion from bruce@hams.com, make a trivial change to
  7219. allow using the 'a' flag as a mode for opening a GzipFile. gzip
  7220. files, surprisingly enough, can be concatenated and then decompressed;
  7221. the effect is to concatenate the two chunks of data.
  7222. If we support it on writing, it should also be supported on reading.
  7223. This *wasn't* trivial, and required rearranging the code in the
  7224. reading path, particularly the _read() method.
  7225. Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
  7226. and 'Unknown compression method'
  7227. Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7228. * Lib/test/test_b1.py:
  7229. Add tests for float() and complex() with string args (Nick/Stephanie
  7230. Lockwood).
  7231. Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
  7232. * Modules/zlibmodule.c:
  7233. Add an .unused_data attribute to decompressor objects. If .unused_data
  7234. is not an empty string, this means that you have arrived at the
  7235. end of the stream of compressed data, and the contents of .unused_data are
  7236. whatever follows the compressed stream.
  7237. Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7238. * Python/bltinmodule.c:
  7239. Patch by Nick and Stephanie Lockwood to implement complex() with a string
  7240. argument. This closes TODO item 2.19.
  7241. Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7242. * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
  7243. Unfortunately his code breaks wcgui.py in a way that's not easy
  7244. to fix. I expect that this is a temporary situation --
  7245. eventually Sam's changes will be merged back in.
  7246. (The changes add a -t option to specify exceptions to the -x
  7247. option, and explicit checking for #foo style fragment ids.)
  7248. * Objects/dictobject.c:
  7249. Vladimir Marangozov contributed updated comments.
  7250. * Objects/bufferobject.c: Folded long lines.
  7251. * Lib/test/output/test_sha, Lib/test/test_sha.py:
  7252. Added Jeremy's test code for the sha module.
  7253. * Modules/shamodule.c, Modules/Setup.in:
  7254. Added Greg Stein and Andrew Kuchling's sha module.
  7255. Fix comments about zlib version and URL.
  7256. * Lib/test/test_bsddb.py: Remove the temp file when we're done.
  7257. * Include/pythread.h: Conform to standard boilerplate.
  7258. * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
  7259. Chris Herborth: the new compiler in R4.1 needs some new options to work...
  7260. * Modules/socketmodule.c:
  7261. Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
  7262. data struct before calling gethostby{name,addr}_r(); (2) ignore the
  7263. 3/5/6 args determinations made by the configure script and switch on
  7264. platform identifiers instead:
  7265. AIX, OSF have 3 args
  7266. Sun, SGI have 5 args
  7267. Linux has 6 args
  7268. On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
  7269. * Modules/socketmodule.c:
  7270. Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
  7271. * Lib/mailbox.py:
  7272. Add readlines() to _Subfile class. Not clear who would need it, but
  7273. Chris Lawrence sent me a broken version; this one is a tad simpler and
  7274. more conforming to the standard.
  7275. Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
  7276. * Lib/gzip.py: use struct instead of bit-manipulate in Python
  7277. Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7278. * Modules/Makefile.pre.in:
  7279. Add $(EXE) to various occurrences of python so it will work on Cygwin
  7280. with egcs (after setting EXE=.exe). Patch by Norman Vine.
  7281. * configure, configure.in:
  7282. Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
  7283. Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7284. * Include/thread.h:
  7285. Adding thread.h -- unused but for b/w compatibility.
  7286. As requested by Bill Janssen.
  7287. * configure.in, configure:
  7288. Add code to test for all sorts of gethostbyname_r variants,
  7289. donated by David Arnold.
  7290. * config.h.in, acconfig.h:
  7291. Add symbols for gethostbyname_r variants (sigh).
  7292. * Modules/socketmodule.c: Clean up pass for the previous patches.
  7293. - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
  7294. glibc2.
  7295. - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
  7296. don't know what code should be used.
  7297. - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
  7298. - Modify the gethostbyaddr() code to also hold on to the lock until
  7299. after it is safe to release, overlapping with the Python lock.
  7300. (Note: I think that it could in theory be possible that Python code
  7301. executed while gethostbyname_lock is held could attempt to reacquire
  7302. the lock -- e.g. in a signal handler or destructor. I will simply say
  7303. "don't do that then.")
  7304. * Modules/socketmodule.c: Jonathan Giddy writes:
  7305. Here's a patch to fix the race condition, which wasn't fixed by Rob's
  7306. patch. It holds the gethostbyname lock until the results are copied out,
  7307. which means that this lock and the Python global lock are held at the same
  7308. time. This shouldn't be a problem as long as the gethostbyname lock is
  7309. always acquired when the global lock is not held.
  7310. Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
  7311. * Modules/zlibmodule.c:
  7312. Fixed the flush() method of compression objects; the test for
  7313. the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
  7314. Logic cleaned up and commented.
  7315. * Lib/test/test_zlib.py:
  7316. Added simple test for the flush() method of compression objects, trying the
  7317. different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
  7318. Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7319. * Lib/shlex.py:
  7320. Bug reported by Tobias Thelen: missing "self." in assignment target.
  7321. Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7322. * Modules/arraymodule.c:
  7323. Use an unsigned cast to avoid a warning in VC++.
  7324. * Lib/dospath.py, Lib/ntpath.py:
  7325. New code for split() by Tim Peters, behaves more like posixpath.split().
  7326. * Objects/floatobject.c:
  7327. Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
  7328. a block cannot be freed, add its free items back to the free list.
  7329. This is necessary to avoid leaking when Python is reinitialized later.
  7330. * Objects/intobject.c:
  7331. Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
  7332. a block cannot be freed, add its free items back to the free list, and
  7333. add its valid ints back to the small_ints array if they are in range.
  7334. This is necessary to avoid leaking when Python is reinitialized later.
  7335. * Lib/types.py:
  7336. Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
  7337. * Python/bltinmodule.c:
  7338. New builtin buffer() creates a derived read-only buffer from any
  7339. object that supports the buffer interface (e.g. strings, arrays).
  7340. * Objects/bufferobject.c:
  7341. Added check for negative offset for PyBuffer_FromObject and check for
  7342. negative size for PyBuffer_FromMemory. Greg Stein.
  7343. Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7344. * Lib/urlparse.py: Sjoerd Mullender writes:
  7345. If a filename on Windows starts with \\, it is converted to a URL
  7346. which starts with ////. If this URL is passed to urlparse.urlparse
  7347. you get a path that starts with // (and an empty netloc). If you pass
  7348. the result back to urlparse.urlunparse, you get a URL that starts with
  7349. //, which is parsed differently by urlparse.urlparse. The fix is to
  7350. add the (empty) netloc with accompanying slashes if the path in
  7351. urlunparse starts with //. Do this for all schemes that use a netloc.
  7352. * Lib/nturl2path.py: Sjoerd Mullender writes:
  7353. Pathnames of files on other hosts in the same domain
  7354. (\\host\path\to\file) are not translated correctly to URLs and back.
  7355. The URL should be something like file:////host/path/to/file.
  7356. Note that a combination of drive letter and remote host is not
  7357. possible.
  7358. Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7359. * Lib/urlparse.py:
  7360. Delete non-standard-conforming code in urljoin() that would use the
  7361. netloc from the base url as the default netloc for the resulting url
  7362. even if the schemes differ.
  7363. Once upon a time, when the web was wild, this was a valuable hack
  7364. because some people had a URL referencing an ftp server colocated with
  7365. an http server without having the host in the ftp URL (so they could
  7366. replicate it or change the hostname easily).
  7367. More recently, after the file: scheme got added back to the list of
  7368. schemes that accept a netloc, it turns out that this caused weirdness
  7369. when joining an http: URL with a file: URL -- the resulting file: URL
  7370. would always inherit the host from the http: URL because the file:
  7371. scheme supports a netloc but in practice never has one.
  7372. There are two reasons to get rid of the old, once-valuable hack,
  7373. instead of removing the file: scheme from the uses_netloc list. One,
  7374. the RFC says that file: uses the netloc syntax, and does not endorse
  7375. the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
  7376. hack.
  7377. * Include/ceval.h, Include/abstract.h:
  7378. Add DLL level b/w compat for PySequence_In and PyEval_CallObject
  7379. Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7380. * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
  7381. An attempt to execute grid_slaves with arguments (0,0) results in
  7382. *all* of the slaves being returned, not just the slave associated with
  7383. row 0, column 0. This is because the test for arguments in the method
  7384. does not test to see if row (and column) does not equal None, but
  7385. rather just whether is evaluates to non-false. A value of 0 fails
  7386. this test.
  7387. Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7388. * Modules/cmathmodule.c:
  7389. Docstring fix: acosh() returns the hyperbolic arccosine, not the
  7390. hyperbolic cosine. Problem report via David Ascher by one of his
  7391. students.
  7392. Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7393. * configure.in:
  7394. Should test for gethost*by*name_r, not for gethostname_r (which
  7395. doesn't exist and doesn't make sense).
  7396. * Modules/socketmodule.c:
  7397. Patch by Rob Riggs for Linux -- glibc2 has a different argument
  7398. converntion for gethostbyname_r() etc. than Solaris!
  7399. * Python/thread_pthread.h: Rob Riggs wrote:
  7400. """
  7401. Spec says that on success pthread_create returns 0. It does not say
  7402. that an error code will be < 0. Linux glibc2 pthread_create() returns
  7403. ENOMEM (12) when one exceed process limits. (It looks like it should
  7404. return EAGAIN, but that's another story.)
  7405. For reference, see:
  7406. http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
  7407. """
  7408. [I have a feeling that similar bugs were fixed before; perhaps someone
  7409. could check that all error checks no check for != 0?]
  7410. * Tools/bgen/bgen/bgenObjectDefinition.py:
  7411. New mixin class that defines cmp and hash that use
  7412. the ob_itself pointer. This allows (when using the mixin)
  7413. different Python objects pointing to the same C object and
  7414. behaving well as dictionary keys.
  7415. Or so sez Jack Jansen...
  7416. * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
  7417. Don't convert URLs to URLs using pathname2url.
  7418. Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7419. * Lib/cmd.py: Patch by Michael Scharf. He writes:
  7420. The module cmd requires for each do_xxx command a help_xxx
  7421. function. I think this is a little old fashioned.
  7422. Here is a patch: use the docstring as help if no help_xxx
  7423. function can be found.
  7424. [I'm tempted to rip out all the help_* functions from pdb, but I'll
  7425. resist it. Any takers? --Guido]
  7426. * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
  7427. Under Windows, python freeze.py -o hello hello.py
  7428. creates all the correct files in the hello subdirectory, but the
  7429. Makefile has the directory prefix in it for frozen_extensions.c
  7430. nmake fails because it tries to locate hello/frozen_extensions.c
  7431. (His fix adds a call to os.path.basename() in the appropriate place.)
  7432. * Objects/floatobject.c, Objects/intobject.c:
  7433. Vladimir has restructured his code somewhat so that the blocks are now
  7434. represented by an explicit structure. (There are still too many casts
  7435. in the code, but that may be unavoidable.)
  7436. Also added code so that with -vv it is very chatty about what it does.
  7437. * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
  7438. Change #! line to modern usage; also chmod +x
  7439. * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
  7440. Change #! line to modern usage
  7441. * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
  7442. The filename to URL conversion didn't properly quote special
  7443. characters.
  7444. The URL to filename didn't properly unquote special chatacters.
  7445. * Objects/floatobject.c:
  7446. OK, try again. Vladimir gave me a fix for the alignment bus error,
  7447. so here's his patch again. This time it works (at least on Solaris,
  7448. Linux and Irix).
  7449. Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7450. * Tools/idle/PathBrowser.py:
  7451. Don't crash when sys.path contains an empty string.
  7452. * Tools/idle/PathBrowser.py:
  7453. - Don't crash in the case where a superclass is a string instead of a
  7454. pyclbr.Class object; this can happen when the superclass is
  7455. unrecognizable (to pyclbr), e.g. when module renaming is used.
  7456. - Show a watch cursor when calling pyclbr (since it may take a while
  7457. recursively parsing imported modules!).
  7458. Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7459. * Lib/mimetypes.py:
  7460. Added .rdf and .xsl as application/xml types. (.rdf is for the
  7461. Resource Description Framework, a metadata encoding, and .xsl is for
  7462. the Extensible Stylesheet Language.)
  7463. Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7464. * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
  7465. Test for popen2 module, by Chris Tismer.
  7466. * Objects/floatobject.c:
  7467. Alas, Vladimir's patch caused a bus error (probably double
  7468. alignment?), and I didn't test it. Withdrawing it for now.
  7469. Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7470. * Objects/floatobject.c:
  7471. Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
  7472. floats on finalization.
  7473. * Objects/intobject.c:
  7474. Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
  7475. integers on finalization.
  7476. * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
  7477. Add PathBrowser to File module
  7478. * Tools/idle/PathBrowser.py:
  7479. "Path browser" - 4 scrolled lists displaying:
  7480. directories on sys.path
  7481. modules in selected directory
  7482. classes in selected module
  7483. methods of selected class
  7484. Sinlge clicking in a directory, module or class item updates the next
  7485. column with info about the selected item. Double clicking in a
  7486. module, class or method item opens the file (and selects the clicked
  7487. item if it is a class or method).
  7488. I guess eventually I should be using a tree widget for this, but the
  7489. ones I've seen don't work well enough, so for now I use the old
  7490. Smalltalk or NeXT style multi-column hierarchical browser.
  7491. * Tools/idle/MultiScrolledLists.py:
  7492. New utility: multiple scrolled lists in parallel
  7493. * Tools/idle/ScrolledList.py: - White background.
  7494. - Display "(None)" (or text of your choosing) when empty.
  7495. - Don't set the focus.
  7496. Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7497. * Lib/urllib.py:
  7498. open_http also had the 'data is None' test backwards. don't call with the
  7499. extra argument if data is None.
  7500. * Demo/embed/demo.c:
  7501. Call Py_SetProgramName() instead of redefining getprogramname(),
  7502. reflecting changes in the runtime around 1.5 or earlier.
  7503. * Python/ceval.c:
  7504. Always test for an error return (usually NULL or -1) without setting
  7505. an exception.
  7506. * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
  7507. He writes:
  7508. I had an off-by-1000 error in floatsleep(),
  7509. and the problem with time.clock() is that it's not implemented properly
  7510. on QNX... ANSI says it's supposed to return _CPU_ time used by the
  7511. process, but on QNX it returns the amount of real time used... so I was
  7512. confused.
  7513. * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
  7514. Test for self.returntype behaving like OSErr rather than being it.
  7515. Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
  7516. * Lib/urllib.py:
  7517. http_error had the 'data is None' test backwards. don't call with the
  7518. extra argument if data is None.
  7519. * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
  7520. * Lib/urllib.py: pleasing the tabnanny
  7521. Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7522. * Lib/colorsys.py:
  7523. Oops, one more "x, y, z" to convert...
  7524. * Lib/colorsys.py:
  7525. Adjusted comment at the top to be less confusing, following Fredrik
  7526. Lundh's example.
  7527. Converted comment to docstring.
  7528. Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7529. * Lib/toaiff.py:
  7530. Use sndhdr instead of the obsolete whatsound module.
  7531. Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
  7532. * Lib/urllib.py:
  7533. When performing a POST request, i.e. when the second argument to
  7534. urlopen is used to specify form data, make sure the second argument is
  7535. threaded through all of the http_error_NNN calls. This allows error
  7536. handlers like the redirect and authorization handlers to properly
  7537. re-start the connection.
  7538. Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7539. * Lib/mhlib.py: Patch by Lars Wirzenius:
  7540. o the initial comment is wrong: creating messages is already
  7541. implemented
  7542. o Message.getbodytext: if the mail or it's part contains an
  7543. empty content-transfer-encoding header, the code used to
  7544. break; the change below treats an empty encoding value the same
  7545. as the other types that do not need decoding
  7546. o SubMessage.getbodytext was missing the decode argument; the
  7547. change below adds it; I also made it unconditionally return
  7548. the raw text if decoding was not desired, because my own
  7549. routines needed that (and it was easier than rewriting my
  7550. own routines ;-)
  7551. Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
  7552. * Python/bltinmodule.c (initerrors):
  7553. Make sure that the exception tuples ("base-classes" when
  7554. string-based exceptions are used) reflect the real class hierarchy,
  7555. i.e. that SystemExit derives from Exception not StandardError.
  7556. * Lib/exceptions.py:
  7557. Document the correct class hierarchy for SystemExit. It is not an
  7558. error and so it derives from Exception and not SystemError. The
  7559. docstring was incorrect but the implementation was fine.
  7560. Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7561. * Lib/shutil.py:
  7562. Add import sys, needed by reference to sys.exc_info() in rmtree().
  7563. Discovered by Mitch Chapman.
  7564. * config.h.in:
  7565. Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
  7566. disappears. It wasn't used anywhere anyway...
  7567. * Modules/arraymodule.c:
  7568. Carefully check for overflow when allocating the memory for fromfile
  7569. -- someone tried to pass in sys.maxint and got bitten by the bogus
  7570. calculations.
  7571. * configure.in:
  7572. Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
  7573. LIBM (from --with-libm=...); this actually broke the customizability
  7574. offered by the latter option. Thanks go to Clay Spence for reporting
  7575. this.
  7576. * Lib/test/test_dl.py:
  7577. 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
  7578. 2. When no test case worked, raise ImportError instead of failing.
  7579. * Python/bltinmodule.c:
  7580. Patch by Tim Peters to improve the range checks for range() and
  7581. xrange(), especially for platforms where int and long are different
  7582. sizes (so sys.maxint isn't actually the theoretical limit for the
  7583. length of a list, but the largest C int is -- sys.maxint is the
  7584. largest Python int, which is actually a C long).
  7585. * Makefile.in:
  7586. 1. Augment the DG/UX rule so it doesn't break the BeOS build.
  7587. 2. Add $(EXE) to various occurrences of python so it will work on
  7588. Cygwin with egcs (after setting EXE=.exe). These patches by
  7589. Norman Vine.
  7590. * Lib/posixfile.py:
  7591. According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
  7592. list (of bsd variants that have a different lock structure).
  7593. * Lib/test/test_fcntl.py:
  7594. According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
  7595. * Modules/timemodule.c:
  7596. Patch by Tadayoshi Funaba (with some changes) to be smarter about
  7597. guessing what happened when strftime() returns 0. Is it buffer
  7598. overflow or was the result simply 0 bytes long? (This happens for an
  7599. empty format string, or when the format string is a single %Z and the
  7600. timezone is unknown.) if the buffer is at least 256 times as long as
  7601. the format, assume the latter.
  7602. Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7603. * Lib/urllib.py:
  7604. As Des Barry points out, we need to call pathname2url(file) in two
  7605. calls to addinfourl() in open_file().
  7606. * Modules/Setup.in: Document *static* -- in two places!
  7607. * Modules/timemodule.c:
  7608. We don't support leap seconds, so the seconds field of a time 9-tuple
  7609. should be in the range [0-59]. Noted by Tadayoshi Funaba.
  7610. * Modules/stropmodule.c:
  7611. In atoi(), don't use isxdigit() to test whether the last character
  7612. converted was a "digit" -- use isalnum(). This test is there only to
  7613. guard against "+" or "-" being interpreted as a valid int literal.
  7614. Reported by Takahiro Nakayama.
  7615. * Lib/os.py:
  7616. As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
  7617. so they don't need to be treated specially here.
  7618. Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7619. * Misc/NEWS:
  7620. Typo: "apparentlt" --> "apparently"
  7621. Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
  7622. * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
  7623. * Modules/posixmodule.c:
  7624. The docstring for ttyname(..) claims a second "mode" argument. The
  7625. actual code does not allow such an argument. (Finn Bock.)
  7626. * Lib/lib-old/poly.py:
  7627. Dang. Even though this is obsolete code, somebody found a bug, and I
  7628. fix it. Oh well.
  7629. Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
  7630. * Lib/pyclbr.py:
  7631. Bow to font-lock at the end of the docstring, since it throws stuff
  7632. off.
  7633. Make sure the path paramter to readmodule() is a list before adding it
  7634. with sys.path, or the addition could fail.
  7635. ======================================================================
  7636. From 1.5.2b1 to 1.5.2b2
  7637. =======================
  7638. General
  7639. -------
  7640. - Many memory leaks fixed.
  7641. - Many small bugs fixed.
  7642. - Command line option -OO (or -O -O) suppresses inclusion of doc
  7643. strings in resulting bytecode.
  7644. Windows-specific changes
  7645. ------------------------
  7646. - New built-in module winsound provides an interface to the Win32
  7647. PlaySound() call.
  7648. - Re-enable the audioop module in the config.c file.
  7649. - On Windows, support spawnv() and associated P_* symbols.
  7650. - Fixed the conversion of times() return values on Windows.
  7651. - Removed freeze from the installer -- it doesn't work without the
  7652. source tree. (See FAQ 8.11.)
  7653. - On Windows 95/98, the Tkinter module now is smart enough to find
  7654. Tcl/Tk even when the PATH environment variable hasn't been set -- when
  7655. the import of _tkinter fails, it searches in a standard locations,
  7656. patches os.environ["PATH"], and tries again. When it still fails, a
  7657. clearer error message is produced. This should avoid most
  7658. installation problems with Tkinter use (e.g. in IDLE).
  7659. - The -i option doesn't make any calls to set[v]buf() for stdin --
  7660. this apparently screwed up _kbhit() and the _tkinter main loop.
  7661. - The ntpath module (and hence, os.path on Windows) now parses out UNC
  7662. paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
  7663. splitdrive() will \\host\mountpoint as the drive and \dir\file as the
  7664. path. ** EXPERIMENTAL **
  7665. - Added a hack to the exit code so that if (1) the exit status is
  7666. nonzero and (2) we think we have our own DOS box (i.e. we're not
  7667. started from a command line shell), we print a message and wait for
  7668. the user to hit a key before the DOS box is closed.
  7669. - Updated the installer to WISE 5.0g. Added a dialog warning about
  7670. the imminent Tcl installation. Added a dialog to specify the program
  7671. group name in the start menu. Upgraded the Tcl installer to Tcl
  7672. 8.0.4.
  7673. Changes to intrinsics
  7674. ---------------------
  7675. - The repr() or str() of a module object now shows the __file__
  7676. attribute (i.e., the file which it was loaded), or the string
  7677. "(built-in)" if there is no __file__ attribute.
  7678. - The range() function now avoids overflow during its calculations (if
  7679. at all possible).
  7680. - New info string sys.hexversion, which is an integer encoding the
  7681. version in hexadecimal. In other words, hex(sys.hexversion) ==
  7682. 0x010502b2 for Python 1.5.2b2.
  7683. New or improved ports
  7684. ---------------------
  7685. - Support for Nextstep descendants (future Mac systems).
  7686. - Improved BeOS support.
  7687. - Support dynamic loading of shared libraries on NetBSD platforms that
  7688. use ELF (i.e., MIPS and Alpha systems).
  7689. Configuration/build changes
  7690. ---------------------------
  7691. - The Lib/test directory is no longer included in the default module
  7692. search path (sys.path) -- "test" has been a package ever since 1.5.
  7693. - Now using autoconf 2.13.
  7694. New library modules
  7695. -------------------
  7696. - New library modules asyncore and asynchat: these form Sam Rushing's
  7697. famous asynchronous socket library. Sam has gracefully allowed me to
  7698. incorporate these in the standard Python library.
  7699. - New module statvfs contains indexing constants for [f]statvfs()
  7700. return tuple.
  7701. Changes to the library
  7702. ----------------------
  7703. - The wave module (platform-independent support for Windows sound
  7704. files) has been fixed to actually make it work.
  7705. - The sunau module (platform-independent support for Sun/NeXT sound
  7706. files) has been fixed to work across platforms. Also, a weird
  7707. encoding bug in the header of the audio test data file has been
  7708. corrected.
  7709. - Fix a bug in the urllib module that occasionally tripped up
  7710. webchecker and other ftp retrieves.
  7711. - ConfigParser's get() method now accepts an optional keyword argument
  7712. (vars) that is substituted on top of the defaults that were setup in
  7713. __init__. You can now also have recusive references in your
  7714. configuration file.
  7715. - Some improvements to the Queue module, including a put_nowait()
  7716. module and an optional "block" second argument, to get() and put(),
  7717. defaulting to 1.
  7718. - The updated xmllib module is once again compatible with the version
  7719. present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
  7720. - The bdb module (base class for the debugger) now supports
  7721. canonicalizing pathnames used in breakpoints. The derived class must
  7722. override the new canonical() method for this to work. Also changed
  7723. clear_break() to the backwards compatible old signature, and added
  7724. clear_bpbynumber() for the new functionality.
  7725. - In sgmllib (and hence htmllib), recognize attributes even if they
  7726. don't have space in front of them. I.e. '<a
  7727. name="foo"href="bar.html">' will now have two attributes recognized.
  7728. - In the debugger (pdb), change clear syntax to support three
  7729. alternatives: clear; clear file:line; clear bpno bpno ...
  7730. - The os.path module now pretends to be a submodule within the os
  7731. "package", so you can do things like "from os.path import exists".
  7732. - The standard exceptions now have doc strings.
  7733. - In the smtplib module, exceptions are now classes. Also avoid
  7734. inserting a non-standard space after "TO" in rcpt() command.
  7735. - The rfc822 module's getaddrlist() method now uses all occurrences of
  7736. the specified header instead of just the first. Some other bugfixes
  7737. too (to handle more weird addresses found in a very large test set,
  7738. and to avoid crashes on certain invalid dates), and a small test
  7739. module has been added.
  7740. - Fixed bug in urlparse in the common-case code for HTTP URLs; it
  7741. would lose the query, fragment, and/or parameter information.
  7742. - The sndhdr module no longer supports whatraw() -- it depended on a
  7743. rare extenral program.
  7744. - The UserList module/class now supports the extend() method, like
  7745. real list objects.
  7746. - The uu module now deals better with trailing garbage generated by
  7747. some broke uuencoders.
  7748. - The telnet module now has an my_interact() method which uses threads
  7749. instead of select. The interact() method uses this by default on
  7750. Windows (where the single-threaded version doesn't work).
  7751. - Add a class to mailbox.py for dealing with qmail directory
  7752. mailboxes. The test code was extended to notice these being used as
  7753. well.
  7754. Changes to extension modules
  7755. ----------------------------
  7756. - Support for the [f]statvfs() system call, where it exists.
  7757. - Fixed some bugs in cPickle where bad input could cause it to dump
  7758. core.
  7759. - Fixed cStringIO to make the writelines() function actually work.
  7760. - Added strop.expandtabs() so string.expandtabs() is now much faster.
  7761. - Added fsync() and fdatasync(), if they appear to exist.
  7762. - Support for "long files" (64-bit seek pointers).
  7763. - Fixed a bug in the zlib module's flush() function.
  7764. - Added access() system call. It returns 1 if access granted, 0 if
  7765. not.
  7766. - The curses module implements an optional nlines argument to
  7767. w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
  7768. Changes to tools
  7769. ----------------
  7770. - Some changes to IDLE; see Tools/idle/NEWS.txt.
  7771. - Latest version of Misc/python-mode.el included.
  7772. Changes to Tkinter
  7773. ------------------
  7774. - Avoid tracebacks when an image is deleted after its root has been
  7775. destroyed.
  7776. Changes to the Python/C API
  7777. ---------------------------
  7778. - When parentheses are used in a PyArg_Parse[Tuple]() call, any
  7779. sequence is now accepted, instead of requiring a tuple. This is in
  7780. line with the general trend towards accepting arbitrary sequences.
  7781. - Added PyModule_GetFilename().
  7782. - In PyNumber_Power(), remove unneeded and even harmful test for float
  7783. to the negative power (which is already and better done in
  7784. floatobject.c).
  7785. - New version identification symbols; read patchlevel.h for info. The
  7786. version numbers are now exported by Python.h.
  7787. - Rolled back the API version change -- it's back to 1007!
  7788. - The frozenmain.c function calls PyInitFrozenExtensions().
  7789. - Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
  7790. INCREF.
  7791. ======================================================================
  7792. From 1.5.2a2 to 1.5.2b1
  7793. =======================
  7794. Changes to intrinsics
  7795. ---------------------
  7796. - New extension NotImplementedError, derived from RuntimeError. Not
  7797. used, but recommended use is for "abstract" methods to raise this.
  7798. - The parser will now spit out a warning or error when -t or -tt is
  7799. used for parser input coming from a string, too.
  7800. - The code generator now inserts extra SET_LINENO opcodes when
  7801. compiling multi-line argument lists.
  7802. - When comparing bound methods, use identity test on the objects, not
  7803. equality test.
  7804. New or improved ports
  7805. ---------------------
  7806. - Chris Herborth has redone his BeOS port; it now works on PowerPC
  7807. (R3/R4) and x86 (R4 only). Threads work too in this port.
  7808. Renaming
  7809. --------
  7810. - Thanks to Chris Herborth, the thread primitives now have proper Py*
  7811. names in the source code (they already had those for the linker,
  7812. through some smart macros; but the source still had the old, un-Py
  7813. names).
  7814. Configuration/build changes
  7815. ---------------------------
  7816. - Improved support for FreeBSD/3.
  7817. - Check for pthread_detach instead of pthread_create in libc.
  7818. - The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
  7819. - Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
  7820. Otherwise modules such as thread didn't get incorporated in extensions.
  7821. New library modules
  7822. -------------------
  7823. - shlex.py by Eric Raymond provides a lexical analyzer class for
  7824. simple shell-like syntaxes.
  7825. - netrc.py by Eric Raymond provides a parser for .netrc files. (The
  7826. undocumented Netrc class in ftplib.py is now obsolete.)
  7827. - codeop.py is a new module that contains the compile_command()
  7828. function that was previously in code.py. This is so that JPython can
  7829. provide its own version of this function, while still sharing the
  7830. higher-level classes in code.py.
  7831. - turtle.py is a new module for simple turtle graphics. I'm still
  7832. working on it; let me know if you use this to teach Python to children
  7833. or other novices without prior programming experience.
  7834. Obsoleted library modules
  7835. -------------------------
  7836. - poly.py and zmod.py have been moved to Lib/lib-old to emphasize
  7837. their status of obsoleteness. They don't do a particularly good job
  7838. and don't seem particularly relevant to the Python core.
  7839. New tools
  7840. ---------
  7841. - I've added IDLE: my Integrated DeveLopment Environment for Python.
  7842. Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
  7843. work on Macintosh, but I haven't been able to test it there; it does
  7844. depend on new features in 1.5.2 and perhaps even new features in
  7845. 1.5.2b1, especially the new code module). This is very much a work in
  7846. progress. I'd like to hear how people like it compared to PTUI (or
  7847. any other IDE they are familiar with).
  7848. - New tools by Barry Warsaw:
  7849. = audiopy: controls the Solaris Audio device
  7850. = pynche: The PYthonically Natural Color and Hue Editor
  7851. = world: Print mappings between country names and DNS country codes
  7852. New demos
  7853. ---------
  7854. - Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
  7855. song.
  7856. - Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
  7857. Tkinter. (By Fredrik Lundh -- not by me!)
  7858. Changes to the library
  7859. ----------------------
  7860. - compileall.py now avoids recompiling .py files that haven't changed;
  7861. it adds a -f option to force recompilation.
  7862. - New version of xmllib.py by Sjoerd Mullender (0.2 with latest
  7863. patches).
  7864. - nntplib.py: statparse() no longer lowercases the message-id.
  7865. - types.py: use type(__stdin__) for FileType.
  7866. - urllib.py: fix translations for filenames with "funny" characters.
  7867. Patch by Sjoerd Mullender. Note that if you subclass one of the
  7868. URLopener classes, and you have copied code from the old urllib.py,
  7869. your subclass may stop working. A long-term solution is to provide
  7870. more methods so that you don't have to copy code.
  7871. - cgi.py: In read_multi, allow a subclass to override the class we
  7872. instantiate when we create a recursive instance, by setting the class
  7873. variable 'FieldStorageClass' to the desired class. By default, this
  7874. is set to None, in which case we use self.__class__ (as before).
  7875. Also, a patch by Jim Fulton to pass additional arguments to recursive
  7876. calls to the FieldStorage constructor from its read_multi method.
  7877. - UserList.py: In __getslice__, use self.__class__ instead of
  7878. UserList.
  7879. - In SimpleHTTPServer.py, the server specified in test() should be
  7880. BaseHTTPServer.HTTPServer, in case the request handler should want to
  7881. reference the two attributes added by BaseHTTPServer.server_bind. (By
  7882. Jeff Rush, for Bobo). Also open the file in binary mode, so serving
  7883. images from a Windows box might actually work.
  7884. - In CGIHTTPServer.py, the list of acceptable formats is -split-
  7885. on spaces but -joined- on commas, resulting in double commas
  7886. in the joined text. (By Jeff Rush.)
  7887. - SocketServer.py, patch by Jeff Bauer: a minor change to declare two
  7888. new threaded versions of Unix Server classes, using the ThreadingMixIn
  7889. class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
  7890. - bdb.py: fix bomb on deleting a temporary breakpoint: there's no
  7891. method do_delete(); do_clear() was meant. By Greg Ward.
  7892. - getopt.py: accept a non-list sequence for the long options (request
  7893. by Jack Jansen). Because it might be a common mistake to pass a
  7894. single string, this situation is treated separately. Also added
  7895. docstrings (copied from the library manual) and removed the (now
  7896. redundant) module comments.
  7897. - tempfile.py: improvements to avoid security leaks.
  7898. - code.py: moved compile_command() to new module codeop.py.
  7899. - pickle.py: support pickle format 1.3 (binary float added). By Jim
  7900. Fulton. Also get rid of the undocumented obsolete Pickler dump_special
  7901. method.
  7902. - uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
  7903. - imaplib.py: fix problem with some versions of IMAP4 servers that
  7904. choose to mix the case in their CAPABILITIES response.
  7905. - cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
  7906. by Fredrik Lundh.
  7907. Changes to extension modules
  7908. ----------------------------
  7909. - More doc strings for several modules were contributed by Chris
  7910. Petrilli: math, cmath, fcntl.
  7911. - Fixed a bug in zlibmodule.c that could cause core dumps on
  7912. decompression of rarely occurring input.
  7913. - cPickle.c: new version from Jim Fulton, with Open Source copyright
  7914. notice. Also, initialize self->safe_constructors early on to prevent
  7915. crash in early dealloc.
  7916. - cStringIO.c: new version from Jim Fulton, with Open Source copyright
  7917. notice. Also fixed a core dump in cStringIO.c when doing seeks.
  7918. - mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
  7919. - readline.c: Bernard Herzog pointed out that rl_parse_and_bind
  7920. modifies its argument string (bad function!), so we make a temporary
  7921. copy.
  7922. - sunaudiodev.c: Barry Warsaw added more smarts to get the device and
  7923. control pseudo-device, per audio(7I).
  7924. Changes to tools
  7925. ----------------
  7926. - New, improved version of Barry Warsaw's Misc/python-mode.el (editing
  7927. support for Emacs).
  7928. - tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
  7929. only the names of offending files to be printed.
  7930. - freeze: when printing missing modules, also print the module they
  7931. were imported from.
  7932. - untabify.py: patch by Detlef Lannert to implement -t option
  7933. (set tab size).
  7934. Changes to Tkinter
  7935. ------------------
  7936. - grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
  7937. row2?
  7938. - _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
  7939. doesn't work when running in a non-threaded environment. He added
  7940. some #ifdefs that fix this.
  7941. Changes to the Python/C API
  7942. ---------------------------
  7943. - Bumped API version number to 1008 -- enough things have changed!
  7944. - There's a new macro, PyThreadState_GET(), which does the same work
  7945. as PyThreadState_Get() without the overhead of a function call (it
  7946. also avoids the error check). The two top calling locations of
  7947. PyThreadState_Get() have been changed to use this macro.
  7948. - All symbols intended for export from a DLL or shared library are now
  7949. marked as such (with the DL_IMPORT() macro) in the header file that
  7950. declares them. This was needed for the BeOS port, and should also
  7951. make some other ports easier. The PC port no longer needs the file
  7952. with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
  7953. macro which is only used for init methods in extension modules, and
  7954. for Py_Main().
  7955. Invisible changes to internals
  7956. ------------------------------
  7957. - Fixed a bug in new_buffersize() in fileobject.c which could
  7958. return a buffer size that was way too large.
  7959. - Use PySys_WriteStderr instead of fprintf in most places.
  7960. - dictobject.c: remove dead code discovered by Vladimir Marangozov.
  7961. - tupleobject.c: make tuples less hungry -- an extra item was
  7962. allocated but never used. Tip by Vladimir Marangozov.
  7963. - mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
  7964. Jansen)
  7965. - import.c: Jim Fulton fixes a reference count bug in
  7966. PyEval_GetGlobals.
  7967. - glmodule.c: check in the changed version after running the stubber
  7968. again -- this solves the conflict with curses over the 'clear' entry
  7969. point much nicer. (Jack Jansen had checked in the changes to cstubs
  7970. eons ago, but I never regenrated glmodule.c :-( )
  7971. - frameobject.c: fix reference count bug in PyFrame_New. Vladimir
  7972. Marangozov.
  7973. - stropmodule.c: add a missing DECREF in an error exit. Submitted by
  7974. Jonathan Giddy.
  7975. ======================================================================
  7976. From 1.5.2a1 to 1.5.2a2
  7977. =======================
  7978. General
  7979. -------
  7980. - It is now a syntax error to have a function argument without a
  7981. default following one with a default.
  7982. - __file__ is now set to the .py file if it was parsed (it used to
  7983. always be the .pyc/.pyo file).
  7984. - Don't exit with a fatal error during initialization when there's a
  7985. problem with the exceptions.py module.
  7986. - New environment variable PYTHONOPTIMIZE can be used to set -O.
  7987. - New version of python-mode.el for Emacs.
  7988. Miscellaneous fixed bugs
  7989. ------------------------
  7990. - No longer print the (confusing) error message about stack underflow
  7991. while compiling.
  7992. - Some threading and locking bugs fixed.
  7993. - When errno is zero, report "Error", not "Success".
  7994. Documentation
  7995. -------------
  7996. - Documentation will be released separately.
  7997. - Doc strings added to array and md5 modules by Chris Petrilli.
  7998. Ports and build procedure
  7999. -------------------------
  8000. - Stop installing when a move or copy fails.
  8001. - New version of the OS/2 port code by Jeff Rush.
  8002. - The makesetup script handles absolute filenames better.
  8003. - The 'new' module is now enabled by default in the Setup file.
  8004. - I *think* I've solved the problem with the Linux build blowing up
  8005. sometimes due to a conflict between sigcheck/intrcheck and
  8006. signalmodule.
  8007. Built-in functions
  8008. ------------------
  8009. - The second argument to apply() can now be any sequence, not just a
  8010. tuple.
  8011. Built-in types
  8012. --------------
  8013. - Lists have a new method: L1.extend(L2) is equivalent to the common
  8014. idiom L1[len(L1):] = L2.
  8015. - Better error messages when a sequence is indexed with a non-integer.
  8016. - Bettter error message when calling a non-callable object (include
  8017. the type in the message).
  8018. Python services
  8019. ---------------
  8020. - New version of cPickle.c fixes some bugs.
  8021. - pickle.py: improved instantiation error handling.
  8022. - code.py: reworked quite a bit. New base class
  8023. InteractiveInterpreter and derived class InteractiveConsole. Fixed
  8024. several problems in compile_command().
  8025. - py_compile.py: print error message and continue on syntax errors.
  8026. Also fixed an old bug with the fstat code (it was never used).
  8027. - pyclbr.py: support submodules of packages.
  8028. String Services
  8029. ---------------
  8030. - StringIO.py: raise the right exception (ValueError) for attempted
  8031. I/O on closed StringIO objects.
  8032. - re.py: fixed a bug in subn(), which caused .groups() to fail inside
  8033. the replacement function called by sub().
  8034. - The struct module has a new format 'P': void * in native mode.
  8035. Generic OS Services
  8036. -------------------
  8037. - Module time: Y2K robustness. 2-digit year acceptance depends on
  8038. value of time.accept2dyear, initialized from env var PYTHONY2K,
  8039. default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
  8040. (POSIX or X/Open recommendation).
  8041. - os.path: normpath(".//x") should return "x", not "/x".
  8042. - getpass.py: fall back on default_getpass() when sys.stdin.fileno()
  8043. doesn't work.
  8044. - tempfile.py: regenerate the template after a fork() call.
  8045. Optional OS Services
  8046. --------------------
  8047. - In the signal module, disable restarting interrupted system calls
  8048. when we have siginterrupt().
  8049. Debugger
  8050. --------
  8051. - No longer set __args__; this feature is no longer supported and can
  8052. affect the debugged code.
  8053. - cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
  8054. added aliases and some other useful new features, e.g. much better
  8055. breakpoint support: temporary breakpoint, disabled breakpoints,
  8056. breakpoints with ignore counts, and conditions; breakpoints can be set
  8057. on a file before it is loaded.
  8058. Profiler
  8059. --------
  8060. - Changes so that JPython can use it. Also fix the calibration code
  8061. so it actually works again
  8062. .
  8063. Internet Protocols and Support
  8064. ------------------------------
  8065. - imaplib.py: new version from Piers Lauder.
  8066. - smtplib.py: change sendmail() method to accept a single string or a
  8067. list or strings as the destination (commom newbie mistake).
  8068. - poplib.py: LIST with a msg argument fixed.
  8069. - urlparse.py: some optimizations for common case (http).
  8070. - urllib.py: support content-length in info() for ftp protocol;
  8071. support for a progress meter through a third argument to
  8072. urlretrieve(); commented out gopher test (the test site is dead).
  8073. Internet Data handling
  8074. ----------------------
  8075. - sgmllib.py: support tags with - or . in their name.
  8076. - mimetypes.py: guess_type() understands 'data' URLs.
  8077. Restricted Execution
  8078. --------------------
  8079. - The classes rexec.RModuleLoader and rexec.RModuleImporter no
  8080. longer exist.
  8081. Tkinter
  8082. -------
  8083. - When reporting an exception, store its info in sys.last_*. Also,
  8084. write all of it to stderr.
  8085. - Added NS, EW, and NSEW constants, for grid's sticky option.
  8086. - Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
  8087. - Make bind variants without a sequence return a tuple of sequences
  8088. (formerly it returned a string, which wasn't very convenient).
  8089. - Add image commands to the Text widget (these are new in Tk 8.0).
  8090. - Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
  8091. - Improved the thread code (but you still can't call update() from
  8092. another thread on Windows).
  8093. - Fixed unnecessary references to _default_root in the new dialog
  8094. modules.
  8095. - Miscellaneous problems fixed.
  8096. Windows General
  8097. ---------------
  8098. - Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
  8099. search for dependent dlls in the directory containing the .pyd.
  8100. - In debugging mode, call DebugBreak() in Py_FatalError().
  8101. Windows Installer
  8102. -----------------
  8103. - Install zlib.dll in the DLLs directory instead of in the win32
  8104. system directory, to avoid conflicts with other applications that have
  8105. their own zlib.dll.
  8106. Test Suite
  8107. ----------
  8108. - test_long.py: new test for long integers, by Tim Peters.
  8109. - regrtest.py: improved so it can be used for other test suites as
  8110. well.
  8111. - test_strftime.py: use re to compare test results, to support legal
  8112. variants (e.g. on Linux).
  8113. Tools and Demos
  8114. ---------------
  8115. - Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
  8116. remove/add Windows style '\r\n' line endings), untabify.py (to remove
  8117. tabs), and rgrep.yp (reverse grep).
  8118. - Improvements to Tools/freeze/. Each Python module is now written to
  8119. its own C file. This prevents some compilers or assemblers from
  8120. blowing up on large frozen programs, and saves recompilation time if
  8121. only a few modules are changed. Other changes too, e.g. new command
  8122. line options -x and -i.
  8123. - Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
  8124. Python/C API
  8125. ------------
  8126. - New mechanism to support extensions of the type object while
  8127. remaining backward compatible with extensions compiled for previous
  8128. versions of Python 1.5. A flags field indicates presence of certain
  8129. fields.
  8130. - Addition to the buffer API to differentiate access to bytes and
  8131. 8-bit characters (in anticipation of Unicode characters).
  8132. - New argument parsing format t# ("text") to indicate 8-bit
  8133. characters; s# simply means 8-bit bytes, for backwards compatibility.
  8134. - New object type, bufferobject.c is an example and can be used to
  8135. create buffers from memory.
  8136. - Some support for 64-bit longs, including some MS platforms.
  8137. - Many calls to fprintf(stderr, ...) have been replaced with calls to
  8138. PySys_WriteStderr(...).
  8139. - The calling context for PyOS_Readline() has changed: it must now be
  8140. called with the interpreter lock held! It releases the lock around
  8141. the call to the function pointed to by PyOS_ReadlineFunctionPointer
  8142. (default PyOS_StdioReadline()).
  8143. - New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
  8144. - Renamed header file "thread.h" to "pythread.h".
  8145. - The code string of code objects may now be anything that supports the
  8146. buffer API.
  8147. ======================================================================
  8148. From 1.5.1 to 1.5.2a1
  8149. =====================
  8150. General
  8151. -------
  8152. - When searching for the library, a landmark that is a compiled module
  8153. (string.pyc or string.pyo) is also accepted.
  8154. - When following symbolic links to the python executable, use a loop
  8155. so that a symlink to a symlink can work.
  8156. - Added a hack so that when you type 'quit' or 'exit' at the
  8157. interpreter, you get a friendly explanation of how to press Ctrl-D (or
  8158. Ctrl-Z) to exit.
  8159. - New and improved Misc/python-mode.el (Python mode for Emacs).
  8160. - Revert a new feature in Unix dynamic loading: for one or two
  8161. revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
  8162. out to be a bad idea.
  8163. Miscellaneous fixed bugs
  8164. ------------------------
  8165. - All patches on the patch page have been integrated. (But much more
  8166. has been done!)
  8167. - Several memory leaks plugged (e.g. the one for classes with a
  8168. __getattr__ method).
  8169. - Removed the only use of calloc(). This triggered an obscure bug on
  8170. multiprocessor Sparc Solaris 2.6.
  8171. - Fix a peculiar bug that would allow "import sys.time" to succeed
  8172. (believing the built-in time module to be a part of the sys package).
  8173. - Fix a bug in the overflow checking when converting a Python long to
  8174. a C long (failed to convert -2147483648L, and some other cases).
  8175. Documentation
  8176. -------------
  8177. - Doc strings have been added to many extension modules: __builtin__,
  8178. errno, select, signal, socket, sys, thread, time. Also to methods of
  8179. list objects (try [].append.__doc__). A doc string on a type will now
  8180. automatically be propagated to an instance if the instance has methods
  8181. that are accessed in the usual way.
  8182. - The documentation has been expanded and the formatting improved.
  8183. (Remember that the documentation is now unbundled and has its own
  8184. release cycle though; see http://www.python.org/doc/.)
  8185. - Added Misc/Porting -- a mini-FAQ on porting to a new platform.
  8186. Ports and build procedure
  8187. -------------------------
  8188. - The BeOS port is now integrated. Courtesy Chris Herborth.
  8189. - Symbol files for FreeBSD 2.x and 3.x have been contributed
  8190. (Lib/plat-freebsd[23]/*).
  8191. - Support HPUX 10.20 DCE threads.
  8192. - Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
  8193. works, it won't also use -Olimit 1500 (which gives a warning for every
  8194. file). Also support the SGI_ABI environment variable better.
  8195. - The makesetup script now understands absolute pathnames ending in .o
  8196. in the module -- it assumes it's a file for which we have no source.
  8197. - Other miscellaneous improvements to the configure script and
  8198. Makefiles.
  8199. - The test suite now uses a different sound sample.
  8200. Built-in functions
  8201. ------------------
  8202. - Better checks for invalid input to int(), long(), string.atoi(),
  8203. string.atol(). (Formerly, a sign without digits would be accepted as
  8204. a legal ways to spell zero.)
  8205. - Changes to map() and filter() to use the length of a sequence only
  8206. as a hint -- if an IndexError happens earlier, take that. (Formerly,
  8207. this was considered an error.)
  8208. - Experimental feature in getattr(): a third argument can specify a
  8209. default (instead of raising AttributeError).
  8210. - Implement round() slightly different, so that for negative ndigits
  8211. no additional errors happen in the last step.
  8212. - The open() function now adds the filename to the exception when it
  8213. fails.
  8214. Built-in exceptions
  8215. -------------------
  8216. - New standard exceptions EnvironmentError and PosixError.
  8217. EnvironmentError is the base class for IOError and PosixError;
  8218. PosixError is the same as os.error. All this so that either exception
  8219. class can be instantiated with a third argument indicating a filename.
  8220. The built-in function open() and most os/posix functions that take a
  8221. filename argument now use this.
  8222. Built-in types
  8223. --------------
  8224. - List objects now have an experimental pop() method; l.pop() returns
  8225. and removes the last item; l.pop(i) returns and removes the item at
  8226. i. Also, the sort() method is faster again. Sorting is now also
  8227. safer: it is impossible for the sorting function to modify the list
  8228. while the sort is going on (which could cause core dumps).
  8229. - Changes to comparisons: numbers are now smaller than any other type.
  8230. This is done to prevent the circularity where [] < 0L < 1 < [] is
  8231. true. As a side effect, cmp(None, 0) is now positive instead of
  8232. negative. This *shouldn't* affect any working code, but I've found
  8233. that the change caused several "sleeping" bugs to become active, so
  8234. beware!
  8235. - Instance methods may now have other callable objects than just
  8236. Python functions as their im_func. Use new.instancemethod() or write
  8237. your own C code to create them; new.instancemethod() may be called
  8238. with None for the instance to create an unbound method.
  8239. - Assignment to __name__, __dict__ or __bases__ of a class object is
  8240. now allowed (with stringent type checks); also allow assignment to
  8241. __getattr__ etc. The cached values for __getattr__ etc. are
  8242. recomputed after such assignments (but not for derived classes :-( ).
  8243. - Allow assignment to some attributes of function objects: func_code,
  8244. func_defaults and func_doc / __doc__. (With type checks except for
  8245. __doc__ / func_doc .)
  8246. Python services
  8247. ---------------
  8248. - New tests (in Lib/test): reperf.py (regular expression benchmark),
  8249. sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
  8250. for the MimeWriter module).
  8251. - Generalized test/regrtest.py so that it is useful for testing other
  8252. packages.
  8253. - The ihooks.py module now understands package imports.
  8254. - In code.py, add a class that subsumes Fredrik Lundh's
  8255. PythonInterpreter class. The interact() function now uses this.
  8256. - In rlcompleter.py, in completer(), return None instead of raising an
  8257. IndexError when there are no more completions left.
  8258. - Fixed the marshal module to test for certain common kinds of invalid
  8259. input. (It's still not foolproof!)
  8260. - In the operator module, add an alias (now the preferred name)
  8261. "contains" for "sequenceincludes".
  8262. String Services
  8263. ---------------
  8264. - In the string and strop modules, in the replace() function, treat an
  8265. empty pattern as an error (since it's not clear what was meant!).
  8266. - Some speedups to re.py, especially the string substitution and split
  8267. functions. Also added new function/method findall(), to find all
  8268. occurrences of a given substring.
  8269. - In cStringIO, add better argument type checking and support the
  8270. readonly 'closed' attribute (like regular files).
  8271. - In the struct module, unsigned 1-2 byte sized formats no longer
  8272. result in long integer values.
  8273. Miscellaneous services
  8274. ----------------------
  8275. - In whrandom.py, added new method and function randrange(), same as
  8276. choice(range(start, stop, step)) but faster. This addresses the
  8277. problem that randint() was accidentally defined as taking an inclusive
  8278. range. Also, randint(a, b) is now redefined as randrange(a, b+1),
  8279. adding extra range and type checking to its arguments!
  8280. - Add some semi-thread-safety to random.gauss() (it used to be able to
  8281. crash when invoked from separate threads; now the worst it can do is
  8282. give a duplicate result occasionally).
  8283. - Some restructuring and generalization done to cmd.py.
  8284. - Major upgrade to ConfigParser.py; converted to using 're', added new
  8285. exceptions, support underscore in section header and option name. No
  8286. longer add 'name' option to every section; instead, add '__name__'.
  8287. - In getpass.py, don't use raw_input() to ask for the password -- we
  8288. don't want it to show up in the readline history! Also don't catch
  8289. interrupts (the try-finally already does all necessary cleanup).
  8290. Generic OS Services
  8291. -------------------
  8292. - New functions in os.py: makedirs(), removedirs(), renames(). New
  8293. variable: linesep (the line separator as found in binary files,
  8294. i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
  8295. this with files opened in (default) text mode; the line separator used
  8296. will always be '\n'!
  8297. - Changes to the 'os.path' submodule of os.py: added getsize(),
  8298. getmtime(), getatime() -- these fetch the most popular items from the
  8299. stat return tuple.
  8300. - In the time module, add strptime(), if it exists. (This parses a
  8301. time according to a format -- the inverse of strftime().) Also,
  8302. remove the call to mktime() from strftime() -- it messed up the
  8303. formatting of some non-local times.
  8304. - In the socket module, added a new function gethostbyname_ex().
  8305. Also, don't use #ifdef to test for some symbols that are enums on some
  8306. platforms (and should exist everywhere).
  8307. Optional OS Services
  8308. --------------------
  8309. - Some fixes to gzip.py. In particular, the readlines() method now
  8310. returns the lines *with* trailing newline characters, like readlines()
  8311. of regular file objects. Also, it didn't work together with cPickle;
  8312. fixed that.
  8313. - In whichdb.py, support byte-swapped dbhash (bsddb) files.
  8314. - In anydbm.py, look at the type of an existing database to determine
  8315. which module to use to open it. (The anydbm.error exception is now a
  8316. tuple.)
  8317. Unix Services
  8318. -------------
  8319. - In the termios module, in tcsetattr(), initialize the structure vy
  8320. calling tcgetattr().
  8321. - Added some of the "wait status inspection" macros as functions to
  8322. the posix module (and thus to the os module): WEXITSTATUS(),
  8323. WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
  8324. - In the syslog module, make the default facility more intuitive
  8325. (matching the docs).
  8326. Debugger
  8327. --------
  8328. - In pdb.py, support for setting breaks on files/modules that haven't
  8329. been loaded yet.
  8330. Internet Protocols and Support
  8331. ------------------------------
  8332. - Changes in urllib.py; sped up unquote() and quote(). Fixed an
  8333. obscure bug in quote_plus(). Added urlencode(dict) -- convenience
  8334. function for sending a POST request with urlopen(). Use the getpass
  8335. module to ask for a password. Rewrote the (test) main program so that
  8336. when used as a script, it can retrieve one or more URLs to stdout.
  8337. Use -t to run the self-test. Made the proxy code work again.
  8338. - In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
  8339. fail when someone asks for their HEAD. Also, for POST, set the
  8340. default content-type to application/x-www-form-urlencoded. Also, in
  8341. FieldStorage.__init__(), when method='GET', always get the query
  8342. string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
  8343. explicitly passed in fp.
  8344. - The smtplib.py module now supports ESMTP and has improved standard
  8345. compliance, for picky servers.
  8346. - Improved imaplib.py.
  8347. - Fixed UDP support in SocketServer.py (it never worked).
  8348. - Fixed a small bug in CGIHTTPServer.py.
  8349. Internet Data handling
  8350. ----------------------
  8351. - In rfc822.py, add a new class AddressList. Also support a new
  8352. overridable method, isheader(). Also add a get() method similar to
  8353. dictionaries (and make getheader() an alias for it). Also, be smarter
  8354. about seekable (test whether fp.tell() works) and test for presence of
  8355. unread() method before trying seeks.
  8356. - In sgmllib.py, restore the call to report_unbalanced() that was lost
  8357. long ago. Also some other improvements: handle <? processing
  8358. instructions >, allow . and - in entity names, and allow \r\n as line
  8359. separator.
  8360. - Some restructuring and generalization done to multifile.py; support
  8361. a 'seekable' flag.
  8362. Restricted Execution
  8363. --------------------
  8364. - Improvements to rexec.py: package support; support a (minimal)
  8365. sys.exc_info(). Also made the (test) main program a bit fancier (you
  8366. can now use it to run arbitrary Python scripts in restricted mode).
  8367. Tkinter
  8368. -------
  8369. - On Unix, Tkinter can now safely be used from a multi-threaded
  8370. application. (Formerly, no threads would make progress while
  8371. Tkinter's mainloop() was active, because it didn't release the Python
  8372. interpreter lock.) Unfortunately, on Windows, threads other than the
  8373. main thread should not call update() or update_idletasks() because
  8374. this will deadlock the application.
  8375. - An interactive interpreter that uses readline and Tkinter no longer
  8376. uses up all available CPU time.
  8377. - Even if readline is not used, Tk windows created in an interactive
  8378. interpreter now get continuously updated. (This even works in Windows
  8379. as long as you don't hit a key.)
  8380. - New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
  8381. - No longer register Tcl_finalize() as a low-level exit handler. It
  8382. may call back into Python, and that's a bad idea.
  8383. - Allow binding of Tcl commands (given as a string).
  8384. - Some minor speedups; replace explicitly coded getint() with int() in
  8385. most places.
  8386. - In FileDialog.py, remember the directory of the selected file, if
  8387. given.
  8388. - Change the names of all methods in the Wm class: they are now
  8389. wm_title(), etc. The old names (title() etc.) are still defined as
  8390. aliases.
  8391. - Add a new method of interpreter objects, interpaddr(). This returns
  8392. the address of the Tcl interpreter object, as an integer. Not very
  8393. useful for the Python programmer, but this can be called by another C
  8394. extension that needs to make calls into the Tcl/Tk C API and needs to
  8395. get the address of the Tcl interpreter object. A simple cast of the
  8396. return value to (Tcl_Interp *) will do the trick.
  8397. Windows General
  8398. ---------------
  8399. - Don't insist on proper case for module source files if the filename
  8400. is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
  8401. doesn't). This should address problems with this feature on
  8402. oldfashioned filesystems (Novell servers?).
  8403. Windows Library
  8404. ---------------
  8405. - os.environ is now all uppercase, but accesses are case insensitive,
  8406. and the putenv() calls made as a side effect of changing os.environ
  8407. are case preserving.
  8408. - Removed samefile(), sameopenfile(), samestat() from os.path (aka
  8409. ntpath.py) -- these cannot be made to work reliably (at least I
  8410. wouldn't know how).
  8411. - Fixed os.pipe() so that it returns file descriptors acceptable to
  8412. os.read() and os.write() (like it does on Unix), rather than Windows
  8413. file handles.
  8414. - Added a table of WSA error codes to socket.py.
  8415. - In the select module, put the (huge) file descriptor arrays on the
  8416. heap.
  8417. - The getpass module now raises KeyboardInterrupt when it sees ^C.
  8418. - In mailbox.py, fix tell/seek when using files opened in text mode.
  8419. - In rfc822.py, fix tell/seek when using files opened in text mode.
  8420. - In the msvcrt extension module, release the interpreter lock for
  8421. calls that may block: _locking(), _getch(), _getche(). Also fix a
  8422. bogus error return when open_osfhandle() doesn't have the right
  8423. argument list.
  8424. Windows Installer
  8425. -----------------
  8426. - The registry key used is now "1.5" instead of "1.5.x" -- so future
  8427. versions of 1.5 and Mark Hammond's win32all installer don't need to be
  8428. resynchronized.
  8429. Windows Tools
  8430. -------------
  8431. - Several improvements to freeze specifically for Windows.
  8432. Windows Build Procedure
  8433. -----------------------
  8434. - The VC++ project files and the WISE installer have been moved to the
  8435. PCbuild subdirectory, so they are distributed in the same subdirectory
  8436. where they must be used. This avoids confusion.
  8437. - New project files for Windows 3.1 port by Jim Ahlstrom.
  8438. - Got rid of the obsolete subdirectory PC/setup_nt/.
  8439. - The projects now use distinct filenames for the .exe, .dll, .lib and
  8440. .pyd files built in debug mode (by appending "_d" to the base name,
  8441. before the extension). This makes it easier to switch between the two
  8442. and get the right versions. There's a pragma in config.h that directs
  8443. the linker to include the appropriate .lib file (so python15.lib no
  8444. longer needs to be explicit in your project).
  8445. - The installer now installs more files (e.g. config.h). The idea is
  8446. that you shouldn't need the source distribution if you want build your
  8447. own extensions in C or C++.
  8448. Tools and Demos
  8449. ---------------
  8450. - New script nm2def.py by Marc-Andre Lemburg, to construct
  8451. PC/python_nt.def automatically (some hand editing still required).
  8452. - New tool ndiff.py: Tim Peters' text diffing tool.
  8453. - Various and sundry improvements to the freeze script.
  8454. - The script texi2html.py (which was part of the Doc tree but is no
  8455. longer used there) has been moved to the Tools/scripts subdirectory.
  8456. - Some generalizations in the webchecker code. There's now a
  8457. primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
  8458. - The ftpmirror.py script now handles symbolic links properly, and
  8459. also files with multiple spaces in their names.
  8460. - The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
  8461. last line is both indented and lacks a newline. This is now fixed.
  8462. Python/C API
  8463. ------------
  8464. - Added missing prototypes for PyEval_CallFunction() and
  8465. PyEval_CallMethod().
  8466. - New macro PyList_SET_ITEM().
  8467. - New macros to access object members for PyFunction, PyCFunction
  8468. objects.
  8469. - New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
  8470. dynamically add one or many entries to the table of built-in modules.
  8471. - New macro Py_InitModule3(name, methods, doc) which calls
  8472. Py_InitModule4() with appropriate arguments. (The -4 variant requires
  8473. you to pass an obscure version number constant which is always the same.)
  8474. - New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
  8475. sys.stdout or sys.stderr using a printf-like interface. (Used in
  8476. _tkinter.c, for example.)
  8477. - New APIs for conversion between Python longs and C 'long long' if
  8478. your compiler supports it.
  8479. - PySequence_In() is now called PySequence_Contains().
  8480. (PySequence_In() is still supported for b/w compatibility; it is
  8481. declared obsolete because its argument order is confusing.)
  8482. - PyDict_GetItem() and PyDict_GetItemString() are changed so that they
  8483. *never* raise an exception -- (even if the hash() fails, simply clear
  8484. the error). This was necessary because there is lots of code out
  8485. there that already assumes this.
  8486. - Changes to PySequence_Tuple() and PySequence_List() to use the
  8487. length of a sequence only as a hint -- if an IndexError happens
  8488. earlier, take that. (Formerly, this was considered an error.)
  8489. - Reformatted abstract.c to give it a more familiar "look" and fixed
  8490. many error checking bugs.
  8491. - Add NULL pointer checks to all calls of a C function through a type
  8492. object and extensions (e.g. nb_add).
  8493. - The code that initializes sys.path now calls Py_GetPythonHome()
  8494. instead of getenv("PYTHONHOME"). This, together with the new API
  8495. Py_SetPythonHome(), makes it easier for embedding applications to
  8496. change the notion of Python's "home" directory (where the libraries
  8497. etc. are sought).
  8498. - Fixed a very old bug in the parsing of "O?" format specifiers.
  8499. ======================================================================
  8500. ========================================
  8501. ==> Release 1.5.1 (October 31, 1998) <==
  8502. ========================================
  8503. From 1.5 to 1.5.1
  8504. =================
  8505. General
  8506. -------
  8507. - The documentation is now unbundled. It has also been extensively
  8508. modified (mostly to implement a new and more uniform formatting
  8509. style). We figure that most people will prefer to download one of the
  8510. preformatted documentation sets (HTML, PostScript or PDF) and that
  8511. only a minority have a need for the LaTeX or FrameMaker sources. Of
  8512. course, the unbundled documentation sources still released -- just not
  8513. in the same archive file, and perhaps not on the same date.
  8514. - All bugs noted on the errors page (and many unnoted) are fixed. All
  8515. new bugs take their places.
  8516. - No longer a core dump when attempting to print (or repr(), or str())
  8517. a list or dictionary that contains an instance of itself; instead, the
  8518. recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
  8519. Py_ReprLeave() below. Comparisons of such objects still go beserk,
  8520. since this requires a different kind of fix; fortunately, this is a
  8521. less common scenario in practice.
  8522. Syntax change
  8523. -------------
  8524. - The raise statement can now be used without arguments, to re-raise
  8525. a previously set exception. This should be used after catching an
  8526. exception with an except clause only, either in the except clause or
  8527. later in the same function.
  8528. Import and module handling
  8529. --------------------------
  8530. - The implementation of import has changed to use a mutex (when
  8531. threading is supported). This means that when two threads
  8532. simultaneously import the same module, the import statements are
  8533. serialized. Recursive imports are not affected.
  8534. - Rewrote the finalization code almost completely, to be much more
  8535. careful with the order in which modules are destroyed. Destructors
  8536. will now generally be able to reference built-in names such as None
  8537. without trouble.
  8538. - Case-insensitive platforms such as Mac and Windows require the case
  8539. of a module's filename to match the case of the module name as
  8540. specified in the import statement (see below).
  8541. - The code for figuring out the default path now distinguishes between
  8542. files, modules, executable files, and directories. When expecting a
  8543. module, we also look for the .pyc or .pyo file.
  8544. Parser/tokenizer changes
  8545. ------------------------
  8546. - The tokenizer can now warn you when your source code mixes tabs and
  8547. spaces for indentation in a manner that depends on how much a tab is
  8548. worth in spaces. Use "python -t" or "python -v" to enable this
  8549. option. Use "python -tt" to turn the warnings into errors. (See also
  8550. tabnanny.py and tabpolice.py below.)
  8551. - Return unsigned characters from tok_nextc(), so '\377' isn't
  8552. mistaken for an EOF character.
  8553. - Fixed two pernicious bugs in the tokenizer that only affected AIX.
  8554. One was actually a general bug that was triggered by AIX's smaller I/O
  8555. buffer size. The other was a bug in the AIX optimizer's loop
  8556. unrolling code; swapping two statements made the problem go away.
  8557. Tools, demos and miscellaneous files
  8558. ------------------------------------
  8559. - There's a new version of Misc/python-mode.el (the Emacs mode for
  8560. Python) which is much smarter about guessing the indentation style
  8561. used in a particular file. Lots of other cool features too!
  8562. - There are two new tools in Tools/scripts: tabnanny.py and
  8563. tabpolice.py, implementing two different ways of checking whether a
  8564. file uses indentation in a way that is sensitive to the interpretation
  8565. of a tab. The preferred module is tabnanny.py (by Tim Peters).
  8566. - Some new demo programs:
  8567. Demo/tkinter/guido/paint.py -- Dave Mitchell
  8568. Demo/sockets/unixserver.py -- Piet van Oostrum
  8569. - Much better freeze support. The freeze script can now freeze
  8570. hierarchical module names (with a corresponding change to import.c),
  8571. and has a few extra options (e.g. to suppress freezing specific
  8572. modules). It also does much more on Windows NT.
  8573. - Version 1.0 of the faq wizard is included (only very small changes
  8574. since version 0.9.0).
  8575. - New feature for the ftpmirror script: when removing local files
  8576. (i.e., only when -r is used), do a recursive delete.
  8577. Configuring and building Python
  8578. -------------------------------
  8579. - Get rid of the check for -linet -- recent Sequent Dynix systems don't
  8580. need this any more and apparently it screws up their configuration.
  8581. - Some changes because gcc on SGI doesn't support '-all'.
  8582. - Changed the build rules to use $(LIBRARY) instead of
  8583. -L.. -lpython$(VERSION)
  8584. since the latter trips up the SunOS 4.1.x linker (sigh).
  8585. - Fix the bug where the '# dgux is broken' comment in the Makefile
  8586. tripped over Make on some platforms.
  8587. - Changes for AIX: install the python.exp file; properly use
  8588. $(srcdir); the makexp_aix script now removes C++ entries of the form
  8589. Class::method.
  8590. - Deleted some Makefile targets only used by the (long obsolete)
  8591. gMakefile hacks.
  8592. Extension modules
  8593. -----------------
  8594. - Performance and threading improvements to the socket and bsddb
  8595. modules, by Christopher Lindblad of Infoseek.
  8596. - Added operator.__not__ and operator.not_.
  8597. - In the thread module, when a thread exits due to an unhandled
  8598. exception, don't store the exception information in sys.last_*; it
  8599. prevents proper calling of destructors of local variables.
  8600. - Fixed a number of small bugs in the cPickle module.
  8601. - Changed find() and rfind() in the strop module so that
  8602. find("x","",2) returns -1, matching the implementation in string.py.
  8603. - In the time module, be more careful with the result of ctime(), and
  8604. test for HAVE_MKTIME before usinmg mktime().
  8605. - Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
  8606. modules.
  8607. - Added the LOG_SYSLOG constant to the syslog module, if defined.
  8608. Standard library modules
  8609. ------------------------
  8610. - All standard library modules have been converted to an indentation
  8611. style using either only tabs or only spaces -- never a mixture -- if
  8612. they weren't already consistent according to tabnanny. This means
  8613. that the new -t option (see above) won't complain about standard
  8614. library modules.
  8615. - New standard library modules:
  8616. threading -- GvR and the thread-sig
  8617. Java style thread objects -- USE THIS!!!
  8618. getpass -- Piers Lauder
  8619. simple utilities to prompt for a password and to
  8620. retrieve the current username
  8621. imaplib -- Piers Lauder
  8622. interface for the IMAP4 protocol
  8623. poplib -- David Ascher, Piers Lauder
  8624. interface for the POP3 protocol
  8625. smtplib -- Dragon De Monsyne
  8626. interface for the SMTP protocol
  8627. - Some obsolete modules moved to a separate directory (Lib/lib-old)
  8628. which is *not* in the default module search path:
  8629. Para
  8630. addpack
  8631. codehack
  8632. fmt
  8633. lockfile
  8634. newdir
  8635. ni
  8636. rand
  8637. tb
  8638. - New version of the PCRE code (Perl Compatible Regular Expressions --
  8639. the re module and the supporting pcre extension) by Andrew Kuchling.
  8640. Incompatible new feature in re.sub(): the handling of escapes in the
  8641. replacement string has changed.
  8642. - Interface change in the copy module: a __deepcopy__ method is now
  8643. called with the memo dictionary as an argument.
  8644. - Feature change in the tokenize module: differentiate between NEWLINE
  8645. token (an official newline) and NL token (a newline that the grammar
  8646. ignores).
  8647. - Several bugfixes to the urllib module. It is now truly thread-safe,
  8648. and several bugs and a portability problem have been fixed. New
  8649. features, all due to Sjoerd Mullender: When creating a temporary file,
  8650. it gives it an appropriate suffix. Support the "data:" URL scheme.
  8651. The open() method uses the tempcache.
  8652. - New version of the xmllib module (this time with a test suite!) by
  8653. Sjoerd Mullender.
  8654. - Added debugging code to the telnetlib module, to be able to trace
  8655. the actual traffic.
  8656. - In the rfc822 module, added support for deleting a header (still no
  8657. support for adding headers, though). Also fixed a bug where an
  8658. illegal address would cause a crash in getrouteaddr(), fixed a
  8659. sign reversal in mktime_tz(), and use the local timezone by default
  8660. (the latter two due to Bill van Melle).
  8661. - The normpath() function in the dospath and ntpath modules no longer
  8662. does case normalization -- for that, use the separate function
  8663. normcase() (which always existed); normcase() has been sped up and
  8664. fixed (it was the cause of a crash in Mark Hammond's installer in
  8665. certain locales).
  8666. - New command supported by the ftplib module: rmd(); also fixed some
  8667. minor bugs.
  8668. - The profile module now uses a different timer function by default --
  8669. time.clock() is generally better than os.times(). This makes it work
  8670. better on Windows NT, too.
  8671. - The tempfile module now recovers when os.getcwd() raises an
  8672. exception.
  8673. - Fixed some bugs in the random module; gauss() was subtly wrong, and
  8674. vonmisesvariate() should return a full circle. Courtesy Mike Miller,
  8675. Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
  8676. - Better default seed in the whrandom module, courtesy Andrew Kuchling.
  8677. - Fix slow close() in shelve module.
  8678. - The Unix mailbox class in the mailbox module is now more robust when
  8679. a line begins with the string "From " but is definitely not the start
  8680. of a new message. The pattern used can be changed by overriding a
  8681. method or class variable.
  8682. - Added a rmtree() function to the copy module.
  8683. - Fixed several typos in the pickle module. Also fixed problems when
  8684. unpickling in restricted execution environments.
  8685. - Added docstrings and fixed a typo in the py_compile and compileall
  8686. modules. At Mark Hammond's repeated request, py_compile now append a
  8687. newline to the source if it needs one. Both modules support an extra
  8688. parameter to specify the purported source filename (to be used in
  8689. error messages).
  8690. - Some performance tweaks by Jeremy Hylton to the gzip module.
  8691. - Fixed a bug in the merge order of dictionaries in the ConfigParser
  8692. module. Courtesy Barry Warsaw.
  8693. - In the multifile module, support the optional second parameter to
  8694. seek() when possible.
  8695. - Several fixes to the gopherlib module by Lars Marius Garshol. Also,
  8696. urlparse now correctly handles Gopher URLs with query strings.
  8697. - Fixed a tiny bug in format_exception() in the traceback module.
  8698. Also rewrite tb_lineno() to be compatible with JPython (and not
  8699. disturb the current exception!); by Jim Hugunin.
  8700. - The httplib module is more robust when servers send a short response
  8701. -- courtesy Tim O'Malley.
  8702. Tkinter and friends
  8703. -------------------
  8704. - Various typos and bugs fixed.
  8705. - New module Tkdnd implements a drag-and-drop protocol (within one
  8706. application only).
  8707. - The event_*() widget methods have been restructured slightly -- they
  8708. no longer use the default root.
  8709. - The interfaces for the bind*() and unbind() widget methods have been
  8710. redesigned; the bind*() methods now return the name of the Tcl command
  8711. created for the callback, and this can be passed as a optional
  8712. argument to unbind() in order to delete the command (normally, such
  8713. commands are automatically unbound when the widget is destroyed, but
  8714. for some applications this isn't enough).
  8715. - Variable objects now have trace methods to interface to Tcl's
  8716. variable tracing facilities.
  8717. - Image objects now have an optional keyword argument, 'master', to
  8718. specify a widget (tree) to which they belong. The image_names() and
  8719. image_types() calls are now also widget methods.
  8720. - There's a new global call, Tkinter.NoDefaultRoot(), which disables
  8721. all use of the default root by the Tkinter library. This is useful to
  8722. debug applications that are in the process of being converted from
  8723. relying on the default root to explicit specification of the root
  8724. widget.
  8725. - The 'exit' command is deleted from the Tcl interpreter, since it
  8726. provided a loophole by which one could (accidentally) exit the Python
  8727. interpreter without invoking any cleanup code.
  8728. - Tcl_Finalize() is now registered as a Python low-level exit handle,
  8729. so Tcl will be finalized when Python exits.
  8730. The Python/C API
  8731. ----------------
  8732. - New function PyThreadState_GetDict() returns a per-thread dictionary
  8733. intended for storing thread-local global variables.
  8734. - New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
  8735. dictionary to allow recursive container types to detect recursion in
  8736. their repr(), str() and print implementations.
  8737. - New function PyObject_Not(x) calculates (not x) according to Python's
  8738. standard rules (basically, it negates the outcome PyObject_IsTrue(x).
  8739. - New function _PyModule_Clear(), which clears a module's dictionary
  8740. carefully without removing the __builtins__ entry. This is implied
  8741. when a module object is deallocated (this used to clear the dictionary
  8742. completely).
  8743. - New function PyImport_ExecCodeModuleEx(), which extends
  8744. PyImport_ExecCodeModule() by adding an extra parameter to pass it the
  8745. true file.
  8746. - New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
  8747. allow embedded applications to force a different value for PYTHONHOME.
  8748. - New global flag Py_FrozenFlag is set when this is a "frozen" Python
  8749. binary; it suppresses warnings about not being able to find the
  8750. standard library directories.
  8751. - New global flag Py_TabcheckFlag is incremented by the -t option and
  8752. causes the tokenizer to issue warnings or errors about inconsistent
  8753. mixing of tabs and spaces for indentation.
  8754. Miscellaneous minor changes and bug fixes
  8755. -----------------------------------------
  8756. - Improved the error message when an attribute of an attribute-less
  8757. object is requested -- include the name of the attribute and the type
  8758. of the object in the message.
  8759. - Sped up int(), long(), float() a bit.
  8760. - Fixed a bug in list.sort() that would occasionally dump core.
  8761. - Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
  8762. when taken tothe real power.
  8763. - Fixed a number of bugs in the file reading code, at least one of
  8764. which could cause a core dump on NT, and one of which would
  8765. occasionally cause file.read() to return less than the full contents
  8766. of the file.
  8767. - Performance hack by Vladimir Marangozov for stack frame creation.
  8768. - Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
  8769. Windows 95/NT
  8770. -------------
  8771. - The .lib files are now part of the distribution; they are collected
  8772. in the subdirectory "libs" of the installation directory.
  8773. - The extension modules (.pyd files) are now collected in a separate
  8774. subdirectory of the installation directory named "DLLs".
  8775. - The case of a module's filename must now match the case of the
  8776. module name as specified in the import statement. This is an
  8777. experimental feature -- if it turns out to break in too many
  8778. situations, it will be removed (or disabled by default) in the future.
  8779. It can be disabled on a per-case basis by setting the environment
  8780. variable PYTHONCASEOK (to any value).
  8781. ======================================================================
  8782. =====================================
  8783. ==> Release 1.5 (January 3, 1998) <==
  8784. =====================================
  8785. From 1.5b2 to 1.5
  8786. =================
  8787. - Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
  8788. - Added doc strings to string.py, stropmodule.c, structmodule.c,
  8789. thanks to Charles Waldman.
  8790. - Many nits fixed in the manuals, thanks to Fred Drake and many others
  8791. (especially Rob Hooft and Andrew Kuchling). The HTML version now uses
  8792. HTML markup instead of inline GIF images for tables; only two images
  8793. are left (for obsure bits of math). The index of the HTML version has
  8794. also been much improved. Finally, it is once again possible to
  8795. generate an Emacs info file from the library manual (but I don't
  8796. commit to supporting this in future versions).
  8797. - New module: telnetlib.py (a simple telnet client library).
  8798. - New tool: Tools/versioncheck/, by Jack Jansen.
  8799. - Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
  8800. DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
  8801. extension modules.
  8802. - Many small changes again to Tkinter.py -- mostly bugfixes and adding
  8803. missing routines. Thanks to Greg McFarlane for reporting a bunch of
  8804. problems and proofreading my fixes.
  8805. - The re module and its documentation are up to date with the latest
  8806. version released to the string-sig (Dec. 22).
  8807. - Stop test_grp.py from failing when the /etc/group file is empty
  8808. (yes, this happens!).
  8809. - Fix bug in integer conversion (mystrtoul.c) that caused
  8810. 4294967296==0 to be true!
  8811. - The VC++ 4.2 project file should be complete again.
  8812. - In tempfile.py, use a better template on NT, and add a new optional
  8813. argument "suffix" with default "" to specify a specific extension for
  8814. the temporary filename (needed sometimes on NT but perhaps also handy
  8815. elsewhere).
  8816. - Fixed some bugs in the FAQ wizard, and converted it to use re
  8817. instead of regex.
  8818. - Fixed a mysteriously undetected error in dlmodule.c (it was using a
  8819. totally bogus routine name to raise an exception).
  8820. - Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
  8821. - Hopefully harmless changes to the build process to support shared
  8822. libraries on DG/UX. This adds a target to create
  8823. libpython$(VERSION).so; however this target is *only* for DG/UX.
  8824. - Fixed a bug in the new format string error checking in getargs.c.
  8825. - A simple fix for infinite recursion when printing __builtins__:
  8826. reset '_' to None before printing and set it to the printed variable
  8827. *after* printing (and only when printing is successful).
  8828. - Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
  8829. parent window is not (Skip Montanaro).
  8830. - Fixed the two most annoying problems with ftp URLs in
  8831. urllib.urlopen(); an empty file now correctly raises an error, and it
  8832. is no longer required to explicitly close the returned "file" object
  8833. before opening another ftp URL to the same host and directory.
  8834. ======================================================================
  8835. From 1.5b1 to 1.5b2
  8836. ===================
  8837. - Fixed a bug in cPickle.c that caused it to crash right away because
  8838. the version string had a different format.
  8839. - Changes in pickle.py and cPickle.c: when unpickling an instance of a
  8840. class that doesn't define the __getinitargs__() method, the __init__()
  8841. constructor is no longer called. This makes a much larger group of
  8842. classes picklable by default, but may occasionally change semantics.
  8843. To force calling __init__() on unpickling, define a __getinitargs__()
  8844. method. Other changes too, in particular cPickle now handles classes
  8845. defined in packages correctly. The same change applies to copying
  8846. instances with copy.py. The cPickle.c changes and some pickle.py
  8847. changes are courtesy Jim Fulton.
  8848. - Locale support in he "re" (Perl regular expressions) module. Use
  8849. the flag re.L (or re.LOCALE) to enable locale-specific matching
  8850. rules for \w and \b. The in-line syntax for this flag is (?L).
  8851. - The built-in function isinstance(x, y) now also succeeds when y is
  8852. a type object and type(x) is y.
  8853. - repr() and str() of class and instance objects now reflect the
  8854. package/module in which the class is defined.
  8855. - Module "ni" has been removed. (If you really need it, it's been
  8856. renamed to "ni1". Let me know if this causes any problems for you.
  8857. Package authors are encouraged to write __init__.py files that
  8858. support both ni and 1.5 package support, so the same version can be
  8859. used with Python 1.4 as well as 1.5.)
  8860. - The thread module is now automatically included when threads are
  8861. configured. (You must remove it from your existing Setup file,
  8862. since it is now in its own Setup.thread file.)
  8863. - New command line option "-x" to skip the first line of the script;
  8864. handy to make executable scripts on non-Unix platforms.
  8865. - In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
  8866. haven't checked how this affects things, but it should make symbols
  8867. in one shared library available to the next one.
  8868. - The Windows installer now installs in the "Program Files" folder on
  8869. the proper volume by default.
  8870. - The Windows configuration adds a new main program, "pythonw", and
  8871. registers a new extension, ".pyw" that invokes this. This is a
  8872. pstandard Python interpreter that does not pop up a console window;
  8873. handy for pure Tkinter applications. All output to the original
  8874. stdout and stderr is lost; reading from the original stdin yields
  8875. EOF. Also, both python.exe and pythonw.exe now have a pretty icon
  8876. (a green snake in a box, courtesy Mark Hammond).
  8877. - Lots of improvements to emacs-mode.el again. See Barry's web page:
  8878. http://www.python.org/ftp/emacs/pmdetails.html.
  8879. - Lots of improvements and additions to the library reference manual;
  8880. many by Fred Drake.
  8881. - Doc strings for the following modules: rfc822.py, posixpath.py,
  8882. ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
  8883. - Some more regression testing.
  8884. - An optional 4th (maxsplit) argument to strop.replace().
  8885. - Fixed handling of maxsplit in string.splitfields().
  8886. - Tweaked os.environ so it can be pickled and copied.
  8887. - The portability problems caused by indented preprocessor commands
  8888. and C++ style comments should be gone now.
  8889. - In random.py, added Pareto and Weibull distributions.
  8890. - The crypt module is now disabled in Modules/Setup.in by default; it
  8891. is rarely needed and causes errors on some systems where users often
  8892. don't know how to deal with those.
  8893. - Some improvements to the _tkinter build line suggested by Case Roole.
  8894. - A full suite of platform specific files for NetBSD 1.x, submitted by
  8895. Anders Andersen.
  8896. - New Solaris specific header STROPTS.py.
  8897. - Moved a confusing occurrence of *shared* from the comments in
  8898. Modules/Setup.in (people would enable this one instead of the real
  8899. one, and get disappointing results).
  8900. - Changed the default mode for directories to be group-writable when
  8901. the installation process creates them.
  8902. - Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
  8903. shared libraries for both.
  8904. - Support FreeBSD and NetBSD in posixfile.py.
  8905. - Support for the "event" command, new in Tk 4.2. By Case Roole.
  8906. - Add Tix_SafeInit() support to tkappinit.c.
  8907. - Various bugs fixed in "re.py" and "pcre.c".
  8908. - Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
  8909. - In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
  8910. is set.
  8911. - Provide default blocksize for retrbinary in ftplib.py (Skip
  8912. Montanaro).
  8913. - In NT, pick the username up from different places in user.py (Jeff
  8914. Bauer).
  8915. - Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
  8916. - Many small improvements to Jeff Rush' OS/2 support.
  8917. - ospath.py is gone; it's been obsolete for so many years now...
  8918. - The reference manual is now set up to prepare better HTML (still
  8919. using webmaker, alas).
  8920. - Add special handling to /Tools/freeze for Python modules that are
  8921. imported implicitly by the Python runtime: 'site' and 'exceptions'.
  8922. - Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
  8923. inside <PRE>, by "Scott".
  8924. - Added ConfigParser.py, a generic parser for sectioned configuration
  8925. files.
  8926. - In _localemodule.c, LC_MESSAGES is not always defined; put it
  8927. between #ifdefs.
  8928. - Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
  8929. - Demo/scripts/newslist.py: Fix the way the version number is gotten
  8930. out of the RCS revision.
  8931. - PyArg_Parse[Tuple] now explicitly check for bad characters at the
  8932. end of the format string.
  8933. - Revamped PC/example_nt to support VC++ 5.x.
  8934. - <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
  8935. after studying the GNU libg++ quicksort. This should be much faster
  8936. if there are lots of duplicates, and otherwise at least as good.
  8937. - Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
  8938. uudecode bug where it complaints about trailing garbage is still there
  8939. :-( ).
  8940. - pickle.py requires integers in text mode to be in decimal notation
  8941. (it used to accept octal and hex, even though it would only generate
  8942. decimal numbers).
  8943. - In string.atof(), don't fail when the "re" module is unavailable.
  8944. Plug the ensueing security leak by supplying an empty __builtins__
  8945. directory to eval().
  8946. - A bunch of small fixes and improvements to Tkinter.py.
  8947. - Fixed a buffer overrun in PC/getpathp.c.
  8948. ======================================================================
  8949. From 1.5a4 to 1.5b1
  8950. ===================
  8951. - The Windows NT/95 installer now includes full HTML of all manuals.
  8952. It also has a checkbox that lets you decide whether to install the
  8953. interpreter and library. The WISE installer script for the installer
  8954. is included in the source tree as PC/python15.wse, and so are the
  8955. icons used for Python files. The config.c file for the Windows build
  8956. is now complete with the pcre module.
  8957. - sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
  8958. evaluated for the prompt.
  8959. - The reference manual is brought up to date (more or less -- it still
  8960. needs work, e.g. in the area of package import).
  8961. - The icons used by latex2html are now included in the Doc
  8962. subdirectory (mostly so that tarring up the HTML files can be fully
  8963. automated). A simple index.html is also added to Doc (it only works
  8964. after you have successfully run latex2html).
  8965. - For all you would-be proselytizers out there: a new version of
  8966. Misc/BLURB describes Python more concisely, and Misc/comparisons
  8967. compares Python to several other languages. Misc/BLURB.WINDOWS
  8968. contains a blurb specifically aimed at Windows programmers (by Mark
  8969. Hammond).
  8970. - A new version of the Python mode for Emacs is included as
  8971. Misc/python-mode.el. There are too many new features to list here.
  8972. See http://www.python.org/ftp/emacs/pmdetails.html for more info.
  8973. - New module fileinput makes iterating over the lines of a list of
  8974. files easier. (This still needs some more thinking to make it more
  8975. extensible.)
  8976. - There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
  8977. version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
  8978. Age C++ compiler. I expect that Jeff will also provide a binary
  8979. release for this platform.
  8980. - On Linux, the configure script now uses '-Xlinker -export-dynamic'
  8981. instead of '-rdynamic' to link the main program so that it exports its
  8982. symbols to shared libraries it loads dynamically. I hope this doesn't
  8983. break on older Linux versions; it is needed for mklinux and appears to
  8984. work on Linux 2.0.30.
  8985. - Some Tkinter resstructuring: the geometry methods that apply to a
  8986. master are now properly usable on toplevel master widgets. There's a
  8987. new (internal) widget class, BaseWidget. New, longer "official" names
  8988. for the geometry manager methods have been added,
  8989. e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
  8990. shorter names still work, and where there's ambiguity, pack wins over
  8991. place wins over grid. Also, the bind_class method now returns its
  8992. value.
  8993. - New, RFC-822 conformant parsing of email addresses and address lists
  8994. in the rfc822 module, courtesy Ben Escoto.
  8995. - New, revamped tkappinit.c with support for popular packages (PIL,
  8996. TIX, BLT, TOGL). For the last three, you need to execute the Tcl
  8997. command "load {} Tix" (or Blt, or Togl) to gain access to them.
  8998. The Modules/Setup line for the _tkinter module has been rewritten
  8999. using the cool line-breaking feature of most Bourne shells.
  9000. - New socket method connect_ex() returns the error code from connect()
  9001. instead of raising an exception on errors; this makes the logic
  9002. required for asynchronous connects simpler and more efficient.
  9003. - New "locale" module with (still experimental) interface to the
  9004. standard C library locale interface, courtesy Martin von Loewis. This
  9005. does not repeat my mistake in 1.5a4 of always calling
  9006. setlocale(LC_ALL, ""). In fact, we've pretty much decided that
  9007. Python's standard numerical formatting operations should always use
  9008. the conventions for the C locale; the locale module contains utility
  9009. functions to format numbers according to the user specified locale.
  9010. (All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
  9011. "C") after locale-changing calls.) See the library manual. (Alas, the
  9012. promised changes to the "re" module for locale support have not been
  9013. materialized yet. If you care, volunteer!)
  9014. - Memory leak plugged in Py_BuildValue when building a dictionary.
  9015. - Shared modules can now live inside packages (hierarchical module
  9016. namespaces). No changes to the shared module itself are needed.
  9017. - Improved policy for __builtins__: this is a module in __main__ and a
  9018. dictionary everywhere else.
  9019. - Python no longer catches SIGHUP and SIGTERM by default. This was
  9020. impossible to get right in the light of thread contexts. If you want
  9021. your program to clean up when a signal happens, use the signal module
  9022. to set up your own signal handler.
  9023. - New Python/C API PyNumber_CoerceEx() does not return an exception
  9024. when no coercion is possible. This is used to fix a problem where
  9025. comparing incompatible numbers for equality would raise an exception
  9026. rather than return false as in Python 1.4 -- it once again will return
  9027. false.
  9028. - The errno module is changed again -- the table of error messages
  9029. (errorstr) is removed. Instead, you can use os.strerror(). This
  9030. removes redundance and a potential locale dependency.
  9031. - New module xmllib, to parse XML files. By Sjoerd Mullender.
  9032. - New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
  9033. It resets the signal module's notion of what the current process ID
  9034. and thread are, so that signal handlers will work after (and across)
  9035. calls to os.fork().
  9036. - Fixed most occurrences of fatal errors due to missing thread state.
  9037. - For vgrind (a flexible source pretty printer) fans, there's a simple
  9038. Python definition in Misc/vgrindefs, courtesy Neale Pickett.
  9039. - Fixed memory leak in exec statement.
  9040. - The test.pystone module has a new function, pystones(loops=LOOPS),
  9041. which returns a (benchtime, stones) tuple. The main() function now
  9042. calls this and prints the report.
  9043. - Package directories now *require* the presence of an __init__.py (or
  9044. __init__.pyc) file before they are considered as packages. This is
  9045. done to prevent accidental subdirectories with common names from
  9046. overriding modules with the same name.
  9047. - Fixed some strange exceptions in __del__ methods in library modules
  9048. (e.g. urllib). This happens because the builtin names are already
  9049. deleted by the time __del__ is called. The solution (a hack, but it
  9050. works) is to set some instance variables to 0 instead of None.
  9051. - The table of built-in module initializers is replaced by a pointer
  9052. variable. This makes it possible to switch to a different table at
  9053. run time, e.g. when a collection of modules is loaded from a shared
  9054. library. (No example code of how to do this is given, but it is
  9055. possible.) The table is still there of course, its name prefixed with
  9056. an underscore and used to initialize the pointer.
  9057. - The warning about a thread still having a frame now only happens in
  9058. verbose mode.
  9059. - Change the signal finialization so that it also resets the signal
  9060. handlers. After this has been called, our signal handlers are no
  9061. longer active!
  9062. - New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
  9063. literals. There's now also a test fort this module.
  9064. - The copy module now also uses __dict__.update(state) instead of
  9065. going through individual attribute assignments, for class instances
  9066. without a __setstate__ method.
  9067. - New module reconvert translates old-style (regex module) regular
  9068. expressions to new-style (re module, Perl-style) regular expressions.
  9069. - Most modules that used to use the regex module now use the re
  9070. module. The grep module has a new pgrep() function which uses
  9071. Perl-style regular expressions.
  9072. - The (very old, backwards compatibility) regexp.py module has been
  9073. deleted.
  9074. - Restricted execution (rexec): added the pcre module (support for the
  9075. re module) to the list of trusted extension modules.
  9076. - New version of Jim Fulton's CObject object type, adds
  9077. PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
  9078. - Some patches to Lee Busby's fpectl mods that accidentally didn't
  9079. make it into 1.5a4.
  9080. - In the string module, add an optional 4th argument to count(),
  9081. matching find() etc.
  9082. - Patch for the nntplib module by Charles Waldman to add optional user
  9083. and password arguments to NNTP.__init__(), for nntp servers that need
  9084. them.
  9085. - The str() function for class objects now returns
  9086. "modulename.classname" instead of returning the same as repr().
  9087. - The parsing of \xXX escapes no longer relies on sscanf().
  9088. - The "sharedmodules" subdirectory of the installation is renamed to
  9089. "lib-dynload". (You may have to edit your Modules/Setup file to fix
  9090. this in an existing installation!)
  9091. - Fixed Don Beaudry's mess-up with the OPT test in the configure
  9092. script. Certain SGI platforms will still issue a warning for each
  9093. compile; there's not much I can do about this since the compiler's
  9094. exit status doesn't ind