errors using pyuno
This is what I get when trying to load any file on a headless soffice instance using pyuno (FreeBSD 8-STABLE, OpenOffice 3.1.1 built from ports, python 2.6.4). It is the same for .txt files and .odt files, same error (same ugly hash-like string)
1 In [1]: import uno
2
3 In [2]: local_component_context = uno.getComponentContext()
4
5 In [3]: resolver = local_component_context.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local_component_context)
6
7 In [4]: component_context = resolver.resolve("uno:socket,host=localhost,port=%s;urp;StarOffice.ComponentContext" % 8100)
8
9 In [5]: desktop = component_context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", component_context)
10
11 In [6]: desktop.loadComponentFromURL('file:///tmp/test.txt', "_blank", 0, ())
12 terminate called after throwing an instance of 'com::sun::star::lang::DisposedException'
13 ---------------------------------------------------------------------------
14 com.sun.star.lang.DisposedException Traceback (most recent call last)
15
16 /usr/local/openerp-server/<ipython console> in <module>()
17
18 <type 'str'>: (<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u'\U00520055\U005f0050\U00720042\U00640069\U00650067\U003a0020\U00640020\U00730069\U006f0070\U00650073\U000a0064\U00740028\U00640069\U0033003d\U00200029\U006e0055\U00780065\U00650070\U00740063\U00640065\U00630020\U006e006f\U0065006e\U00740063\U006f0069\U0020006e\U006c0063\U0073006f\U00720075e\U03896a80\x08\U0391cb28\x08\Ufffffffd\Uffffffff\Uffffffff\Uffffffff\x01\x00\U00632ae0\x00\U02e4f5d0\x08\U02e811a0\x08\U03896aa0\x08\x00\x00\U0060ddc0\x00\U02e61490\x08\x00\x00\x00\x00\U02e61b58', 0, 29, 'ordinal not in range(128)'))
19
20 In [7]:
Pasted by Wu on
enero 05, 2010 at 13:21 |
Lang: pythonconsole |
(20 lines of code)