Skip to content

Results.plot callback receive 2 args: (query,answer)#4764

Merged
gpotter2 merged 1 commit into
secdev:masterfrom
isidroas:plot_arguments
Jun 17, 2025
Merged

Results.plot callback receive 2 args: (query,answer)#4764
gpotter2 merged 1 commit into
secdev:masterfrom
isidroas:plot_arguments

Conversation

@isidroas

@isidroas isidroas commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Fixes:

>>> a.plot(lambda x:x[1].id)
File /home/isidro/ms/webserver/venv/lib/python3.13/site-packages/scapy/plist.py:288, in _PacketList.plot(self, f, lfilter, plot_xy, **kargs)
    286 # Get the list of packets
    287 if lfilter is None:
--> 288     lst_pkts = [f(*e) for e in self.res]
    289 else:
    290     lst_pkts = [f(*e) for e in self.res if lfilter(*e)]

TypeError: <lambda>() takes 1 positional argument but 2 were given

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

Fixes:

```python
>>> a.plot(lambda x:x[1].id)
File /home/isidro/ms/webserver/venv/lib/python3.13/site-packages/scapy/plist.py:288, in _PacketList.plot(self, f, lfilter, plot_xy, **kargs)
    286 # Get the list of packets
    287 if lfilter is None:
--> 288     lst_pkts = [f(*e) for e in self.res]
    289 else:
    290     lst_pkts = [f(*e) for e in self.res if lfilter(*e)]

TypeError: <lambda>() takes 1 positional argument but 2 were given
```
@codecov

codecov Bot commented Jun 15, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.26%. Comparing base (56de4f4) to head (e37679c).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4764      +/-   ##
==========================================
- Coverage   82.16%   81.26%   -0.90%     
==========================================
  Files         362      363       +1     
  Lines       87359    88325     +966     
==========================================
+ Hits        71777    71780       +3     
- Misses      15582    16545     +963     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpotter2 gpotter2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@gpotter2 gpotter2 merged commit 543d3f7 into secdev:master Jun 17, 2025
23 of 24 checks passed
@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants