From 72356eb9a137dee67fe2960790f49c60e2dd1506 Mon Sep 17 00:00:00 2001 From: Stephane Blondon Date: Tue, 1 May 2018 17:51:22 +0200 Subject: [PATCH 1/3] Parameters displayed ins parentheses are not displayed for module call --- Lib/cgitb.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/cgitb.py b/Lib/cgitb.py index 0f5f32c0fadee1c..4f81271be3ca786 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -124,8 +124,9 @@ def html(einfo, context=5): args, varargs, varkw, locals = inspect.getargvalues(frame) call = '' if func != '?': - call = 'in ' + strong(pydoc.html.escape(func)) + \ - inspect.formatargvalues(args, varargs, varkw, locals, + call = 'in ' + strong(pydoc.html.escape(func)) + if func != "": + call += inspect.formatargvalues(args, varargs, varkw, locals, formatvalue=lambda value: '=' + pydoc.html.repr(value)) highlight = {} @@ -207,8 +208,9 @@ def text(einfo, context=5): args, varargs, varkw, locals = inspect.getargvalues(frame) call = '' if func != '?': - call = 'in ' + func + \ - inspect.formatargvalues(args, varargs, varkw, locals, + call = 'in ' + func + if func != "": + call += inspect.formatargvalues(args, varargs, varkw, locals, formatvalue=lambda value: '=' + pydoc.text.repr(value)) highlight = {} From c795de3838b4eab50a262739023fa0b32b962a43 Mon Sep 17 00:00:00 2001 From: Stephane Blondon Date: Tue, 1 May 2018 22:36:27 +0200 Subject: [PATCH 2/3] Add news file --- .../next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst diff --git a/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst b/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst new file mode 100644 index 000000000000000..1ccc2d96e9c45fc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst @@ -0,0 +1,2 @@ +Text and html output generated by cgitb does not display parentheses if the +current call is done directly in the module From 25002d9664b38d730d33fdf09613096194464b2e Mon Sep 17 00:00:00 2001 From: Stephane Blondon Date: Tue, 8 May 2018 18:28:21 +0200 Subject: [PATCH 3/3] add author in news file --- .../next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst b/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst index 1ccc2d96e9c45fc..d0218de373ca7c4 100644 --- a/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst +++ b/Misc/NEWS.d/next/Library/2018-05-01-22-33-14.bpo-33311.8YPB-k.rst @@ -1,2 +1,2 @@ Text and html output generated by cgitb does not display parentheses if the -current call is done directly in the module +current call is done directly in the module. Patch by Stéphane Blondon.