Skip to content
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

OSError: [Errno 22] Invalid argument on call to pywintypes.Time(0) #592

Colin-b opened this issue Dec 5, 2016 · 1 comment


Copy link

Colin-b commented Dec 5, 2016


The following line within is failing with Python 3.6.
time_types = (, dt.datetime, type(pywintypes.Time(0)))

Here is the issue:

Python 3.6.0b4 (default, Nov 22 2016, 05:30:12) [MSC v.1900 64 bit (AMD64)] on win32

import pywintypes


<class 'pywintypes.datetime'>


Traceback (most recent call last):
File "", line 1, in
OSError: [Errno 22] Invalid argument

I am not sure what to do here exactly, the comment before this line of code is saying the following:

Time types: pywintypes.timetype doesn't work on Python 3

Is it a known issue?
If so should we use pywintypes.TimeType instead?
Only for Python3?
Or only in case of failure?

Anyway this issue is preventing to use xlwings on my setup with Python 3.6

Best Regards

@fzumstein fzumstein added the bug label Dec 6, 2016
fzumstein added a commit that referenced this issue Dec 6, 2016
Copy link

pywintypes.TimeType seems indeed to be the correct solution, I fixed it on develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants