Closed Bug 1728117 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 30228 - [wave] Python 3 fixes for tools/wave/

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 30228 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/30228
Details from upstream follow.

b'Roger Johannesson <rogerj@vewd.com>' wrote:

[wave] Python 3 fixes for tools/wave/

A bunch of minor changes to make the wave test runner work with
Python 3:

  • Sort() no longer accepts a cmp function argument, use sorted()
    instead with a key function.

  • headers.get('Content-Length') returns byte value now, explicitly cast
    to int. Also return -1 if the header does not exist (instead of None)
    so that it is accepted as int value and to get the same behavior in
    InputFile.read() as with Python 2.

  • Pass header values as comma separated byte strings to
    HTTPConnection.request() instead of lists. HTTPConnection.putheader()
    does not like getting lists.

  • hashlib.update() accepts a "bytes-like" object so encode the token
    string before passing it in.

  • dict.iteritems() was renamed to dict.items().

  • Explicitly open zipfiles as binary files. If not, file.read() will
    try to read them as utf-8 which fails.

Test result changes from PR not available.
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a6017b7bfdfa
[wpt PR 30228] - [wave] Python 3 fixes for tools/wave/, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.