xml.dom.minidom bug ?

Discussion in 'Python' started by Sampsa Riikonen, Dec 8, 2008.

  1. Dear All,

    I am experiencing a weird problem with the
    xml.dom.minidom module:
    ----------------------------------------
    sampsa@linux-ty84:~/python> python easyxml.py
    Traceback (most recent call last):
    File "easyxml.py", line 1, in <module>
    import xml.dom.minidom
    File "/usr/lib64/python2.5/site-packages/_xmlplus/dom/__init__.py", line
    236, in <module>
    import MessageSource
    File "/usr/lib64/python2.5/site-packages/_xmlplus/dom/MessageSource.py",
    line 21, in <module>
    _ = get_translator("dom")
    File "/usr/lib64/python2.5/site-packages/_xmlplus/FtCore.py", line 54, in
    get_translator
    f = gettext.translation('4Suite', locale_dir).gettext
    File "/usr/lib64/python2.5/gettext.py", line 478, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
    File "/usr/lib64/python2.5/gettext.py", line 180, in __init__
    self._parse(fp)
    File "/usr/lib64/python2.5/gettext.py", line 264, in _parse
    unpack = struct.unpack
    AttributeError: 'module' object has no attribute 'unpack'
    -------------------

    A bug in the module?

    And the weirdest thing is that I figured out how to
    get around this problem long time ago, but now I don't
    have a clue anymore... :/

    Any help appreciated.

    Cheers,

    Sampsa
    Sampsa Riikonen, Dec 8, 2008
    #1
    1. Advertising

  2. Sampsa Riikonen schrieb:
    > Dear All,
    >
    > I am experiencing a weird problem with the
    > xml.dom.minidom module:
    > ----------------------------------------
    > sampsa@linux-ty84:~/python> python easyxml.py
    > Traceback (most recent call last):
    > File "easyxml.py", line 1, in <module>
    > import xml.dom.minidom
    > File "/usr/lib64/python2.5/site-packages/_xmlplus/dom/__init__.py", line
    > 236, in <module>
    > import MessageSource
    > File "/usr/lib64/python2.5/site-packages/_xmlplus/dom/MessageSource.py",
    > line 21, in <module>
    > _ = get_translator("dom")
    > File "/usr/lib64/python2.5/site-packages/_xmlplus/FtCore.py", line 54, in
    > get_translator
    > f = gettext.translation('4Suite', locale_dir).gettext
    > File "/usr/lib64/python2.5/gettext.py", line 478, in translation
    > t = _translations.setdefault(key, class_(open(mofile, 'rb')))
    > File "/usr/lib64/python2.5/gettext.py", line 180, in __init__
    > self._parse(fp)
    > File "/usr/lib64/python2.5/gettext.py", line 264, in _parse
    > unpack = struct.unpack
    > AttributeError: 'module' object has no attribute 'unpack'
    > -------------------
    >
    > A bug in the module?
    >
    > And the weirdest thing is that I figured out how to
    > get around this problem long time ago, but now I don't
    > have a clue anymore... :/
    >
    > Any help appreciated.


    You don't happen to have a struct.py or struct.pyc lying around? To test
    this, execute *in the same directory your above code fails!!*

    $ python
    >>> import struct
    >>> struct.__file__



    The result should be something below /usr/lib/python2.5/, if it's not -
    that's your culprit.

    Diez
    Diez B. Roggisch, Dec 8, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roman Yakovenko

    xml.dom.minidom - bug ? future ?

    Roman Yakovenko, Sep 4, 2003, in forum: Python
    Replies:
    1
    Views:
    331
    =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=
    Sep 4, 2003
  2. Greg Wogan-Browne
    Replies:
    1
    Views:
    785
    Uche Ogbuji
    Jan 28, 2005
  3. Maksim Kasimov

    is it bug or feature in xml.dom.minidom?

    Maksim Kasimov, Mar 2, 2007, in forum: Python
    Replies:
    1
    Views:
    288
    Paul Boddie
    Mar 2, 2007
  4. Replies:
    3
    Views:
    517
    Stefan Behnel
    Aug 3, 2007
  5. JYA
    Replies:
    2
    Views:
    291
    Marc Christiansen
    Apr 30, 2008
Loading...

Share This Page