You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows Store Python redirects calls to user system directories. The redirected directory names are quite long and may reach the Windows path size limit.
It also creates confusion where directory paths in config don't match with real life
importosimportsysimporttempfilefromfunctoolsimportlru_cacheimportplatformdirs# The default directory for application data (i.e., configuration).DATA_DIR=platformdirs.user_data_dir(appname="mu", appauthor="python")
@lru_cache()defget_data_dir():
path=platformdirs.user_data_dir(appname="mu", appauthor="python")
ifsys.platform=="win32":
# Locate the actual path for Windows by making a temporary file# then resolving the real path. Solves a bug in the Windows store# distribution of Python 3.8+# See https://github.com/mu-editor/mu/issues/2293os.makedirs(path, exist_ok=True)
fd, tmp=tempfile.mkstemp(dir=path)
realpath=os.path.dirname(os.path.realpath(tmp))
os.close(fd)
os.remove(tmp)
returnrealpathelse:
returnpath
The caveat here is we really want to let any redirections happen when using Python over Wine. So we can't naively use the proposal above directly.
I have no idea if this is a bug or enhancement, but it's a problem.
The text was updated successfully, but these errors were encountered:
Windows Store Python redirects calls to user system directories. The redirected directory names are quite long and may reach the Windows path size limit.
It also creates confusion where directory paths in config don't match with real life
Interesting code from https://github.com/mu-editor/mu/pull/2292/files
The caveat here is we really want to let any redirections happen when using Python over Wine. So we can't naively use the proposal above directly.
I have no idea if this is a bug or enhancement, but it's a problem.
The text was updated successfully, but these errors were encountered: