# Buggy code
def __init__(self, serial=""):
    self._serial = serial
    # logging.log_path only exists when this is used in an Mobly test run.
    self._log_path_base = getattr(logging, "log_path", "/tmp/logs")
    self._log_path = os.path.join(self._log_path_base, "AndroidDevice%s" % self._serial)
    self._debug_tag = self._serial
    self.log = AndroidDeviceLoggerAdapter(logging.getLogger(), {"tag": self.debug_tag})
    self.sl4a = None
    self.ed = None
    self._adb_logcat_process = None
    self.adb_logcat_file_path = None
    self.adb = adb.AdbProxy(serial)
    self.fastboot = fastboot.FastbootProxy(serial)
    if not self.is_bootloader and self.is_rootable:
        self.root_adb()
    # A dict for tracking snippet clients. Keys are clients' attribute
    # names, values are the clients: {<attr name string>: <client object>}.
    self._snippet_clients = {}
    # Device info cache.
    self._user_added_device_info = {}


# Traceback (TypeError)
Traceback (most recent call last):
File ".../mobly/test_runner.py", line 420, in _register_controller
objects = create(controller_config)
File ".../mobly/controllers/android_device.py", line 87, in create
ads = get_instances_with_configs(configs)
File ".../mobly/controllers/android_device.py", line 257, in get_instances_with_configs
ad = AndroidDevice(serial)
File ".../mobly/controllers/android_device.py", line 402, in __init__
if not self.is_bootloader and self.is_rootable:
File ".../mobly/controllers/android_device.py", line 637, in is_rootable
build_type_output = self.adb.getprop('ro.build.type').lower()
File ".../mobly/controllers/android_device_lib/adb.py", line 175, in getprop
return self.shell('getprop %s' % prop_name).decode('utf-8').strip()
File ".../mobly/controllers/android_device_lib/adb.py", line 199, in adb_call
clean_name, args, shell=shell, timeout=timeout)
File ".../mobly/controllers/android_device_lib/adb.py", line 161, in _exec_adb_cmd
return self._exec_cmd(adb_cmd, shell=shell, timeout=timeout)
File ".../mobly/controllers/android_device_lib/adb.py", line 122, in _exec_cmd
args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
TypeError: execv() arg 2 must contain only strings

# Fixed code
def __init__(self, serial=""):
    self._serial = str(serial)
    # logging.log_path only exists when this is used in an Mobly test run.
    self._log_path_base = getattr(logging, "log_path", "/tmp/logs")
    self._log_path = os.path.join(self._log_path_base, "AndroidDevice%s" % self._serial)
    self._debug_tag = self._serial
    self.log = AndroidDeviceLoggerAdapter(logging.getLogger(), {"tag": self.debug_tag})
    self.sl4a = None
    self.ed = None
    self._adb_logcat_process = None
    self.adb_logcat_file_path = None
    self.adb = adb.AdbProxy(serial)
    self.fastboot = fastboot.FastbootProxy(serial)
    if not self.is_bootloader and self.is_rootable:
        self.root_adb()
    # A dict for tracking snippet clients. Keys are clients' attribute
    # names, values are the clients: {<attr name string>: <client object>}.
    self._snippet_clients = {}
    # Device info cache.
    self._user_added_device_info = {}