]> granicus.if.org Git - python/commitdiff
merge 3.4
authorBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2015 04:29:08 +0000 (00:29 -0400)
committerBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2015 04:29:08 +0000 (00:29 -0400)
1  2 
Lib/test/test_functools.py
Misc/NEWS
Modules/_functoolsmodule.c

Simple merge
diff --cc Misc/NEWS
index 782bc698b90f3e273e33d307ae299b81e511cdfc,e2f749c42c2d5b692c1b6beb51e839a7d247f902..13dd8c30bcbb7cbaf94b860379131bcc89da9987
+++ b/Misc/NEWS
@@@ -69,104 -78,6 +69,106 @@@ Librar
  - Issue #23728: binascii.crc_hqx() could return an integer outside of the range
    0-0xffff for empty data.
  
 +- Issue #23887: urllib.error.HTTPError now has a proper repr() representation.
 +  Patch by Berker Peksag.
 +
 +Tests
 +-----
 +
 +- Issue #21520: test_zipfile no longer fails if the word 'bad' appears
 +  anywhere in the name of the current directory.
 +
 +- Issue #9517: Move script_helper into the support package.
 +  Patch by Christie Wilson.
 +
 +Documentation
 +-------------
 +
 +- Issue #24029: Document the name binding behavior for submodule imports.
 +
 +- Issue #24077: Fix typo in man page for -I command option: -s, not -S
 +
 +Tools/Demos
 +-----------
 +
 +- Issue #24000: Improved Argument Clinic's mapping of converters to legacy
 +  "format units".  Updated the documentation to match.
 +
 +- Issue #24001: Argument Clinic converters now use accept={type}
 +  instead of types={'type'} to specify the types the converter accepts.
 +
 +- Issue #23330: h2py now supports arbitrary filenames in #include.
 +
 +- Issue #24031: make patchcheck now supports git checkouts, too.
 +
 +
 +What's New in Python 3.5.0 alpha 4?
 +===================================
 +
 +Release date: 2015-04-19
 +
 +Core and Builtins
 +-----------------
 +
 +- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
 +  the architecture triplet in the extension name, to make it easy to test builds
 +  for different ABIs in the same working tree.  Under OS X, the extension name
 +  now includes PEP 3149-style information.
 +
 +- Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES.
 +  Patch courtesy of Joe Jevnik.
 +
 +- Issue #23731: Implement PEP 488: removal of .pyo files.
 +
 +- Issue #23726: Don't enable GC for user subclasses of non-GC types that
 +  don't add any new fields.  Patch by Eugene Toder.
 +
 +- Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
 +  while it is holding a lock to a buffered I/O object, and the main thread
 +  tries to use the same I/O object (typically stdout or stderr).  A fatal
 +  error is emitted instead.
 +
 +- Issue #22977: Fixed formatting Windows error messages on Wine.
 +  Patch by Martin Panter.
 +
 +- Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
 +  non-integer input.
 +
 +- Issue #24044: Fix possible null pointer dereference in list.sort in out of
 +  memory conditions.
 +
 +- Issue #21354: PyCFunction_New function is exposed by python DLL again.
 +
 +Library
 +-------
 +
 +- Issue #16914: new debuglevel 2 in smtplib adds timestamps to debug output.
 +
 +- Issue #7159: urllib.request now supports sending auth credentials
 +  automatically after the first 401.  This enhancement is a superset of the
 +  enhancement from issue #19494 and supersedes that change.
 +
 +- Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
 +  Patch by Demian Brecht.
 +
 +- Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
 +
 +- Issue 19933: Provide default argument for ndigits in round. Patch by
 +  Vajrasky Kok.
 +
 +- Issue #23193: Add a numeric_owner parameter to
 +  tarfile.TarFile.extract and tarfile.TarFile.extractall. Patch by
 +  Michael Vogt and Eric Smith.
 +
 +- Issue #23342: Add a subprocess.run() function than returns a CalledProcess
 +  instance for a more consistent API than the existing call* functions.
 +
 +- Issue #21217: inspect.getsourcelines() now tries to compute the start and end
 +  lines from the code object, fixing an issue when a lambda function is used as
 +  decorator argument. Patch by Thomas Ballinger and Allison Kaptur.
 +
++- The keywords attribute of functools.partial is now always a dictionary.
++
  - Issue #23811: Add missing newline to the PyCompileError error message.
    Patch by Alex Shkop.
  
index 3413b12dfe9078368616f31d94c207976468f990,24da67741b841ff2ac71cb11564f2f2f19daee7b..3c82e5134a492df7b34a9eb5c64299e5840f96ef
@@@ -65,46 -54,12 +65,55 @@@ partial_new(PyTypeObject *type, PyObjec
          Py_DECREF(pto);
          return NULL;
      }
 -    pto->kw = (kw != NULL) ? PyDict_Copy(kw) : PyDict_New();
 -    if (pto->kw == NULL) {
 -        Py_DECREF(pto);
 -        return NULL;
 +    if (pargs == Py_None || PyTuple_GET_SIZE(pargs) == 0) {
 +        pto->args = nargs;
 +        Py_INCREF(nargs);
      }
 +    else if (PyTuple_GET_SIZE(nargs) == 0) {
 +        pto->args = pargs;
 +        Py_INCREF(pargs);
 +    }
 +    else {
 +        pto->args = PySequence_Concat(pargs, nargs);
 +        if (pto->args == NULL) {
 +            pto->kw = NULL;
 +            Py_DECREF(pto);
 +            return NULL;
 +        }
 +    }
 +    Py_DECREF(nargs);
  
-         pto->kw = pkw;
-         Py_INCREF(pkw);
 +    if (kw != NULL) {
 +        if (pkw == Py_None) {
 +            pto->kw = PyDict_Copy(kw);
 +        }
 +        else {
 +            pto->kw = PyDict_Copy(pkw);
 +            if (pto->kw != NULL) {
 +                if (PyDict_Merge(pto->kw, kw, 1) != 0) {
 +                    Py_DECREF(pto);
 +                    return NULL;
 +                }
 +            }
 +        }
 +        if (pto->kw == NULL) {
 +            Py_DECREF(pto);
 +            return NULL;
 +        }
 +    }
 +    else {
++        if (pkw == Py_None) {
++            pto->kw = PyDict_New();
++            if (pto->kw == NULL) {
++                Py_DECREF(pto);
++                return NULL;
++            }
++        }
++        else {
++            pto->kw = pkw;
++            Py_INCREF(pkw);
++        }
 +    }
  
      pto->weakreflist = NULL;
      pto->dict = NULL;