This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients amaury.forgeotdarc, belopolsky, benjamin.peterson, christian.heimes, dmi.baranov, ezio.melotti, jaraco, meador.inge, techtonik
Date 2013-08-22.21:39:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The first thing it helps is that it eliminates a ValueError on import. Without it, code must catch both ValueError and ImportError to run portably:

import ctypes

  import ctypes.wintypes
except ImportError, ValueError:
  # catch ImportError and ValueError due to issue16396


def code_that_runs_only_on_win():

One _could_ cause ctypes.wintypes to always raise an ImportError on non-Windows systems, allowing the import routine to be simpler:

  import ctypes.wintypes
except ImportError:

But it would be even nicer if ctypes.wintypes always imported on any platform, such that the statement could be simply:

import ctypes.wintypes

But it's conceivable that certain functionality in wintypes might be useful on other systems. Consider, for example, a routine that works with pickles produced on a Windows system, or simply a comparison of some object in ctypes.wintypes against a value produced on a Windows system.

The argument for that need (esp. on Python 2.7) is not strong, but since the patch to address the ValueError is simple, straightforward, and perhaps even simpler than something that would address the ValueError specifically, it seems worthwhile to accept the patch.
Date User Action Args
2013-08-22 21:39:03jaracosetrecipients: + jaraco, amaury.forgeotdarc, belopolsky, techtonik, christian.heimes, benjamin.peterson, ezio.melotti, meador.inge, dmi.baranov
2013-08-22 21:39:03jaracosetmessageid: <>
2013-08-22 21:39:03jaracolinkissue16396 messages
2013-08-22 21:39:03jaracocreate