https://bugs.documentfoundation.org/show_bug.cgi?id=163190
Bug ID: 163190
Summary: [pyuno] SyntaxWarning: invalid escape sequence '\P'
Product: LibreOffice
Version: 24.8.0.0 alpha0+
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: minor
Priority: medium
Component: sdk
Assignee: [email protected]
Reporter: [email protected]
Hi, see http://bugs.debian.org/1082775.
Installing python3-uno gives
Setting up python3-uno (4:24.8.1-2) ...
/usr/lib/libreoffice/program/officehelper.py:94: SyntaxWarning: invalid escape
sequence '\P'
"""Bootstrap PyUNO Runtime.
probably thrown by
#!/bin/sh
set -e
# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
py3compile -p python3-uno:amd64
fi
if command -v pypy3compile >/dev/null 2>&1; then
pypy3compile -p python3-uno:amd64 || true
fi
# End automatically added section
# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
py3compile -p python3-uno:amd64 /usr/lib/libreoffice/program -V 3.12
fi
if command -v pypy3compile >/dev/null 2>&1; then
pypy3compile -p python3-uno:amd64 /usr/lib/libreoffice/program -V 3.12
|| true
fi
# End automatically added section
which the Debian package helpers add automatically for public modules. "import
uno" doesn't warn, but maybe when it gets actually used?
Anyways:
This is due to this comment in officehelper.py:
"""Bootstrap PyUNO Runtime.
The soffice process is started opening a named pipe of random name,
then the local context is used to access the pipe. This function
directly returns the remote component context, from whereon you can
get the ServiceManager by calling getServiceManager() on the
returned object.
Examples:
i. Start LO as a service, get its remote component context
import officehelper
ctx = officehelper.bootstrap()
# your code goes here
ii. Wait longer for LO to start, request context multiples times
+ Report processing in console
import officehelper as oh
ctx = oh.bootstrap(delays=(5,10,15,20),report=print) # wait 5, 10, 15
and 20 sec.
# your code goes here
iii. Use a specific LibreOffice copy
from officehelper import bootstrap
ctx =
bootstrap(soffice=r"USB:\PortableApps\libO-7.6\App\libreoffice\program\soffice.exe")
# your code goes here
"""
which is line 94... (cf.
https://git.libreoffice.org/core/+/refs/tags/libreoffice-24.8.2.1/pyuno/source/officehelper.py)
and which was added in
https://git.libreoffice.org/core/+/d8978a8c4ffabd6b36a691fd3e2df68563808234
The Problem is the Windows Path in iii. and the \P in \PortableApps.. Maybe
that example should be converted into UNIX paths to avoid that \P which is
interpreted as a escape sqeuence by python.
--
You are receiving this mail because:
You are the assignee for the bug.