dpkt icon indicating copy to clipboard operation
dpkt copied to clipboard

On windows, check if the file is opened in binary mode

Open kbandla opened this issue 7 years ago • 5 comments

Often times, windows users open the files with the wrong mode. Unfortunately, the file mode property is read-only, so we can not fix it on the fly. Raise an exception instead.

kbandla avatar Jun 01 '17 02:06 kbandla

Why are all the builds suddenly failing? Seems to be related to https://github.com/pypa/setuptools/issues/937. I'll poke around on it. Okay.. I'm not sure what's going on with Travis CI.. I'm going to wait a day and see if they figure it out/clear it up.

brifordwylie avatar Jun 01 '17 02:06 brifordwylie

Coverage Status

Coverage decreased (-0.6%) to 87.878% when pulling fad3d74548ff73e73a367c623e25fa09bde499b5 on pcap_binary_mode into 6754f4489686e27a878b482fc750e82130583c8d on master.

coveralls avatar Jun 01 '17 14:06 coveralls

Okay the tests on TravisCI are now properly running again... there are two failed tests...

    def __init__(self, fileobj, snaplen=1500, linktype=DLT_EN10MB, nano=False):
>       if fileobj.mode != 'wb':
E       AttributeError: 'BytesIO' object has no attribute 'mode'

and then a test for the deprecated decorator (I don't totally understand why that is failing).

brifordwylie avatar Jun 01 '17 14:06 brifordwylie

going to look at this some more later today. I have a bunch of more updates for pcap.py anyway

kbandla avatar Jun 01 '17 14:06 kbandla

Shrug... somehow the builds are failing... will have to circle back to this and see if I can figure out the issues...

brifordwylie avatar Mar 29 '22 16:03 brifordwylie