[Libreoffice-commits] dictionaries.git: en/pythonpath hu_HU/pythonpath ru_RU/pythonpath

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 20 18:25:39 UTC 2020


 en/pythonpath/lightproof_impl_en.py       |    4 ++--
 hu_HU/pythonpath/lightproof_impl_hu_HU.py |    4 ++--
 ru_RU/pythonpath/lightproof_impl_ru_RU.py |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit bdedc84127530fcf71c096ad572bd4306a40b26f
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jul 20 14:07:35 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Jul 20 20:25:17 2020 +0200

    Fix "invalid escape sequence \w" Python exceptions
    
    (Like
    
    > Python exception: <class 'SyntaxError'>: invalid escape sequence \w (lightproof_impl_en.py, line 126), traceback follows
    >   File "instdir/program/pythonloader.py", line 133, in activate
    >     mod = self.getModuleFromUrl( locationUrl )
    >   File "instdir/program/pythonloader.py", line 101, in getModuleFromUrl
    >     exec(codeobject, mod.__dict__)
    >   File "instdir/share/extensions/dict-en/Lightproof.py", line 6, in <module>
    >     from lightproof_impl_en import locales
    >   File "instdir/program/uno.py", line 345, in _uno_import
    >     return _builtin_import(name, *optargs, **kwargs)
    
    I noticed e.g. during UITest_writer_tests3.)  Appears those suspicious escapes
    were present ever since 2214a3731aaffc4a51d1c712dbee553a0ba35af0 "Hungarian
    sentence checking", 95445a70a29c6a1166a19f483566f2c9cfc7563b "English sentence
    checking", and c9cdf3fb4752e8b0c641a3aff15d554135beb0e7 "Add Russian grammar
    checking + update English and Hungarian".
    
    Change-Id: Ia2af7e0adb00b4737b22d460dd75fa47a4ae70d5
    Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/99047
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/en/pythonpath/lightproof_impl_en.py b/en/pythonpath/lightproof_impl_en.py
index ac668dc..06d44a6 100644
--- a/en/pythonpath/lightproof_impl_en.py
+++ b/en/pythonpath/lightproof_impl_en.py
@@ -123,14 +123,14 @@ def suggest(rLoc, word):
 
 # get the nth word of the input string or None
 def word(s, n):
-    a = re.match("(?u)( [-.\w%%]+){" + str(n-1) + "}( [-.\w%%]+)", s)
+    a = re.match("(?u)( [-.\\w%%]+){" + str(n-1) + "}( [-.\\w%%]+)", s)
     if not a:
         return ''
     return a.group(2)[1:]
 
 # get the (-)nth word of the input string or None
 def wordmin(s, n):
-    a = re.search("(?u)([-.\w%%]+ )([-.\w%%]+ ){" + str(n-1) + "}$", s)
+    a = re.search("(?u)([-.\\w%%]+ )([-.\\w%%]+ ){" + str(n-1) + "}$", s)
     if not a:
         return ''
     return a.group(1)[:-1]
diff --git a/hu_HU/pythonpath/lightproof_impl_hu_HU.py b/hu_HU/pythonpath/lightproof_impl_hu_HU.py
index e933129..ef8fb0a 100644
--- a/hu_HU/pythonpath/lightproof_impl_hu_HU.py
+++ b/hu_HU/pythonpath/lightproof_impl_hu_HU.py
@@ -126,14 +126,14 @@ def suggest(rLoc, word):
 
 # get the nth word of the input string or None
 def word(s, n):
-    a = re.match("(?u)( [-.\w%%]+){" + str(n-1) + "}( [-.\w%%]+)", s)
+    a = re.match("(?u)( [-.\\w%%]+){" + str(n-1) + "}( [-.\\w%%]+)", s)
     if not a:
         return ''
     return a.group(2)[1:]
 
 # get the (-)nth word of the input string or None
 def wordmin(s, n):
-    a = re.search("(?u)([-.\w%%]+ )([-.\w%%]+ ){" + str(n-1) + "}$", s)
+    a = re.search("(?u)([-.\\w%%]+ )([-.\\w%%]+ ){" + str(n-1) + "}$", s)
     if not a:
         return ''
     return a.group(1)[:-1]
diff --git a/ru_RU/pythonpath/lightproof_impl_ru_RU.py b/ru_RU/pythonpath/lightproof_impl_ru_RU.py
index 22eb59e..ffbf054 100644
--- a/ru_RU/pythonpath/lightproof_impl_ru_RU.py
+++ b/ru_RU/pythonpath/lightproof_impl_ru_RU.py
@@ -125,14 +125,14 @@ def suggest(rLoc, word):
 
 # get the nth word of the input string or None
 def word(s, n):
-    a = re.match("(?u)( [-.\w%%]+){" + str(n-1) + "}( [-.\w%%]+)", s)
+    a = re.match("(?u)( [-.\\w%%]+){" + str(n-1) + "}( [-.\\w%%]+)", s)
     if not a:
         return ''
     return a.group(2)[1:]
 
 # get the (-)nth word of the input string or None
 def wordmin(s, n):
-    a = re.search("(?u)([-.\w%%]+ )([-.\w%%]+ ){" + str(n-1) + "}$", s)
+    a = re.search("(?u)([-.\\w%%]+ )([-.\\w%%]+ ){" + str(n-1) + "}$", s)
     if not a:
         return ''
     return a.group(1)[:-1]


More information about the Libreoffice-commits mailing list