Menu

#160 Implement millisecond resolution for objects Win32 objects to Python Objects

Unstable (example)
closed-wont-fix
None
5
2017-01-05
2016-01-23
No

Win32 VariantTimeToSystemTime function has a known issue that it doesn't output the msec information even though the object may have it specified.

Attached is the implementation from the original bug report 387 with the proposed patch to obtain the msec resolution.

1 Attachments

Discussion

  • Mark Hammond

    Mark Hammond - 2016-04-16
    • status: pending --> closed-wont-fix
     
  • Mark Hammond

    Mark Hammond - 2016-04-16

    I don't think I can take any of these patches. Getting non-zero ms does sound good, but the first patch does:

    else if ( !strcmp(name, "msec") )
    {
    
    • return PyInt_FromLong(st.wMilliseconds);
    • double seconds = This->m_time;
    • size_t milliseconds = int((seconds - int(seconds)) * 1000);
    • return PyFloat_FromDouble(seconds*10);

    which seems wrong - milliseconds is calculated but never used, and we return seconds * 10 - which I don't understand how could be the ms.

    The second patch changes whitespace unnecessarily and not always in ways I agree with (eg, I prefer the "case" statements to be indented from their "switch") - but in general, simple stylistic whitespace changes just create "blame" noise and offer no real benefit.

    The third and fourth patch runs the risk of changing the semantics of the time objects for Python 2.x users - I explicitly decided not to do that when working on py3k - it's important we don't break 2.x users (I've no problem with breaking python 2.4 support, but not in changing the datetime semantics for 2.7 users)

    I don't understand the 5th patch at all - isn't that going to completely change the returned object sematics (ie, the object will no longer be using utc)?

    I'd be happy to take a new patch that solves "ms is always zero" though.

     
  • Victor Uriarte

    Victor Uriarte - 2017-01-05

    Sorry for that, it was my first time trying to contribute on an open source project and still had alot to learn about it :)
    I'll try again for the "ms is always zero" only though.

     

Log in to post a comment.