We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2172ec1 commit 08c0939Copy full SHA for 08c0939
1 file changed
browserstack/local.py
@@ -93,7 +93,14 @@ def start(self, **kwargs):
93
self.proc = subprocess.Popen(self._generate_cmd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
94
(out, err) = self.proc.communicate()
95
96
- os.system('echo "" > "'+ self.local_logfile_path +'"')
+ logfile_dir = os.path.dirname(self.local_logfile_path)
97
+ if logfile_dir:
98
+ os.makedirs(logfile_dir, exist_ok=True)
99
+ try:
100
+ with open(self.local_logfile_path, 'w') as f:
101
+ f.write('')
102
+ except OSError as e:
103
+ raise BrowserStackLocalError('Unable to open logfile: {}'.format(e))
104
try:
105
if out:
106
output_string = out.decode()
0 commit comments