tdf#171671 pythonscript: Unquote the URL when generating library name

Otherwise for example if the filename has spaces in it then these will
appear as “%20” in the macro organiser.

Change-Id: I2da91d5aeb08962c9175219ab75ee7cb9d7277f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203304
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204049
This commit is contained in:
Neil Roberts
2026-04-22 11:11:25 +02:00
committed by Xisco Fauli
parent 0b8b3de5c3
commit 49dc3c1c01
+3 -1
View File
@@ -25,6 +25,7 @@ import types
import time
import ast
import platform
import urllib.parse
from com.sun.star.uri.RelativeUriExcessParentSegments import RETAIN
from com.sun.star.uno import RuntimeException
@@ -686,7 +687,8 @@ class DirBrowseNode(unohelper.Base, XBrowseNode):
for i in contents:
if i.endswith(".py"):
log.debug("adding filenode " + i)
browseNodeList.append(FileBrowseNode(self.provCtx, i, i[i.rfind("/") + 1 : len(i) - 3]))
name = urllib.parse.unquote(i[i.rfind("/") + 1 : len(i) - 3])
browseNodeList.append(FileBrowseNode(self.provCtx, i, name))
elif self.provCtx.sfa.isFolder(i) and not (i.endswith("/pythonpath") or i.endswith("/__pycache__")):
log.debug("adding DirBrowseNode " + i)
browseNodeList.append(DirBrowseNode(self.provCtx, i[i.rfind("/") + 1 : len(i)], i))