6

I am having issues running this code on my machine, but it works fine on my schools linux machines.

The error i am getting is:

Traceback (most recent call last):  
File "wireshark_02.py", line 74, in <module>   
    main()  
  File "wireshark_02.py", line 43, in main  
 input_data = dpkt.pcap.Reader(open(file_name,'r'))  
  File "C:\Users\Slava\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dpkt\pcap.py", line 244, in __init__    
    buf = self.__f.read(FileHdr.__hdr_len__)  
  File "C:\Users\Slava\AppData\Local\Programs\Python\Python36- 
 32\lib\encodings\cp1252.py", line 23, in decode    
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]   
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position
125: character maps to <undefined>    

I've installed dpkt running pip install dpkt.

Is there anything i can do to make this work on my machine or do i need to use my schools computers?

Noelkd
  • 7,686
  • 2
  • 29
  • 43
Slava A.
  • 97
  • 6

1 Answers1

3
open(file_name, 'rb')

worked for me!

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51