mx.DateTime, win32, python 2.1 troubles

Jim Abrams jim at publishingresources.com
Wed Apr 25 14:59:50 EDT 2001


After installing ActivePython 2.1 my mxDateTime package broke.
This look familiar?

Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
ImportError: Module use of python20.dll conflicts with this version of 
Python.


So I go get the new version of DateTime. mx.DateTime
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "d:\python21\mx\DateTime\__init__.py", line 8, in ?
    from DateTime import *
  File "d:\python21\mx\DateTime\DateTime.py", line 158, in ?
    gmt = utc
NameError: name 'utc' is not defined

After some investigation turns out to be the mxDateTime.pyd file wasn't 
importing because of the version difference. But why was I getting the utc 
NameError?

That's when I notice this little bit of magic:

try:
    from mxDateTime import *
    from mxDateTime import __version__
except:
    from mxDateTime_Python import *
    from mxDateTime_Python import __version__

Wow I say, a completely pythonic version, this is great.
Except no utc is defined in there. 

Uhh, help? I must of went wrong somewhere if 2.1 is working with mx.DateTime 
for others.
What it utc supposed to be?
Whoever compiles mxDateTime.pyd think we can get a 2.1 version?

Thanks,





More information about the Python-list mailing list