Bug 223819

Summary: Fix TypeError: Can't mix strings and bytes in path components in Tools/Scripts/dump-class-layout
Product: WebKit Reporter: Tyler Wilcock <twilco.o>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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>