Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fix Python bug #20108: getcallargs() with func keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Sep 21, 2016
1 parent 0ae5fd8 commit cf0621d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
17 changes: 8 additions & 9 deletions build/pkgs/python2/SPKG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ http://www.python.org/community/

=== Patches ===

* sdist.patch: Make sure that sdist copies over the .hg directory.
* socket.patch: Work around an SSL issue.
* permissions.patch: Changes the permission of installed libraries
to 0755 (like any other library) instead of 0555.
* sys_path_security.patch: ensure that the current working directory
or the script directory is prepended to sys.path only if there is no
security risk in doing so.
* io-issue_14437.patch: Fixes Python issue #14437 (building _io on Cygwin)
* sys_path_security-issue_16202.patch: ensure that the current working
directory or the script directory is prepended to sys.path only if
there is no security risk in doing so.
* ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching configure
and configure.in after running autotools).
* ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses)
Expand All @@ -66,7 +64,8 @@ http://www.python.org/community/
for C and C++). See http://bugs.python.org/issue5755.
* hashlibfallbacks-issue_18000.patch: Fixed Python issue #18000.
* tinfo.patch: make sure tinfo is correctly linked in when needed on Cygwin.

Temporarily removed since it does not apply to python-2.7.6:
* uuid.patch: patch from Python issue 11063; reduce uuid moudle import side
effects and fix thread related issues.
* uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid
module import side effects and fix thread related issues.
* getcallargs-issue_20108.patch: fix inspect.getcallargs() when the
function has a "func" keyword argument. Needed for @interact from
ipywidgets.
2 changes: 1 addition & 1 deletion build/pkgs/python2/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.10.p2
2.7.10.p3
26 changes: 26 additions & 0 deletions build/pkgs/python2/patches/getcallargs-issue_20108.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# HG changeset patch
# User Benjamin Peterson <benjamin@python.org>
# Date 1388687048 21600
# Node ID b0d472e3ff42de9fd2b1a702f5874202c2d2b27f
# Parent 8083b887068667a7b62443d56de310e7fe10d3df
avoid parameter name clash (closes #20108)

diff -ru a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py 2015-05-23 18:09:04.000000000 +0200
+++ b/Lib/inspect.py 2016-09-21 11:34:16.491938401 +0200
@@ -892,12 +892,14 @@
specs.append(formatvarkw(varkw) + formatvalue(locals[varkw]))
return '(' + string.join(specs, ', ') + ')'

-def getcallargs(func, *positional, **named):
+def getcallargs(*func_and_positional, **named):
"""Get the mapping of arguments to values.

A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'."""
+ func = func_and_positional[0]
+ positional = func_and_positional[1:]
args, varargs, varkw, defaults = getargspec(func)
f_name = func.__name__
arg2value = {}
20 changes: 0 additions & 20 deletions build/pkgs/python2/patches/sdist.patch

This file was deleted.

0 comments on commit cf0621d

Please sign in to comment.