Skip to content

SHGetFolderPathW is deprecated #348

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

Open
Jayman2000 opened this issue Apr 13, 2025 · 1 comment · May be fixed by #350
Open

SHGetFolderPathW is deprecated #348

Jayman2000 opened this issue Apr 13, 2025 · 1 comment · May be fixed by #350

Comments

@Jayman2000
Copy link

I noticed that the get_win_folder_via_ctypes function calls SHGetFolderPathW. The offical documentation for SHGetFolderPathW says:

Note As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderPath. The CSIDL value is translated to its associated KNOWNFOLDERID and then SHGetKnownFolderPath is called. New applications should use the known folder system rather than the older CSIDL system, which is supported only for backward compatibility.

It probably doesn’t matter that much, but it would be nice if platformdirs used the newer SHGetKnownFolderPath function instead of the older deprecated SHGetFolderPathW function.

@gaborbernat
Copy link
Member

PR welcome 🙏

Jayman2000 added a commit to Jayman2000/platformdirs-pr that referenced this issue Apr 17, 2025
The official documentation for `SHGetFolderPathW()` says:

> Note  As of Windows Vista, this function is merely a wrapper for
> SHGetKnownFolderPath. The CSIDL value is translated to its associated
> KNOWNFOLDERID and then SHGetKnownFolderPath is called. New
> applications should use the known folder system rather than the older
> CSIDL system, which is supported only for backward compatibility.

Source:
<https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw>

This change makes it so that platformdirs uses `SHGetKnownFolderPath()`
instead of `SHGetFolderPathW()`. This change also removes references to
the old CSIDL system and replaces them with references wo the FOLDERID
system.

Closes tox-dev#348.
Jayman2000 added a commit to Jayman2000/platformdirs-pr that referenced this issue Apr 18, 2025
The official documentation for `SHGetFolderPathW()` says:

> Note  As of Windows Vista, this function is merely a wrapper for
> SHGetKnownFolderPath. The CSIDL value is translated to its associated
> KNOWNFOLDERID and then SHGetKnownFolderPath is called. New
> applications should use the known folder system rather than the older
> CSIDL system, which is supported only for backward compatibility.

Source:
<https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw>

This change makes it so that platformdirs uses `SHGetKnownFolderPath()`
instead of `SHGetFolderPathW()`. This change also removes references to
the old CSIDL system and replaces them with references wo the FOLDERID
system.

Closes tox-dev#348.

TODO: Test in CI before submitting.
Jayman2000 added a commit to Jayman2000/platformdirs-pr that referenced this issue Apr 18, 2025
The official documentation for `SHGetFolderPathW()` says:

> Note  As of Windows Vista, this function is merely a wrapper for
> SHGetKnownFolderPath. The CSIDL value is translated to its associated
> KNOWNFOLDERID and then SHGetKnownFolderPath is called. New
> applications should use the known folder system rather than the older
> CSIDL system, which is supported only for backward compatibility.

Source:
<https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw>

This change makes it so that platformdirs uses `SHGetKnownFolderPath()`
instead of `SHGetFolderPathW()`. This change also removes references to
the old CSIDL system and replaces them with references wo the FOLDERID
system.

Closes tox-dev#348.
Jayman2000 added a commit to Jayman2000/platformdirs-pr that referenced this issue Apr 19, 2025
The official documentation for `SHGetFolderPathW()` says:

> Note  As of Windows Vista, this function is merely a wrapper for
> SHGetKnownFolderPath. The CSIDL value is translated to its associated
> KNOWNFOLDERID and then SHGetKnownFolderPath is called. New
> applications should use the known folder system rather than the older
> CSIDL system, which is supported only for backward compatibility.

Source:
<https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw>

This change makes it so that platformdirs uses `SHGetKnownFolderPath()`
instead of `SHGetFolderPathW()`. This change also removes references to
the old CSIDL system and replaces them with references wo the FOLDERID
system.

Closes tox-dev#348.

TODO:
• Run in GitHub CI.
Jayman2000 added a commit to Jayman2000/platformdirs-pr that referenced this issue Apr 19, 2025
The official documentation for `SHGetFolderPathW()` says:

> Note  As of Windows Vista, this function is merely a wrapper for
> SHGetKnownFolderPath. The CSIDL value is translated to its associated
> KNOWNFOLDERID and then SHGetKnownFolderPath is called. New
> applications should use the known folder system rather than the older
> CSIDL system, which is supported only for backward compatibility.

Source:
<https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw>

This change makes it so that platformdirs uses `SHGetKnownFolderPath()`
instead of `SHGetFolderPathW()`. This change also removes references to
the old CSIDL system and replaces them with references wo the FOLDERID
system.

Closes tox-dev#348.
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

Successfully merging a pull request may close this issue.

2 participants