Thanks to visit codestin.com
Credit goes to github.com

Skip to content

winpython.ini is overwhelmed by long path and settings cannot be read. #1038

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

Closed
slowglow opened this issue Dec 1, 2021 · 6 comments
Closed

Comments

@slowglow
Copy link

slowglow commented Dec 1, 2021

Hi!

Thanks for WinPy!

I noticed that adding too many paths in winpython.ini makes it unusable and settings cannot be read.

Environment:
OS: Windows 10,
WinPython: WinPy64-3890

To reproduce, try to add the lines below to your winpython.ini:

#LONG_PATH_ADD1=QWERTY\UIOP\ASDFGHJKL\ZXCVBNM\qwerty\uiop\asdfghjkl\zxcvbnm
#LONG_PATH_ADD2=123QWERTY\UIOP\ASDFGHJKL\ZXCVBNM\qwerty\uiop\asdfghjkl\zxcvbnm
#PATH=%PATH%;LONG_PATH_ADD1
#PATH=%PATH%;LONG_PATH_ADD2
ZZ_PATH_CHK = %HOME%local_pkgs

Then start WinPython Command Prompt.exe and at the command prompt type set.
This should output all of the environment variables, which are set.
ZZ_PATH_CHK should appear near the bottom of the screen.
Uncomment the commented out lines and repeat.
Depending on the length of your OS PATH variable, now you will likely not see ZZ_PATH_CHK, i.e.
it cannot be set, if the PATH is too long.
If you still see it, try adding a few more lines to make a longer PATH.

On my machine, it seems that the limit of PATH length before breaking down of winpython.ini is somewhere about 1780 characters.
I haven't investigated the exact number, but that is less than the number of 2048, given in some online forums: Path environment variable - which is otherwise limited to 2048 characters (while a single path has an historical limit of 206 characters)

I resolved this by removing from my OS path of some software, which I don't often use. But there must be some more elegant solution.

Is there anything that can be done?

@slowglow slowglow changed the title winpython.ini is overwhelmed by long path winpython.ini is overwhelmed by long path and settings cannot be read. Dec 1, 2021
@stonebig
Copy link
Contributor

stonebig commented Dec 1, 2021

Hum, well the path to mingwpy and r may be removed, maybe the path to julia

@slowglow
Copy link
Author

slowglow commented Dec 2, 2021

Yes, please. They should be selectable by people who use them.
Still, that won't solve the problem for people with a lot of software installed on their machines, because each one wants to have its stuff added to the OS PATH.

May I suggest these steps:

  1. Confirm the issue
  2. Clarify where it fails and the limits of the path
  3. Countermeasures, e.g. removing some unneeded parts of PATH for the duration of the Python session. This can be added as a new section at the beginning of winpython.ini, which can be editted by the user.

As I understand, you have confirmed this issue. Would you look at where it fails and what places a limit on the length?

I feel this issue is important, because it makes it difficult to move WinPy installation around: on some machines (with long OS path) the winpython.ini configuration will not be read and settings such as spyder for example will not be placed in the movable folder, but in the Windows user folder instead. In my own case I rely on some external tools (e.g. Octave) called from within python, but I need them to be on a relative path from WinPy. If winpython.ini is not read, I can't use my tools, regardless of the fact that WinPython installation is perfectly synched between the machines ...

@slowglow
Copy link
Author

slowglow commented Dec 2, 2021

It could be that the OS PATH length limit is 2048, but in my case I have some relative paths with /../.. which are possibly expanded when passed to the OS. So this makes it appear that the break-down length of the PATH variable is shorter than the actual limit. Just a thought...

@stonebig
Copy link
Contributor

stonebig commented Dec 4, 2021

Winpython no longer ships with R or mingw, so I'll remove those two.

stonebig added a commit to stonebig/winpython that referenced this issue Dec 4, 2021
@stonebig
Copy link
Contributor

stonebig commented Dec 4, 2021

let see.

@stonebig stonebig mentioned this issue Dec 4, 2021
8 tasks
@stonebig
Copy link
Contributor

stonebig commented May 4, 2025

I presume it's solved, or the user has changed shop

@stonebig stonebig closed this as completed May 4, 2025
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

No branches or pull requests

2 participants