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.
"Maybe that example should be converted into UNIX paths" I'll probably do it in the packaging. Though ideally this minor thing also could be fixed upstream ;)
adding regression keyword since the warning was not there befoe the pyuno rework up to 24.8
On pc Debian testing x86-64 with master sources updated today, I confirm the pb. $ python3 ./pyuno/source/officehelper.py /home/julien/lo/libreoffice/./pyuno/source/officehelper.py:101: SyntaxWarning: invalid escape sequence '\P'
Patch submitted here: https://gerrit.libreoffice.org/c/core/+/174108
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bda6201f811836c1ef2696b516b8999e268878e9 tdf#163190: [pyuno] SyntaxWarning: invalid escape sequence '\P' It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Cherry-pick for 24.8 waiting for review here: https://gerrit.libreoffice.org/c/core/+/174014
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/452696d3775e0bbf867fc7476373a184c7fc098c tdf#163190: [pyuno] SyntaxWarning: invalid escape sequence '\P' It will be available in 24.8.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.