Title: [260859] trunk/Tools
Revision
260859
Author
[email protected]
Date
2020-04-28 17:26:31 -0700 (Tue, 28 Apr 2020)

Log Message

[GTK] update-webkitgtk-libs: TypeError: cannot use a string pattern on a bytes-like object
https://bugs.webkit.org/show_bug.cgi?id=211144

Reviewed by Michael Catanzaro.

Unconditionally decode the output from the 'id' command to make it
work with python3.

Also check if the doc directory exists before passing it to bwrap.
Should avoid errors like these:

bwrap: Can't find source path /run/user/1000/doc: No such file or directory

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (260858 => 260859)


--- trunk/Tools/ChangeLog	2020-04-29 00:12:28 UTC (rev 260858)
+++ trunk/Tools/ChangeLog	2020-04-29 00:26:31 UTC (rev 260859)
@@ -1,3 +1,21 @@
+2020-04-28  Lauro Moura  <[email protected]>
+
+        [GTK] update-webkitgtk-libs: TypeError: cannot use a string pattern on a bytes-like object
+        https://bugs.webkit.org/show_bug.cgi?id=211144
+
+        Reviewed by Michael Catanzaro.
+
+        Unconditionally decode the output from the 'id' command to make it
+        work with python3.
+
+        Also check if the doc directory exists before passing it to bwrap.
+        Should avoid errors like these:
+
+        bwrap: Can't find source path /run/user/1000/doc: No such file or directory
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.run_in_sandbox):
+
 2020-04-28  Kate Cheney  <[email protected]>
 
         Create a mechanism to add missing ITP Database tables when the schema is updated

Modified: trunk/Tools/flatpak/flatpakutils.py (260858 => 260859)


--- trunk/Tools/flatpak/flatpakutils.py	2020-04-29 00:12:28 UTC (rev 260858)
+++ trunk/Tools/flatpak/flatpakutils.py	2020-04-29 00:26:31 UTC (rev 260859)
@@ -661,8 +661,12 @@
 
             try:
                 with open(os.devnull, 'w') as devnull:
-                    uid = subprocess.check_output(("id", "-u"), stderr=devnull).strip()
-                    flatpak_command.append("--bind-mount=/run/user/{uid}/doc=/run/user/{uid}/doc".format(uid=uid))
+                    uid = subprocess.check_output(("id", "-u"), stderr=devnull).strip().decode()
+                    uid_doc_path = '/run/user/{uid}/doc'.format(uid=uid)
+                    if os.path.exists(uid_doc_path):
+                        flatpak_command.append("--bind-mount={uid_doc_path}={uid_doc_path}".format(uid_doc_path=uid_doc_path))
+                    else:
+                        _log.debug("Can't find user document path at '{uid_doc_path}'. Not mounting it.".format(uid_doc_path=uid_doc_path))
             except subprocess.CalledProcessError:
                 pass
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to