catchpoint / WebPageTest.agent

Cross-platform WebPageTest agent
Other
213 stars 138 forks source link

Remove file #556

Closed sammeboy635 closed 1 year ago

sammeboy635 commented 2 years ago

Replaced half of the current os.remove() functions with the new os_util.remove_file() function. I also may have corrected a bug within wptagent.py removing the exit_file instead of the shutdown file. Please correct me if I'm wrong.

pmeenan commented 1 year ago

FYI, I'm seeing an exception when I run with this patch:

Unhandled exception in test run: _log() got an unexpected keyword argument 'stacklevel'

It looks like stacklevel was added in Python 3.8 but "python3" on Ubuntu 18.04 is 3.6. It looks like remove_file (and remove_dir_tree) should be updated to only use that param on > 3.8. The logging call should probably be inside of a separate try/except block as well to make sure it doesn't add a failure mode.