[egenix-users] mx.DateTime.DateTimeDelta.pytimedelta() segfaults

M.-A. Lemburg mal at egenix.com
Sun Nov 25 20:50:14 CET 2012

On 25.11.2012 20:40, M.-A. Lemburg wrote:
> Hi Joel,
> thanks for reporting the bug. We are able to reproduce this on our
> systems, so will investigate and then get back to you.

Turns out this is caused by the lazy import of the datetime module
we're using in mxDateTime. The .pytimedelta() method doesn't make
sure the module is already loaded.

Here's a quick work-around:

# Force import and setup of the datetime module in mxDateTime
from mx.DateTime import Date

This only has to be done once in the application (but should of
course happen automatically in mxDateTime).

After the call to .pydate() the datetime module is setup and
ready to be used by mxDateTime and all subsequent calls to the
methods succeed without segfaults.

We'll release version 3.2.5 next week to address this bug.

Thanks for the report,
Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 25 2012)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the egenix-users mailing list