Skip to content

fix(PermissionError): Make file executable before running the app. #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 6, 2020
Merged

Conversation

ycd
Copy link
Contributor

@ycd ycd commented Oct 5, 2020

Closes #221,

Reproducing the PR

By default driver comes without S_IEXEC symbol, now it gives file S_IEXEC symbol before running it.

Copy link
Member

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have such a logic here in place:

if not sys.platform == "win32":
st = os.stat(driver_executable)
if st.st_mode & stat.S_IEXEC == 0:
os.chmod(driver_executable, st.st_mode | stat.S_IEXEC)

@mxschmitt mxschmitt requested a review from pavelfeldman October 5, 2020 08:31
@ycd
Copy link
Contributor Author

ycd commented Oct 5, 2020

We already have such a logic here in place:

if not sys.platform == "win32":
st = os.stat(driver_executable)
if st.st_mode & stat.S_IEXEC == 0:
os.chmod(driver_executable, st.st_mode | stat.S_IEXEC)

Hmmm, that's interesting, it's raising the error before reaching the main. After doing chmod +x i saw the message.

Run "python -m playwright install" to complete installation

@pavelfeldman
Copy link
Member

Your change looks good, but you should remove the os.chmod(driver_executable, st.st_mode | stat.S_IEXEC) part since it becomes redundant.

@ycd
Copy link
Contributor Author

ycd commented Oct 6, 2020

Thanks for review @pavelfeldman, I removed that part now.

@pavelfeldman pavelfeldman dismissed mxschmitt’s stale review October 6, 2020 14:38

Looks like it is done.

@pavelfeldman pavelfeldman merged commit d1b6a1b into microsoft:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running playwright raises PermissionError on Linux
3 participants