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

Unable to run when there is a logging.py in the directory Orange is launched in #6769

Closed
zactionn opened this issue Mar 21, 2024 · 3 comments
Assignees
Labels
bug report Bug is reported by user, not yet confirmed by the core team

Comments

@zactionn
Copy link

Similar issue to jupyter/notebook#4892

@zactionn zactionn added the bug report Bug is reported by user, not yet confirmed by the core team label Mar 21, 2024
@janezd janezd self-assigned this Mar 22, 2024
@janezd
Copy link
Contributor

janezd commented Mar 22, 2024

Per https://docs.python.org/3/library/sys_path_init.html, the first directory in sys.path is the current directory (when started with -m, otherwise the directory of the current script). It would seem safe to remove it, e.g. by putting del sys.path[0] in __main__.

I tried and it doesn't seem to cause any problems. Does anybody, in particular @ales-erjavec, see any problem?

@ales-erjavec
Copy link
Contributor

ales-erjavec commented Mar 22, 2024

In Python 3.11 there is a python -P | PYTHONSAFEPATH=1 python option which does not add those path entries. So the delete cannot be unconditional.

Also this would need to be in Orange/__init__.py before anything else is imported.

@ales-erjavec
Copy link
Contributor

I think the only thing that should be done is use the python -P | PYTHONSAFEPATH=1 python in all of the application startup scripts/shortcuts like in biolab/orange3-installers#52

@janezd janezd closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug is reported by user, not yet confirmed by the core team
Projects
None yet
Development

No branches or pull requests

3 participants