Menu

#137 pythoncom.MakeTime() should take parameters of type long

open
nobody
com (105)
5
2004-08-05
2004-08-05
No

pythoncom.MakeTime() takes only ints and so cannot
make a time later than MakeTime(sys.maxint), which is
2038-01-19 04:14:07. This is a problem when I am
talking to a COM object that is expecting a date, and
the date is the maturity of a 50-year interest swap.

>>> pythoncom.MakeTime(sys.maxint)
<PyTime:2038-01-19 04:14:07>
>>> pythoncom.MakeTime(sys.maxint+1)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
OverflowError: long int too large to convert to int

It appears that pythonwin.client's marshalling process
suppresses this error and substitutes
pythoncom.MakeTime(0).

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.