From 2c8405045a346ed989c47a569b4c246641c3e2b1 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 16 Jul 2018 14:07:31 -0600 Subject: [PATCH] Fix file creation --- netarch/ip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netarch/ip.py b/netarch/ip.py index 9f31424..0d1602b 100644 --- a/netarch/ip.py +++ b/netarch/ip.py @@ -15,7 +15,7 @@ except ImportError: import netarch.py_pcap as pcap import os import cgi -import urllib +import urllib.parse from netarch import unpack, hexdump from netarch.trilobytes import TriloBytes @@ -698,11 +698,11 @@ class Session: fn = '%d-%s~%d-%s~%d---%s' % (frame.time, frame.src_addr, frame.sport, frame.dst_addr, frame.dport, - urllib.quote(fn, '')) + urllib.parse.quote(fn, '')) fullfn = os.path.join(self.basename, fn) fullfn2 = os.path.join(self.basename2, fn) print(' writing %s' % (fn,)) - fd = open(fullfn, 'w') + fd = open(fullfn, 'wb') try: os.unlink(fullfn2) except OSError: