#22 pylibpcap 0.6.4 does not support Python 3

open
nobody
None
5
2013-01-23
2013-01-23
Paul Koning
No

I tried to build 0.6.4 with Python 3 (specifically, version 3.3). That did not work.
The main issue is that the old SWIG that was used predates Python 3 and does not support it. The latest (SWIG 2.0.9) does. I ran it and then made a few more changes to correct a few remaining issues. The result is a version that works with Python 3 and also still with Python 2 (tested on 2.7). Both the examples run correctly in both.
Attached is a source kit file that has the changes; I will also attach a diff for completeness. Note that I renamed the SWIG output from pcap_wrap.c (its new output file name convention) back to pcap.c as it was before.

Discussion

  • Paul Koning
    Paul Koning
    2013-01-23

    Source kit as modified to work with Python 3

     
  • Paul Koning
    Paul Koning
    2013-01-23

    Diff for the Python 3 support changes