Commit Graph

4272 Commits

Author SHA1 Message Date
Raymond Hettinger dc08a143e0 Issue #9826: Handle recursive repr in collections.OrderedDict. 2010-09-12 05:15:22 +00:00
Raymond Hettinger fa11db0a02 Issue #9825: Replace OrderedDict.__del__() with weakrefs. 2010-09-12 04:12:42 +00:00
Benjamin Peterson 568867a6f2 check for NULL tp_as_mapping in PySequence_(Get/Set/Del)Slice #9834 2010-09-11 16:02:03 +00:00
Victor Stinner 1205f2774e Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on
a non-ASCII byte in the format string.

Document also the encoding.
2010-09-11 00:54:47 +00:00
Victor Stinner 6f7b783cde Issue #9579, #9580: Oops, add the author of the patch 2010-09-10 23:50:31 +00:00
Victor Stinner cb04352e8c Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and encode
the value with filesystem encoding and surrogateescape (instead of utf-8 in
strict mode).
2010-09-10 23:49:04 +00:00
Victor Stinner 5b519e0201 Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
2010-09-10 21:57:59 +00:00
Amaury Forgeot d'Arc ba117ef7e9 #4617: Previously it was illegal to delete a name from the local
namespace if it occurs as a free variable in a nested block.  This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).

This sample was valid in 2.6, but fails to compile in 3.x without this change::

   >>> def f():
   ...     def print_error():
   ...        print(e)
   ...     try:
   ...        something
   ...     except Exception as e:
   ...        print_error()
   ...        # implicit "del e" here


This sample has always been invalid in Python, and now works::

   >>> def outer(x):
   ...     def inner():
   ...        return x
   ...     inner()
   ...     del x

There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
2010-09-10 21:39:53 +00:00
Antoine Pitrou 8e6b407d6f Issue #941346: Improve the build process under AIX and allow Python to
be built as a shared library.  Patch by Sébastien Sablé.
2010-09-10 19:44:44 +00:00
Antoine Pitrou e4a189274f Issue #9804: ascii() now always represents unicode surrogate pairs as
a single `\UXXXXXXXX`, regardless of whether the character is printable
or not.  Also, the "backslashreplace" error handler now joins surrogate
pairs into a single character on UCS-2 builds.
2010-09-09 20:30:23 +00:00
Antoine Pitrou ea99c5c949 Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark).  Mostly ported from
Unladen Swallow; initial patch by Alexandre Vassalotti.
2010-09-09 18:33:21 +00:00
Antoine Pitrou 6e6cc830c4 Issue #9757: memoryview objects get a release() method to release the
underlying buffer (previously this was only done when deallocating the
memoryview), and gain support for the context management protocol.
2010-09-09 12:59:39 +00:00
Raymond Hettinger bad3c88094 Have pprint() respect the order in an OrderedDict. 2010-09-09 12:31:00 +00:00
Hirokazu Yamamoto d72461a7ed Updated VS7.1 project file. (I cannot test this file because I don't have VS7.1) 2010-09-09 06:14:23 +00:00
Antoine Pitrou b41e128fe1 Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well
as wide (UCS4) unicode builds for both the host interpreter (embedded
inside gdb) and the interpreter under test.
2010-09-08 20:57:48 +00:00
Antoine Pitrou 079ce54efe Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
thread-local storage key.
2010-09-08 12:37:10 +00:00
Vinay Sajip 121a1c4e11 logging: Added QueueHandler. 2010-09-08 10:46:15 +00:00
Georg Brandl febeb00e41 Add Lukasz. 2010-09-08 10:43:45 +00:00
Antoine Pitrou 783eea722b Issue #9707: Rewritten reference implementation of threading.local which
is friendlier towards reference cycles.  This change is not normally
visible since an optimized C implementation (_thread._local) is used
instead.
2010-09-07 22:06:17 +00:00
Amaury Forgeot d'Arc 4b6fdf3852 #6394: Add os.getppid() support for Windows. 2010-09-07 21:31:17 +00:00
Antoine Pitrou 4b92b5fad3 Issue #9792: In case of connection failure, socket.create_connection()
would swallow the exception and raise a new one, making it impossible
to fetch the original errno, or to filter timeout errors.  Now the
original error is re-raised.
2010-09-07 21:05:49 +00:00
Antoine Pitrou 5e38aae91b Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True,
and the passed buffer was exactly 1024 bytes long, the buffer wouldn't
be updated back after the system call.  Original patch by Brian Brazil.
2010-09-07 16:30:09 +00:00
Antoine Pitrou a300007c6e Issue #4026: Make the fcntl extension build under AIX.
Patch by Sébastien Sablé.
2010-09-07 14:52:42 +00:00
Raymond Hettinger 0515661314 Issues #7889, #9025 and #9379: Improvements to the random module. 2010-09-07 04:44:52 +00:00
Raymond Hettinger f763a728ad Document which part of the random module module are guaranteed. 2010-09-07 00:38:15 +00:00
Raymond Hettinger 435cb0f233 Document which part of the random module module are guaranteed. 2010-09-06 23:36:31 +00:00
Raymond Hettinger f45abc97bf Add method to OrderedDict for repositioning keys to the ends. 2010-09-06 21:26:09 +00:00
Florent Xicluna feb2ee46bc typo 2010-09-06 20:27:15 +00:00
Antoine Pitrou 4bc12ef47d Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest
test cases now also have assertWarns and assertWarnsRegexp methods to
check that a given warning type was triggered by the code under test.
2010-09-06 19:25:46 +00:00
Antoine Pitrou 972ee13e03 Issue #5506: BytesIO objects now have a getbuffer() method exporting a
view of their contents without duplicating them.  The view is both readable
and writable.
2010-09-06 18:48:21 +00:00
Brian Curtin 6285774f06 Implement #7566 - os.path.sameopenfile for Windows.
This uses the GetFileInformationByHandle function to return a tuple of values
to identify a file, then ntpath.sameopenfile compares file tuples, which
is exposed as os.path.sameopenfile.
2010-09-06 17:07:27 +00:00
Gregory P. Smith 13b55291ac hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_avaiable that respectively list the names of hash algorithms
guaranteed to exist in all Python implementations and the names of hash
algorithms available in the current process.

Renames the attribute new in 3.2a0 'algorithms' to 'algorithms_guaranteed'.
2010-09-06 08:30:23 +00:00
Antoine Pitrou 0d739d7047 Issue #9293: I/O streams now raise `io.UnsupportedOperation` when an
unsupported operation is attempted (for example, writing to a file open
only for reading).
2010-09-05 23:01:12 +00:00
Georg Brandl bad092556e Post-release update. 2010-09-05 21:29:17 +00:00
Éric Araujo 713f2aa569 Fix amk’s tracker name 2010-09-05 18:21:46 +00:00
Georg Brandl 65ce6ada7f Fix reST in NEWS, and remove NEWS.help (all committers should now know reST anyway, and for those who do not, there is Documenting Python.) 2010-09-05 17:32:31 +00:00
Georg Brandl 649971e63b Rewrap. 2010-09-05 17:06:50 +00:00
Georg Brandl 58a7b46075 Bump to 3.2a2. 2010-09-05 08:30:40 +00:00
Raymond Hettinger 4c7c9af542 Clean-up functools.total_ordering(). 2010-09-05 05:57:35 +00:00
Raymond Hettinger 46462f3fb3 Typo 2010-09-05 00:36:26 +00:00
Antoine Pitrou 0049249d63 Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided.  Patch by Pascal Chambon.
2010-09-04 20:53:29 +00:00
Antoine Pitrou 7d6e076f6d Issue #7451: Improve decoding performance of JSON objects, and reduce
the memory consumption of said decoded objects when they use the same
strings as keys.
2010-09-04 20:16:53 +00:00
Antoine Pitrou 74a69fa662 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
by the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but
our bytecode is a bit simplified.  Patch by Demur Rumed.
2010-09-04 18:43:52 +00:00
Brett Cannon ef0e6c3b04 _warnings exposed two variables with the name 'default_action' and
'once_registry'. This is bad as the warnings module had variables named
'defaultaction' and 'onceregistry' which are what people should be looking at
(technically those variables shouldn't be mucked with as they are undocumented,
but we all know better than to believe that isn't happening). So the variables
from _warnings have been renamed to come off as private and to avoid confusion
over what variable should be used.

Closes issue #9766. Thanks to Antoine Pitrou for the discovery.
2010-09-04 18:24:04 +00:00
Antoine Pitrou b5cfd555b2 Fix Björn's name in ACKS. 2010-09-04 17:40:51 +00:00
Antoine Pitrou 3941a8fece Issue #1100562: Fix deep-copying of objects derived from the list and dict types.
Patch by Michele Orrù and Björn Lindqvist.
2010-09-04 17:40:21 +00:00
Antoine Pitrou d3ccde8a21 Issue #7736: Release the GIL around calls to opendir() and closedir()
in the posix module.  Patch by Marcin Bachry.
2010-09-04 17:21:57 +00:00
Martin v. Löwis a5e3109154 Issue #1303434: Include PDBs in release.
Patch by James Lee and Daniel Stutzbach.
2010-09-04 14:38:09 +00:00
Fred Drake cc645b9a59 add consistent support for the vars and default arguments on all
configuration parser classes
(http://bugs.python.org/issue9421)
2010-09-04 04:35:34 +00:00
Barry Warsaw aa44b2b5ca NEWS for PEP 3149, and clean up a few other entries. 2010-09-03 18:36:11 +00:00