mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.41k stars 435 forks source link

Windows Store Python causes crash on start #2293

Open tonybaloney opened 2 years ago

tonybaloney commented 2 years ago

What were you trying to do?

Launch from a virtual environment

What steps did you take to trigger the issue?

  1. Install Python 3.8 from the Windows store
  2. Create a virtual environment
  3. Start mu

mu.config.DATA_DIR will be C:\Users\<user>\AppData\Local\python\mu

But, this an app execution alias, so the path is actually something like:

C:\\Users\\<user>\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\Local\\python\\mu\\

This only causes an issue when launching a subprocess, like when mu will create virtual environments, because Windows cannot apply the alias redirect to the subprocess.

Operating System Version

Windows 11

Mu Version

main (1.1.1)

Other Info

No response

Editor Log

No response

tonybaloney commented 2 years ago

Related: https://github.com/platformdirs/platformdirs/issues/90

Jeffrey04 commented 2 years ago

I also needed to do this to get mu-editor running with windows store python (apart from applying the patch) https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later