Closed Bug 1890325 Opened 1 month ago Closed 1 month ago

[mozrunner] TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'

Categories

(Testing :: Mozbase, defect, P3)

defect
Points:
1

Tracking

(firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m11])

Attachments

(1 file)

Happens when running web-platform-tests on Android with the Fenix package:

mach wpt testing/web-platform/tests/dom --no-install --package org.mozilla.fenix

Traceback (most recent call last):
  File "/Users/henrik/code/gecko/testing/web-platform/tests/tools/wptrunner/wptrunner/testrunner.py", line 213, in init
    self.browser.start(group_metadata=group_metadata, **self.browser_settings)
  File "/Users/henrik/code/gecko/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox_android.py", line 298, in start
    self.runner.start(debug_args=debug_args,
  File "/Users/henrik/code/gecko/testing/mozbase/mozrunner/mozrunner/base/device.py", line 75, in start
    self.device.setup_profile(self.profile)
  File "/Users/henrik/code/gecko/testing/mozbase/mozrunner/mozrunner/devices/base.py", line 122, in setup_profile
    config.write(new_profiles_ini)
  File "/Users/henrik/code/gecko/testing/mozbase/mozrunner/mozrunner/devices/base.py", line 252, in write
    fp.write(b"[%s]\n" % section)
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'

By default the tempfile.NamedTemporaryFile opens in w+b mode while we are operating with strings here.

Blocks: 1880800
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #9395555 - Attachment description: Bug 1890325 - [wptrunner] Do not use bytes mode when writing profile.ini data via NamedTemporaryFile. → Bug 1890325 - [mozrunner] Do not use bytes mode when writing profile.ini data via NamedTemporaryFile.
Component: web-platform-tests → Mozbase
Summary: TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' → [mozrunner] TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1db5227c9878
[mozrunner] Do not use bytes mode when writing profile.ini data via NamedTemporaryFile. r=jgraham,gbrown
Points: --- → 1
Whiteboard: [webdriver:m11]
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: