Author zseil
Recipients
Date 2006-06-26.22:52:27
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1326842

I see the same behaviour with the official Python 2.5
beta 1 Windows installer. The interesting thing is that
the expatreader module is present in sys.modules:

Python 2.5b1 (r25b1:47027, Jun 20 2006, 09:31:33)
[MSC v.1310 32 bit (Intel)] on win32
...
>>> import xml.sax.expatreader
>>> xml.sax.expatreader
Traceback (most recent call last):
  ...
AttributeError: 'module' object has no attribute 'expatreader'
>>> import sys
>>> sys.modules['xml.sax.expatreader']
<module 'xml.sax.expatreader' from
'...\lib\xmlcore\sax\expatreader.pyc'>

All of the other modules in xml package can be imported
without any trouble.
I don't understand what is the real problem here,
but it goes away if you import xmlcore.sax package
before expatreader:

[restart python]
>>> import xmlcore.sax
>>> import xml.sax.expatreader
>>> xml.sax.expatreader
<module 'xml.sax.expatreader' from
'...\lib\xmlcore\sax\expatreader.pyc'>

The simplest fix would be to use at least one absolute
import in ...\lib\xmlcore\sax\__init__.py, for example
you could change line 22:

from xmlreader import InputSource

to:

from xmlcore.sax.xmlreader import InputSource

but that might just hide the real bug.
History
Date User Action Args
2007-08-23 14:40:46adminlinkissue1511497 messages
2007-08-23 14:40:46admincreate