Bug 223819 - Fix TypeError: Can't mix strings and bytes in path components in Tools/Scripts/dump-class-layout
Summary: Fix TypeError: Can't mix strings and bytes in path components in Tools/Script...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-26 14:09 PDT by Tyler Wilcock
Modified: 2021-03-26 17:03 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.45 KB, patch)
2021-03-26 14:15 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (2.40 KB, patch)
2021-03-26 16:28 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (2.40 KB, patch)
2021-03-26 16:31 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2021-03-26 14:09:52 PDT
When running the `dump-class-layout` script, I get this error:

$ dump-class-layout -c Release WebCore Pair
Traceback (most recent call last):
  File "/home/twilco/projects/webkit/Tools/Scripts//dump-class-layout", line 88, in <module>
    main()
  File "/home/twilco/projects/webkit/Tools/Scripts//dump-class-layout", line 80, in main
    target_path = os.path.join(build_dir, args.config, args.framework + ".framework", args.framework);
  File "/usr/lib/python3.9/posixpath.py", line 90, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.9/genericpath.py", line 155, in _check_arg_types
    raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
Comment 1 Tyler Wilcock 2021-03-26 14:15:08 PDT
Created attachment 424403 [details]
Patch
Comment 2 Jonathan Bedard 2021-03-26 16:13:25 PDT
Comment on attachment 424403 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424403&action=review

> Tools/Scripts/dump-class-layout:80
> +        target_path = os.path.join(build_dir.decode(), args.config, args.framework + ".framework", args.framework);

I think the right answer here is to fix webkit_build_dir() and do the decode subprocess.check_output, it seems like that function should return a string, not bytes.
Comment 3 Tyler Wilcock 2021-03-26 16:28:11 PDT
Created attachment 424417 [details]
Patch
Comment 4 Tyler Wilcock 2021-03-26 16:31:36 PDT
Created attachment 424419 [details]
Patch
Comment 5 EWS 2021-03-26 17:02:18 PDT
Committed r275123: <https://commits.webkit.org/r275123>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424419 [details].
Comment 6 Radar WebKit Bug Importer 2021-03-26 17:03:15 PDT
<rdar://problem/75907744>