NEWS 12.7 KB
Newer Older
1 2 3 4
+++++++++++
Python News
+++++++++++

Anthony Baxter's avatar
Anthony Baxter committed
5 6
(editors: check NEWS.help for information about editing NEWS using ReST.)

Barry Warsaw's avatar
Barry Warsaw committed
7 8
What's New in Python 3.1 alpha 0
================================
Barry Warsaw's avatar
Barry Warsaw committed
9

10
*Release date: XX-XXX-200X*
Barry Warsaw's avatar
Barry Warsaw committed
11 12 13 14

Core and Builtins
-----------------

15 16 17 18
- Issue #4935: The overflow checking code in the expandtabs() method common
  to str, bytes and bytearray could be optimized away by the compiler, letting
  the interpreter segfault instead of raising an error.

19 20 21
- Issue #3720: Fix a crash when an iterator modifies its class and removes its
  __next__ method.

22 23 24 25
- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
  function no longer attempt to call the __long__ slot to convert an object
  to an integer.  Only the __int__ and __trunc__ slots are examined.

26 27
- Issue #4893: Use NT threading on CE.

28 29
- Issue #4915: Port sysmodule to Windows CE.

30 31 32 33
- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
  common cases are optimized thanks to a dedicated fast path and a moderate
  amount of loop unrolling.

34 35 36 37 38 39
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
  collecting the oldest generation) so that allocating lots of objects without
  destroying them does not show quadratic performance. Based on a proposal by
  Martin von Löwis at
  http://mail.python.org/pipermail/python-dev/2008-June/080579.html.

40 41 42 43
- Issue #4604: Some objects of the I/O library could still be used after 
  having been closed (for instance, a read() call could return some
  previously buffered data). Patch by Dmitry Vasiliev.

44 45 46 47 48
- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
  flag to work properly. Furthermore, when specifying -u, the text stdout
  and stderr streams have line-by-line buffering enabled (the default being
  to buffer arbitrary chunks of data).

49 50 51 52
- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
  instead of ints (reducing its size from 4 to 8 times thereby reducing
  Python's overall memory).

53 54 55 56 57 58
- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
  an existing .py counterpart, override the co_filename attributes of all
  code objects if the original filename is obsolete (which can happen if the
  file has been renamed, moved, or if it is accessed through different paths).
  Patch by Ziga Seilnacht and Jean-Paul Calderone.

59 60 61 62
- Issue #4580: Fix slicing of memoryviews when the item size is greater than
  one byte. Also fixes the meaning of len() so that it returns the number of
  items, rather than the size in bytes.

63 64
- Issue #4075: Use OutputDebugStringW in Py_FatalError.

65 66 67
- Issue #4747: When the terminal does not use utf-8, executing a script with
  non-ascii characters in its name could fail with a "SyntaxError: None" error.

68
- Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
69
  file with `bytes' filename on Windows.
70

71 72 73
- Issue #3680: Reference cycles created through a dict, set or deque iterator
  did not get collected.

74 75 76
- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
  where the tp_hash and tp_dict slots are both NULL.

77 78 79
- Issue #4759: None is now allowed as the first argument of
  bytearray.translate().  It was always allowed for bytes.translate().

80 81 82
- Added test case to ensure attempts to read from a file opened for writing
  fail.

83 84
- Issue #3106: Speedup some comparisons (str/str and int/int).

85 86 87
- Issue #2183: Simplify and optimize bytecode for list, dict and set
  comprehensions. Original patch for list comprehensions by Neal Norwitz.

88 89 90 91
- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
  print elapsed times, not only when some objects are uncollectable /
  unreachable. Original patch by Neil Schemenauer.

92 93
- Issue #3439: Add a bit_length method to int.

94 95 96 97
- Issue #2173: When getting device encoding, check that return value of
  nl_langinfo is not the empty string.  This was causing silent build
  failures on OS X.

98 99 100 101
- Issue #4597: Fixed several opcodes that weren't always propagating
  exceptions.

- Issue #4589: Fixed exception handling when the __exit__ function of a
102 103
  context manager returns a value that cannot be converted to a bool.

104 105 106 107 108
- Issue #4445: Replace "sizeof(PyBytesObject)" with
  "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
  bytes instances.  On a typical machine this saves 3 bytes of memory
  (on average) per allocation of a bytes instance.

109 110 111 112
- Issue #4533: File read operation was dreadfully slow due to a slowly
  growing read buffer. Fixed by using the same growth rate algorithm as
  Python 2.x.

113 114 115
- Issue #4509: Various issues surrounding resize of bytearray objects to
  which there are buffer exports (e.g. memoryview instances).

116 117 118 119
- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
  method on file objects with closefd=False. The file descriptor is still
  kept open but the file object behaves like a closed file. The ``FileIO``
  object also got a new readonly attribute ``closefd``.
120

121 122 123
- Issue #4569: Interpreter crash when mutating a memoryview with an item size
  larger than 1.

124 125
- Issue #4748: Lambda generators no longer return a value.

Barry Warsaw's avatar
Barry Warsaw committed
126 127 128
Library
-------

129 130 131 132
- Issue #3826 and #4791: The socket module now closes the underlying socket
  appropriately when it is being used via socket.makefile() objects
  rather than delaying the close by waiting for garbage collection to do it.

133 134
- Issue #3860: GzipFile and BZ2File now support the context manager protocol.

135 136 137
- Issue #4867: Fixed a crash in ctypes when passing a string to a
  function without defining argtypes.

138 139 140 141 142
- Issue #4272: Add an optional argument to the GzipFile constructor to override
  the timestamp in the gzip stream. The default value remains the current time.
  The information can be used by e.g. gunzip when decompressing. Patch by
  Jacques Frechet.

143 144
- Restore Python 2.3 compatibility for decimal.py.

145 146 147
- Issue #3638: Remove functions from _tkinter module level that depend on
  TkappObject to work with multiple threads.

148 149 150 151
- Issue #4718: Adapt the wsgiref package so that it actually works with 
  Python 3.x, in accordance with the `official amendments of the spec 
  <http://www.wsgi.org/wsgi/Amendments_1.0>`_.

152 153 154
- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
  to the decimal module.

155 156 157
- Fractions.from_float() no longer loses precision for integers too big to
  cast as floats.

158 159 160
- Issue #4812: add missing underscore prefix to some internal-use-only
  constants in the decimal module.  (Dec_0 becomes _Dec_0, etc.)

161 162 163
- Issue 4790: The nsmallest() and nlargest() functions in the heapq module
  did unnecessary work in the common case where no key function was specified.

164 165 166
- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
  the function is not a generator.

167 168 169
- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case 
  no MSVC compiler is found under Windows. Original patch by Philip Jenvey. 

170 171 172
- Issue #4646: distutils was choking on empty options arg in the setup 
  function. Original patch by Thomas Heller.

173 174
- Issue #3767: Convert Tk object to string in tkColorChooser.

175 176
- Issue #3248: Allow placing ScrolledText in a PanedWindow.

177 178 179
- Issue #4444: Allow assertRaises() to be used as a context handler, so that
  the code under test can be written inline if more practical.

180 181 182
- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
  works as expected in the interactive environment.

183 184 185
- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
  Gabriel Genellina.

186 187 188
- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
  boundary.

189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
- Issue #4223: inspect.getsource() will now correctly display source code
  for packages loaded via zipimport (or any other conformant PEP 302
  loader). Original patch by Alexander Belopolsky.

- Issue #4201: pdb can now access and display source code loaded via
  zipimport (or any other conformant PEP 302 loader). Original patch by
  Alexander Belopolsky.

- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
  302 conformant loader) will now work correctly in most cases (they
  are still subject to the constraints that exist for all code running
  from inside a module loaded via a PEP 302 loader and attempting to
  perform IO operations based on __file__). Original patch by
  Alexander Belopolsky.

- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
  allows backporting to maintenance branches. Original patch by
  Alexander Belopolsky.

208 209 210
- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
  a non-ASCII letter.

211 212
- Issue #4616: TarFile.utime(): Restore directory times on Windows.

213 214 215
- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
  codec cannot be found.  This is for compatibility with the builtin behavior.

216 217 218 219
- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
  give correct results in the case where one argument is a quiet NaN
  and the other is a finite number that requires rounding.

220 221 222
- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
  libs.

223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
- Added the subprocess.check_call_output() convenience function to get output
  from a subprocess on success or raise an exception on error.

- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
  support unusual filenames (such as those containing semi-colons) in
  Content-Disposition headers.

- Issue #4384: Added logging integration with warnings module using
  captureWarnings(). This change includes a NullHandler which does nothing;
  it will be of use to library developers who want to avoid the "No handlers
  could be found for logger XXX" message which can appear if the library user
  doesn't configure logging.

- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
  exception.

239 240 241 242 243 244 245 246 247
- Issue #4529: fix the parser module's validation of try-except-finally
  statements.

- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
  not a malformed option.

- Added the subprocess.check_output() convenience function to get output
  from a subprocess on success or raise an exception on error.

248 249 250
- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
  the corresponding tests now pass.

251 252 253
- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
  it was calling the wrong open() function.

254 255 256 257
- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
  support unusual filenames (such as those containing semi-colons) in
  Content-Disposition headers.

258 259 260
- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
  biarch systems. Try to rely on ldconfig only, without using objdump and gcc.

261 262 263 264 265
Tools/Demos
-----------

- Issue #4677: add two list comprehension tests to pybench.

266 267 268 269

Build
-----

270 271
- Issue #4895: Use _strdup on Windows CE.

272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
- Issue #4472: "configure --enable-shared" now works on OSX

- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.

- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".

- Issue #4289: Remove Cancel button from AdvancedDlg.

- Issue #1656675: Register a drop handler for .py* files on Windows.

- Issue #4120: Exclude manifest from extension modules in VS2008.

- Issue #4091: Install pythonxy.dll in system32 again.

- Issue #4018: Disable "for me" installations on Vista.

- Issue #3758: Add ``patchcheck`` build target to .PHONY.

- Issue #4204: Fixed module build errors on FreeBSD 4.


C-API
-----

- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.

- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
  the GIL is released, or owned by another thread.

- Issue #4122: On Windows, fix a compilation error when using the
  Py_UNICODE_ISSPACE macro in an extension module.


305 306 307
Extension Modules
-----------------

308 309
- Issue #4279: Fix build of parsermodule under Cygwin.

310 311 312 313
- Issue #4751: hashlib now releases the GIL when hashing large buffers
  (with a hardwired threshold of 2048 bytes), allowing better parallelization
  on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.

314 315
- Issue #4051: Prevent conflict of UNICODE macros in cPickle.

316 317 318 319
- Issue #4738: Each zlib object now has a separate lock, allowing to compress
  or decompress several streams at once on multi-CPU systems. Also, the GIL
  is now released when computing the CRC of a large buffer. Patch by ebfe.

320 321
- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.

322 323
- Issue #1040026: Fix os.times result on systems where HZ is incorrect.

324 325
- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
  OpenBSD.
326

327 328 329 330
- Issue #4583: array.array would not always prohibit resizing when a buffer
  has been exported, resulting in an interpreter crash when accessing the
  buffer.

331

332 333 334
Docs
----

335

336
**(For information about older versions, consult the HISTORY file.)**