Skip to content
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

Permission problem when streamlit is running from url #301

Closed
monchier opened this issue Oct 7, 2019 · 3 comments
Closed

Permission problem when streamlit is running from url #301

monchier opened this issue Oct 7, 2019 · 3 comments
Assignees
Labels
type:bug Something isn't working

Comments

@monchier
Copy link
Collaborator

monchier commented Oct 7, 2019

Summary

Permission problem when streamlit is running from url. This happens on Windows. Likely an issue with the permission of the system temporary folder. The stacktrace shows the EventBasedFileWatcher, so it may be related to this codepath.

Steps to reproduce

The bug still needs a formal repro.

streamlit run https://raw.githubusercontent.com/streamlit/demo-self-driving/master/app.py```

Discourse: https://discuss.streamlit.io/t/permission-errors-when-running-demo-self-driving/246

Expected behavior:

No exception raised

Actual behavior:

Permission denied exception raised as per Discourse.

Is this a regression?

no

Debug info

  • Streamlit version: post launch
  • Python version: not sure
  • Using Conda? PipEnv? PyEnv? Pex? not sure
  • OS version: Windows
  • Browser version: not sure

Additional information

If needed, add any other context about the problem here.

@monchier monchier added the type:bug Something isn't working label Oct 7, 2019
@jth-027
Copy link

jth-027 commented Oct 7, 2019

Python Version was 3.7
Yes, using Anaconda
Browser Version = Chrome Version 77.0.3865.90 (Official Build) (64-bit)
OS = Windows 10 Pro

@monchier
Copy link
Collaborator Author

monchier commented Oct 8, 2019

Another configuration where this bug repros:
Windows version: 10.0.17763 Build 17763.

@monchier
Copy link
Collaborator Author

monchier commented Oct 21, 2019

I am debugging this and does not seem a permission issue. When we run from url we download to a temp file and we use:

with tempfile.NamedTemporaryFile(delete=True) as fp:
  execute(fp)

NamedTemporaryFile is supposed to delete the temp file when the resource manager exits, but it seems there is an open issue with Windows related to this use of NamedTemporaryFile:

you can't actually open a file opened by NamedTemporaryFile with delete=True (the default) until the NamedTemporaryFile is closed

Pulling from https://stackoverflow.com/a/49868505

... planning a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants