Repository navigation
codespell fails to run on linux with version 2.3.0 #3545
Description
Activity
DimitriPapadopoulos commented
on Sep 18, 2024 CollaboratorMore actionsIt works for me:
$ python Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> from ctypes import wintypes >>>
Could it be an issue with this specific deployment of Python? How did you install Python?
Where is it documented that you cannot import
wintypesfrom Linux? Thectypesdocumentation merely states:The
ctypes.wintypesmodule provides quite some other Windows specific data types, for exampleHWND,WPARAM, orDWORD. Some useful structures likeMSGorRECTare also defined.- changed the title
[-]codespellfails to run on linux with version 2.3.0[/-][+]codespell fails to run on linux with version 2.3.0[/+]on Sep 18, 2024 DimitriPapadopoulos commented
on Sep 18, 2024 on Sep 18, 2024 · Hidden as outdatedshow commentMore actionsDimitriPapadopoulos commented
on Sep 18, 2024 CollaboratorMore actionsThe patch to allow wintypes to be imported on non-Windows systems is relatively recent:
python/cpython#60600
python/cpython#21394It has been applied to Python branches 3.8 and 3.9, which means it might be missing from Python 3.9.0. But then why use Python 3.9.0 instead of 3.9.20?
DimitriPapadopoulos commented
on Sep 18, 2024 CollaboratorMore actionsDoes #3546 help in your case?
The patch to allow wintypes to be imported on non-Windows systems is relatively recent: python/cpython#60600 python/cpython#21394
It has been applied to Python branches 3.8 and 3.9, which means it might be missing from Python 3.9.0. But then why use Python 3.9.0 instead of 3.9.20?
Thank you, I didn't notice that github actions was using 3.9.0 instead of the latest version of 3.9.x. That was due to an error in how I defined the python version. You are correct, using the latest 3.9.x version works fine.
Does #3546 help in your case?
I can try this out later today if you think it's still relevant
DimitriPapadopoulos commented
on Sep 18, 2024 CollaboratorMore actionsIt's still relevant, if only to avoid importing
ctypes.wintypeswhen it's not needed, on non-Windows platforms.Does #3546 help in your case?
Confirmed when I use python 3.9.0, it runs as expected.
Reacted by Dimitri Papadopoulos Orfanos
I recently upgraded my pre-commit hook version from 2.2.6 -> 2.3.0 and get a
ValueErrorwhen running:This error looks reasonable as you can't import
wintypeson linux:It looks like this was introduced when adding support for ANSI colors on windows: #3259