[Python-modules-team] Bug#783789: python-odf: Regression - cannot open spreadsheet files.

Ying-Chun Liu (PaulLiu) paulliu at debian.org
Thu Apr 30 07:04:58 UTC 2015


Package: python-odf
Version: 1.2.0-6
Severity: normal

Dear Maintainer,

    * What led up to the situation?

Please see the attachment python code. I tried to open an ods file and get
crash. But odt/odp works good.

    * What exactly did you do (or not do) that was effective (or
      ineffective)?

Please put the two files into /tmp. Run /tmp/test01.py

    * What was the outcome of this action?

Traceback (most recent call last):
   File "./test01.py", line 10, in <module>
     odf.opendocument.load(u'test1.ods')
   File "/usr/lib/python2.7/dist-packages/odf/opendocument.py", line 
970, in load
     __loadxmlparts(z, manifest, doc, u'')
   File "/usr/lib/python2.7/dist-packages/odf/opendocument.py", line 
901, in __loadxmlparts
     parser.parse(inpsrc)
   File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
     self._parser.Parse(data, isFinal)
   File "/usr/lib/python2.7/xml/sax/expatreader.py", line 341, in 
start_element_ns
     AttributesNSImpl(newattrs, qnames))
   File "/usr/lib/python2.7/dist-packages/odf/load.py", line 78, in 
startElementNS
     e = Element(qname = tag, qattributes=attrdict, check_grammar=False)
   File "/usr/lib/python2.7/dist-packages/odf/element.py", line 318, in 
__init__
     self.setAttrNS(attr[0], attr[1], value)
   File "/usr/lib/python2.7/dist-packages/odf/element.py", line 446, in 
setAttrNS
     self.attributes[(namespace, localpart)] = c.convert((namespace, 
localpart), value, self)
   File "/usr/lib/python2.7/dist-packages/odf/attrconverters.py", line 
1607, in convert
     return conversion(attribute, value, element)
   File "/usr/lib/python2.7/dist-packages/odf/attrconverters.py", line 
120, in cnv_formula
     return __save_prefix(attribute, arg, element)
   File "/usr/lib/python2.7/dist-packages/odf/attrconverters.py", line 
106, in __save_prefix
     return str(arg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 
0-2: ordinal not in range(128)

    * What outcome did you expect instead?

It should work good. The code works on 1.2.0-2. I'm not sure why
it doesn't work now for 1.2.0-6.


-- System Information:
Debian Release: 8.0
   APT prefers testing-updates
   APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: 
LC_ALL set to zh_TW.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-odf depends on:
pn  python:any  <none>

Versions of packages python-odf recommends:
ii  python-odf-doc    1.2.0-6
ii  python-odf-tools  1.2.0-6

python-odf suggests no packages.

-- no debconf information

-- 
                                 PaulLiu (劉穎駿)
E-mail: Ying-Chun Liu (PaulLiu) <paulliu at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1.ods
Type: application/vnd.oasis.opendocument.spreadsheet
Size: 11765 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20150430/eb564ec7/attachment-0001.ods>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test01.py
Type: text/x-python
Size: 154 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20150430/eb564ec7/attachment-0001.py>


More information about the Python-modules-team mailing list