Eryk Sun added the comment: Are people actually using this script? Maybe it should simply be removed. I see a few problems with it [1]:
* A default value of "%PATH%" is wrong. That causes the system PATH to be concatenated with itself. * For the user scripts directory, replacing appdata with "%APPDATA%" causes os.path.isdir to always fail. * REG_EXPAND_SZ should only be used when '%' occurs 2 or more times. Otherwise use REG_SZ. An existing REG_SZ type should be preserved, if the value doesn't have two or more '%' characters, because the user may be reusing PATH in a REG_EXPAND_SZ variable. (The environment gets created in 2 passes -- actually 4 passes if we consider that system values are loaded before user values. REG_SZ values get loaded first, and then REG_EXPAND_SZ values are loaded and expanded. The latter may depend on REG_SZ values, and also system values in the user case, but should never depend on other REG_EXPAND_SZ values since the enumeration order of the registry key is undefined. In practice a key is enumerated in definition order, not the alphabetic order displayed in regedit.) * It doesn't broadcast a WM_SETTINGCHANGE message, so it needlessly forces the user to log off and back on in order to use the modified PATH. [1]: https://mail.python.org/pipermail/python-list/2016-February/703344.html ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30374> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com