Title: [264093] trunk/Tools
Revision
264093
Author
[email protected]
Date
2020-07-08 03:53:26 -0700 (Wed, 08 Jul 2020)

Log Message

[webkitpy] run-minibrowser doesn't handle unicode urls
https://bugs.webkit.org/show_bug.cgi?id=214036

Patch by Philippe Normand <[email protected]> on 2020-07-08
Reviewed by Žan Doberšek.

Convert unregistered command-line arguments to utf-8 and append parsed URL. Previously
unrelated arguments (like the platform arg) were passed to the final MiniBrowser app, this
is no longer the case.

* Scripts/webkitpy/minibrowser/run_webkit_app.py:
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (264092 => 264093)


--- trunk/Tools/ChangeLog	2020-07-08 10:41:54 UTC (rev 264092)
+++ trunk/Tools/ChangeLog	2020-07-08 10:53:26 UTC (rev 264093)
@@ -1,3 +1,17 @@
+2020-07-08  Philippe Normand  <[email protected]>
+
+        [webkitpy] run-minibrowser doesn't handle unicode urls
+        https://bugs.webkit.org/show_bug.cgi?id=214036
+
+        Reviewed by Žan Doberšek.
+
+        Convert unregistered command-line arguments to utf-8 and append parsed URL. Previously
+        unrelated arguments (like the platform arg) were passed to the final MiniBrowser app, this
+        is no longer the case.
+
+        * Scripts/webkitpy/minibrowser/run_webkit_app.py:
+        (main):
+
 2020-07-08  Carlos Alberto Lopez Perez  <[email protected]>
 
         [JHBuild] Add support for using a minimal moduleset

Modified: trunk/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py (264092 => 264093)


--- trunk/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py	2020-07-08 10:41:54 UTC (rev 264092)
+++ trunk/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py	2020-07-08 10:53:26 UTC (rev 264093)
@@ -44,6 +44,8 @@
                 option_group.add_argument(option.get_opt_string(), action="" dest=option.dest,
                                           help=option.help, const=option.const, default=default)
 
+    option_parser.add_argument('url', metavar='url', type=lambda s: unicode(s, 'utf8'), nargs='?',
+                               help='Website URL to load')
     options, args = option_parser.parse_known_args(argv)
 
     if not options.configuration:
@@ -52,9 +54,16 @@
     if not options.platform:
         options.platform = "mac"
 
+    # Convert unregistered command-line arguments to utf-8 and append parsed
+    # URL. convert_arg_line_to_args() returns a list containing a single
+    # string, so it needs to be split again.
+    browser_args = [unicode(s, "utf-8") for s in option_parser.convert_arg_line_to_args(' '.join(args))[0].split()]
+    if options.url:
+        browser_args.append(options.url)
+
     try:
         port = factory.PortFactory(Host()).get(options.platform, options=options)
-        return port.run_minibrowser(args)
+        return port.run_minibrowser(browser_args)
     except BaseException as e:
         if isinstance(e, Exception):
             print('\n%s raised: %s' % (e.__class__.__name__, str(e)), file=sys.stderr)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to