rnithyanand / dpkt

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

[patch] Allow pcap.Reader to work with StringIO objects. #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pass a StringIO object to dpkt.pcap.Reader()

What is the expected output? What do you see instead?
This should parse the file, but instead it raises AttributeError because 
StringIO doesn't have a fileno attribute.

What version of the product are you using? On what operating system?
dpkt 1.8 on Ubuntu 12.04

Please provide any additional information below.
I've attached a patch to fix this problem.  I don't call .fileno() on the 
passed in fileobj until someone calls .fileno() on the Reader object.

Original issue reported on code.google.com by george.m...@gmail.com on 15 Nov 2013 at 3:12

Attachments: