RESOLVED FIXED 222672
[ews] Add python 3 support - part 4
https://bugs.webkit.org/show_bug.cgi?id=222672
Summary [ews] Add python 3 support - part 4
Aakash Jain
Reported 2021-03-03 11:35:26 PST
Add Python 3 support to ews code, specifically to events.py
Attachments
Patch (2.44 KB, patch)
2021-03-03 11:38 PST, Aakash Jain
no flags
Patch (2.44 KB, patch)
2021-03-03 11:43 PST, Aakash Jain
no flags
Radar WebKit Bug Importer
Comment 1 2021-03-03 11:37:10 PST
Aakash Jain
Comment 2 2021-03-03 11:38:34 PST
Aakash Jain
Comment 3 2021-03-03 11:43:43 PST
Aakash Jain
Comment 4 2021-03-03 11:44:36 PST
Comment on attachment 422131 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422131&action=review > Tools/CISupport/ews-build/events.py:37 > +from zope.interface import implementer Using implementer instead of implements to prevent the error: "builtins.TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead" > Tools/CISupport/ews-build/events.py:48 > + self.body = json.dumps(data, default=self.json_serialize_datetime).encode('utf-8') This is to prevent the error: Failure: twisted.web._newclient.RequestGenerationFailed: [<twisted.python.failure.Failure builtins.TypeError: Must write bytes to a TLS transport, not unicode.>] > Tools/CISupport/ews-build/events.py:76 > + EVENT_SERVER_ENDPOINT = b'https://ews.webkit.org/results/' This is to prevent the error: File "/usr/local/lib64/python3.6/site-packages/twisted/web/_newclient.py", line 646, in _ensureValidURI if _VALID_URI.match(uri): builtins.TypeError: cannot use a bytes pattern on a string-like object > Tools/CISupport/ews-build/events.py:98 > + agent.request(b'POST', self.EVENT_SERVER_ENDPOINT, Headers({'Content-Type': ['application/json']}), body) This is to prevent the error: File "/usr/local/lib64/python3.6/site-packages/twisted/web/client.py", line 1507, in _requestWithEndpoint TypeError: method='POST' is <class 'str'>, but must be bytes
Aakash Jain
Comment 5 2021-03-03 12:38:06 PST
Tested this patch on ews uat instance for both buildbot v1.8.2 and buildbot v2.10.1, by re-installing those buildbot versions (one by one) and running few builds to ensure that the data is sent and received properly.
EWS
Comment 6 2021-03-03 14:00:28 PST
Committed r273838: <https://commits.webkit.org/r273838> All reviewed patches have been landed. Closing bug and clearing flags on attachment 422131 [details].
Note You need to log in before you can comment on or make changes to this bug.