Bunch Of `PyIID` Missing From `win32com.shell.shell` In 309

by ADMIN 60 views

Introduction

The win32com.shell.shell module in the pywin32 library has been found to be missing a bunch of PyIID names in the latest release, version 309. This issue has been identified by the stubtest tool when updating the typeshed stubs. In this article, we will delve into the details of this issue, explore the potential solutions, and provide a step-by-step guide to reproduce the problem.

Expected Behavior and Actual Behavior

The win32com.shell.shell module is expected to have a complete set of PyIID names, including CLSID_ApplicationDestinations, CLSID_ApplicationDocumentLists, CLSID_DestinationList, and many others. However, upon closer inspection, it was found that these names are missing from the module. The full list of missing names can be seen below:

win32com.shell.shell.CLSID_ApplicationDestinations
win32com.shell.shell.CLSID_ApplicationDocumentLists
win32com.shell.shell.CLSID_DestinationList
win32com.shell.shell.CLSID_EnumerableObjectCollection
win32com.shell.shell.CLSID_ShellLibrary
win32com.shell.shell.FOLDERID_DeviceMetadataStore
win32com.shell.shell.FOLDERID_DocumentsLibrary
win32com.shell.shell.FOLDERID_HomeGroup
win32com.shell.shell.FOLDERID_ImplicitAppShortcuts
win32com.shell.shell.FOLDERID_Libraries
win32com.shell.shell.FOLDERID_MusicLibrary
win32com.shell.shell.FOLDERID_PicturesLibrary
win32com.shell.shell.FOLDERID_PublicLibraries
win32com.shell.shell.FOLDERID_PublicRingtones
win32com.shell.shell.FOLDERID_RecordedTVLibrary
win32com.shell.shell.FOLDERID_Ringtones
win32com.shell.shell.FOLDERID_UserPinned
win32com.shell.shell.FOLDERID_UserProgramFiles
win32com.shell.shell.FOLDERID_UserProgramFilesCommon
win32com.shell.shell.FOLDERID_UsersLibraries
win32com.shell.shell.FOLDERID_VideosLibrary
win32com.shell.shell.FOLDERTYPEID_Communications
win32com.shell.shell.FOLDERTYPEID_Generic
win32com.shell.shell.FOLDERTYPEID_GenericLibrary
win32com.shell.shell.FOLDERTYPEID_GenericSearchResults
win32com.shell.shell.FOLDERTYPEID_Music
win32com.shell.shell.FOLDERTYPEID_OpenSearch
win32com.shell.shell.FOLDERTYPEID_OtherUsers
win32com.shell.shell.FOLDERTYPEID_PublishedItems
win32com.shell.shell.FOLDERTYPEID_RecordedTV
win32com.shell.shell.FOLDERTYPEID_SavedGames
win32com.shell.shell.FOLDERTYPEID_SearchConnector
win32com.shell.shell.FOLDERTYPEID_SearchHome
win32com.shell.shell.FOLDERTYPEID_Searches
win32com.shell.shell.FOLDERTYPEID_StartMenu
win32com.shell.shell.FOLDERTYPEID_UsersLibraries
win32com.shell.shell.FOLDERTYPEID_Videos
win32com.shell.shell.IID_IApplicationDestinations
win32com.shell.shell.IID_IApplicationDocumentLists
win32com.shell.shell.IID_ICustomDestinationList
win32com.shell.shell.IID_IEnumObjects
win32com.shell.shell.IID_IObjectArray
win32com.shell.shell.IID_IObjectCollection
win32com.shell.shell.IID_IShellLibrary

Potential Solutions

There are two potential solutions to this issue:

  1. Remove the condition: If the missing names do not actually need to be conditional, it may be possible to remove the condition and add the names to the module.
  2. Drop Vista support: Another solution is to drop support for Vista and Windows Server 2008, which would make the conditionals redundant.

Steps to Reproduce the Problem

To reproduce the problem, follow these steps:

  1. Install the latest version of pywin32: Install the latest version of pywin32, which is version 309.
  2. Import the missing names: Try to import the missing names from the win32com.shell.shell module.
  3. Observe the error: Observe the error message, which should indicate that the names are missing from the module.

System Information

The system information for this issue is as follows:

  • Python version and distribution: CPython 3.13
  • pywin32 version: 309
  • Windows Version: Version 10.0.19045 Build 19045
  • DLL locations: N/A

Conclusion

Q: What are the missing PyIID names in win32com.shell.shell?

A: The missing PyIID names in win32com.shell.shell are a list of names that are not present in the module, including CLSID_ApplicationDestinations, CLSID_ApplicationDocumentLists, CLSID_DestinationList, and many others.

Q: Why are the missing PyIID names not present in win32com.shell.shell?

A: The missing PyIID names are not present in win32com.shell.shell because they are locked behind a #if WINVER >= 0x0601 directive, which is defined in sdkddkver.h. This directive is used to conditionally include code that is only available on Windows Vista and later versions.

Q: What is the impact of the missing PyIID names on users?

A: The missing PyIID names can cause errors when users try to import them from the win32com.shell.shell module. This can lead to issues with code that relies on these names, and may require users to modify their code to work around the missing names.

Q: What are the potential solutions to the missing PyIID names issue?

A: There are two potential solutions to the missing PyIID names issue:

  1. Remove the condition: If the missing names do not actually need to be conditional, it may be possible to remove the condition and add the names to the module.
  2. Drop Vista support: Another solution is to drop support for Vista and Windows Server 2008, which would make the conditionals redundant.

Q: How can I reproduce the missing PyIID names issue?

A: To reproduce the missing PyIID names issue, follow these steps:

  1. Install the latest version of pywin32: Install the latest version of pywin32, which is version 309.
  2. Import the missing names: Try to import the missing names from the win32com.shell.shell module.
  3. Observe the error: Observe the error message, which should indicate that the names are missing from the module.

Q: What system information is required to reproduce the missing PyIID names issue?

A: The system information required to reproduce the missing PyIID names issue is as follows:

  • Python version and distribution: CPython 3.13
  • pywin32 version: 309
  • Windows Version: Version 10.0.19045 Build 19045
  • DLL locations: N/A

Q: How can I get help with the missing PyIID names issue?

A: If you are experiencing issues with the missing PyIID names, you can try the following:

  • Check the pywin32 documentation: Check the pywin32 documentation to see if there are any known issues or workarounds for the missing PyIID names.
  • Search online forums: Search online forums, such as Stack Overflow, to see if other users have experienced similar issues.
  • Contact the pywin32 developers: Contact the pywin32 developers directly to report the issue and ask for help.

Q: What is the status of the missing PyIID names issue?

A: The status of the missing PyIID names issue is currently under investigation by the pywin32 developers. A fix for the issue is being worked on, but no timeline has been provided for when the fix will be available.