from .utils import (
bug_reports_message,
expand_path,
- process_communicate_or_kill,
+ Popen,
YoutubeDLCookieJar,
)
return password.encode('utf-8')
else:
logger.debug('using find-generic-password to obtain password')
- proc = subprocess.Popen(['security', 'find-generic-password',
- '-w', # write password to stdout
- '-a', browser_keyring_name, # match 'account'
- '-s', '{} Safe Storage'.format(browser_keyring_name)], # match 'service'
- stdout=subprocess.PIPE,
- stderr=subprocess.DEVNULL)
+ proc = Popen(
+ ['security', 'find-generic-password',
+ '-w', # write password to stdout
+ '-a', browser_keyring_name, # match 'account'
+ '-s', '{} Safe Storage'.format(browser_keyring_name)], # match 'service'
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
try:
- stdout, stderr = process_communicate_or_kill(proc)
+ stdout, stderr = proc.communicate_or_kill()
if stdout[-1:] == b'\n':
stdout = stdout[:-1]
return stdout