You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_ignoredir.py: Test --ignore-dir for --listfuncs and --trackcalls
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2010-12-12.12:34:28.214>labels= ['type-bug']
title='trace does not ignore --ignore-module'updated_at=<Date2018-04-13.16:39:57.662>user='https://bugs.python.org/RusiMody'
(When replying by email to an email, please remove any quotation, except possibly for a specific line or two. The message already appears about yours on the tracker.)
Good. It will take about a week for the * to appear after your name.
As the diff is posted, hg could not find trace.py to patch. Changing
--- Lib/trace.py Fri Feb 24 15:58:24 2012
+++ Lib/trace.py Wed Oct 30 16:35:49 2013
<to>
--- a/Lib/trace.py Fri Feb 24 15:58:24 2012
+++ b/Lib/trace.py Wed Oct 30 16:35:49 2013
fixed that problem, and 3/4 chunks apply to 3.4 (map has already been replaced).
Running test/test_trace.py (with repository 3.4) gives the same errors as without the patch. The changes look sensible. However, a test is needed that fails without the patch and passes with it. Can you write one that could be added to the test file, or at least pieces of a test and a manual test procedure?
tomhines commented on May 26, 2015
tomhinesmannequin
Mannequin
More actions
Test attached. Paste into test/test_trace.py. I tested in 2.7 and 3.4. Feel free to modify it.
Activity
RusiMody commentedon Dec 12, 2010
When running trace, I get a a lot of lines like:
filename: /usr/lib/python2.7/cmd.py, modulename: cmd, funcname: Cmd
That is to say system modules are shown in the trace whereas I only want to see the code I am working on
Ive tried
python2.7 -m trace --listfuncs tt.py --ignore-dir '/usr/lib' > const-dir.trace
python2.7 -m trace --listfuncs --ignore-module cmd tt.py > const.trace
python2.7 -m trace --ignore-module --listfuncs cmd tt.py > const.trace
terryjreedy commentedon Dec 17, 2010
Please try the recent 2.7.1 release. This needs to be tested with current 3.1.3 or 3.1.b+ also.
[-]trace does nto ignore --ignore-module[/-][+]trace does not ignore --ignore-module[/+]tomhines commentedon Oct 31, 2013
The trace module ignores the --ignore-dir option for both the --listfuncs and --trackcalls modes. I have attached a patch.
terryjreedy commentedon May 18, 2015
Tom, please sign the PSF Contributor Agreement
https://www.python.org/psf/contrib/
https://www.python.org/psf/contrib/contrib-form/
tomhines commentedon May 18, 2015
Done.
On Sun, May 17, 2015 at 8:42 PM, Terry J. Reedy <report@bugs.python.org>
wrote:
terryjreedy commentedon May 18, 2015
(When replying by email to an email, please remove any quotation, except possibly for a specific line or two. The message already appears about yours on the tracker.)
Good. It will take about a week for the * to appear after your name.
As the diff is posted, hg could not find trace.py to patch. Changing
--- Lib/trace.py Fri Feb 24 15:58:24 2012
+++ Lib/trace.py Wed Oct 30 16:35:49 2013
<to>
--- a/Lib/trace.py Fri Feb 24 15:58:24 2012
+++ b/Lib/trace.py Wed Oct 30 16:35:49 2013
fixed that problem, and 3/4 chunks apply to 3.4 (map has already been replaced).
Running test/test_trace.py (with repository 3.4) gives the same errors as without the patch. The changes look sensible. However, a test is needed that fails without the patch and passes with it. Can you write one that could be added to the test file, or at least pieces of a test and a manual test procedure?
tomhines commentedon May 26, 2015
Test attached. Paste into test/test_trace.py. I tested in 2.7 and 3.4. Feel free to modify it.
tomhines commentedon Apr 13, 2018
bump
FirefighterBlu3 commentedon Jun 10, 2022
bump again?
vasiliyk commentedon Oct 19, 2026
Still reproduces on main (3.16.0a1+dev).
--ignore-dirand--ignore-moduleare respected by--trace,--countbut not by--listfuncsor--trackcalls.I opened gh-162469, with a credit to Tom Hines for the original patch.