Skip to content

init: Windows does not have HOME environment variable; restrict old_mac_dir to MACOS - #7376

Merged
HuidaeCho merged 2 commits into
OSGeo:mainfrom
HuidaeCho:win-python-home
May 9, 2026
Merged

HuidaeCho merged 2 commits into
OSGeo:mainfrom
HuidaeCho:win-python-home

Conversation

@HuidaeCho

Copy link
Copy Markdown
Member

This PR fixes the following error on a fresh startup in Windows:

(grass) C:\Users\hcho>grass --version
-C:\Users\hcho\AppData\Roaming\GRASS8--
Traceback (most recent call last):
  File "C:\Users\hcho\opt\micromamba\envs\grass\Library\bin\\..\lib\grass85\etc\grass_main.py", line 2535, in <module>
    main()
    ~~~~^^
  File "C:\Users\hcho\opt\micromamba\envs\grass\Library\bin\\..\lib\grass85\etc\grass_main.py", line 2205, in main
    grass_config_dir = create_grass_config_dir()
  File "C:\Users\hcho\opt\micromamba\envs\grass\Library\bin\\..\lib\grass85\etc\grass_main.py", line 397, in create_grass_config_dir
    old_mac_dir = os.path.join(os.getenv("HOME"), f".grass{GRASS_VERSION_MAJOR}")
  File "<frozen ntpath>", line 100, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

Windows does not have HOME and old_mac_dir should only be evaluated for MACOS.

@github-actions github-actions Bot added Python Related code is in Python libraries labels May 9, 2026
Comment thread lib/init/grass.py Resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@HuidaeCho HuidaeCho changed the title Windows does not have HOME environment variable; restrict old_mac_dir to MACOS init: Windows does not have HOME environment variable; restrict old_mac_dir to MACOS May 9, 2026
@nilason nilason added the backport to 8.5 PR needs to be backported to release branch 8.5 label May 9, 2026
@nilason nilason added this to the 8.5.1 milestone May 9, 2026
@HuidaeCho
HuidaeCho merged commit 79e94e7 into OSGeo:main May 9, 2026
26 of 27 checks passed
@HuidaeCho
HuidaeCho deleted the win-python-home branch May 9, 2026 11:57
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Jul 7, 2026
…ac_dir to MACOS (OSGeo#7376)

* Windows does not have HOME environment variable; restrict old_mac_dir to MACOS

* Update lib/init/grass.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
neteler pushed a commit that referenced this pull request Jul 13, 2026
…ac_dir to MACOS (#7376)

* Windows does not have HOME environment variable; restrict old_mac_dir to MACOS

* Update lib/init/grass.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@neteler neteler removed the backport to 8.5 PR needs to be backported to release branch 8.5 label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants