[python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps()

陈智宏 zhihong.chen.cn at gmail.com
Tue Nov 22 11:56:00 CET 2011


Dear Sriram,

Pythonwin has internal standard one to process win32time.

I have found the solution on
http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954

In fact, there is crapy code in Pytime.cpp which supports OLD version of
Python timezone processing.

But for new version of Python, standard one is perfect.

There is backports for 2.7 from 3.x. For me , I use 3.2.2 and test the
solution. It's OK.

Just make sure that in *win32/src/PyWinTypes.h *
*
*
*NO_PYWINTYPES_TIME,**PYWIN_HAVE_DATETIME_CAPI BOTH are not defined.*
*
*
*you need to changed my code **#if (PY_VERSION_HEX < 0x03000000) to **#if
(PY_VERSION_HEX < 0x02000000)*
*
*
This issues is caused by old version compatibility. In pythonwin, there is
already implemented new one. But there is incorrect define in Headers.
*
*
I guest this solution will be ok for you as well.

On Tue, Nov 22, 2011 at 6:27 PM, Sriram ET. <karra.etc at gmail.com> wrote:

>
> Zhihong, I am not familiar with the internals enough to confirm if the
> issue you are pointing out and the problem in my original email are the
> same. I am using Python 2.7 on windows 32 bit. Can you explain why you feel
> the two issues are the same?
>
> -Sriram
>
> On Tue, Nov 22, 2011 at 8:36 AM, 陈智宏 <zhihong.chen.cn at gmail.com> wrote:
>
>>
>> http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954
>>
>> It seems that it's the same issue.
>>
>> Python3 broken filetime processing for python win32.
>>
>> On Mon, Nov 21, 2011 at 7:00 PM, <python-win32-request at python.org> wrote:
>>
>>> Send python-win32 mailing list submissions to
>>>        python-win32 at python.org
>>>
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>        http://mail.python.org/mailman/listinfo/python-win32
>>> or, via email, send a message with subject or body 'help' to
>>>        python-win32-request at python.org
>>>
>>> You can reach the person managing the list at
>>>        python-win32-owner at python.org
>>>
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of python-win32 digest..."
>>>
>>>
>>> Today's Topics:
>>>
>>>   1. Setting a 64bit FILETIME PT_SYSTIME property using        pywin32's
>>>      SetProps() (Sriram ET.)
>>>
>>>
>>> ----------------------------------------------------------------------
>>>
>>> Message: 1
>>> Date: Mon, 21 Nov 2011 12:33:43 +0530
>>> From: "Sriram ET." <karra.etc at gmail.com>
>>> To: python-win32 at mail.python.org
>>> Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property
>>>        using   pywin32's SetProps()
>>> Message-ID:
>>>        <CAFkt3UNXCjwipCxt_Zk2RCSk+JjhVxEqTcXjr3B-XQ7rJu=
>>> wWQ at mail.gmail.com>
>>> Content-Type: text/plain; charset="iso-8859-1"
>>>
>>> I am using pywin32 mapi routines to interact with my outlook contacts
>>> store. I am trying to set the PT_BIRTHDAY property and have the following
>>> code for doing that:
>>>
>>> The conversion from and to FILETIME values is from filetimes.py available
>>> at:http://reliablybroken.com/b/wp-content/filetimes.py
>>>
>>>    dt = datetime.strptime('1980-01-01','%Y-%m-%d')
>>>    filetime = filetimes.dt_to_filetime(dt)
>>>    msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)])
>>>
>>> I get an OverflowError: Python int too large to convert to c long
>>>
>>> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I
>>> am
>>> at a loss. How can I set the underlying MAPI property using this library?
>>> Is there a workaround?
>>>
>>> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via
>>> VMWare Fusion 4 on Mac OS X Lion)
>>>
>>> Thanks!
>>> -------------- next part --------------
>>> An HTML attachment was scrubbed...
>>> URL: <
>>> http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html
>>> >
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> python-win32 mailing list
>>> python-win32 at python.org
>>> http://mail.python.org/mailman/listinfo/python-win32
>>>
>>>
>>> End of python-win32 Digest, Vol 104, Issue 14
>>> *********************************************
>>>
>>
>>
>> _______________________________________________
>> python-win32 mailing list
>> python-win32 at python.org
>> http://mail.python.org/mailman/listinfo/python-win32
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20111122/c5c29fb2/attachment.html>


More information about the python-win32 mailing list