Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isidroas
Copy link

@isidroas isidroas commented Jun 5, 2025

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
```
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.

1 participant