Test: Fix default capture interface discovery.
authorGerald Combs <gerald@wireshark.org>
Thu, 3 May 2018 19:06:52 +0000 (12:06 -0700)
committerGerald Combs <gerald@wireshark.org>
Thu, 3 May 2018 19:45:36 +0000 (19:45 +0000)
Change-Id: Id033a0e4e1e81ae9e84774b2d76f95049a2e2b3a
Reviewed-on: https://code.wireshark.org/review/27315
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
test/config.py

index 17f9f66677d38e53eef7d454019bc89130f5a2fb..0ff2698d06654bf186df243d8bcba4d8345598fb 100644 (file)
@@ -118,8 +118,12 @@ def getDefaultCaptureInterface():
     if not sys.platform.startswith('win32'):
         return
     try:
-        dumpcap_d_blob = str(subprocess.check_output((cmd_dumpcap, '-D'), stderr=subprocess.PIPE))
-        for d_line in dumpcap_d_blob.splitlines():
+        dumpcap_d_data = subprocess.check_output((cmd_dumpcap, '-D'), stderr=subprocess.PIPE)
+        if sys.version_info[0] >= 3:
+            dumpcap_d_stdout = dumpcap_d_data.decode('UTF-8', 'replace')
+        else:
+            dumpcap_d_stdout = unicode(dumpcap_d_data, 'UTF-8', 'replace')
+        for d_line in dumpcap_d_stdout.splitlines():
             iface_m = re.search('(\d+)\..*(Ethernet|Network Connection|VMware|Intel)', d_line)
             if iface_m:
                 capture_interface = iface_m.group(1)