rnithyanand / dpkt

Automatically exported from code.google.com/p/dpkt
Other
0 stars 0 forks source link

Python 3 support #76

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Attached is a patch for python3 support.
The patch is not pretty and not perfect, but it works for me.

Should work with versions 2.6-3.2, though i only tested it with python2.7 and 
python3.2. For versions < 2.6 there'd be a lot more work to do.

API break for py3k:
you have to use for example:
a = IP(b'asd')
b = bytes(a)
assert a == IP(b)

For py2 it should remain the same as before.

Original issue reported on code.google.com by johann....@gmail.com on 25 Sep 2011 at 3:02

Attachments:

GoogleCodeExporter commented 9 years ago
Works fine here, but this patch requires six to be installed.

Original comment by phihag.de@gmail.com on 10 Jul 2012 at 9:23

GoogleCodeExporter commented 9 years ago
Here is an additional patch for dpkt v1.7 enabling python3 support. This one is 
based on the johann's patch. There are no dependencies to be installed, six is 
no more needed for cdp. This would make dpkt the first python based 
packet-manipulation tool with python 3.x support! (eg scapy is still on v2.7)

Original comment by michael....@gmail.com on 2 Jan 2013 at 9:15

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I work on Windows 7 64bit and python 3.3 64bit, there are still some syntax 
errors after applying michael's patch, and I do some further patch stuff.
Because I'm really new for python and started with python 3.3 directly, maybe 
it goes wrong for some reason, becareful!!!
After all, I really hope this project to be ported to python 3 officially.

Sorry for my poor english.

Original comment by XinmuOnT...@gmail.com on 10 May 2013 at 9:18

Attachments: