Bug 228590 - [webkitcorepy] Catch AttributeError when getting password
Summary: [webkitcorepy] Catch AttributeError when getting password
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: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-29 10:31 PDT by Jonathan Bedard
Modified: 2021-07-29 11:18 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.77 KB, patch)
2021-07-29 10:35 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2021-07-29 10:31:53 PDT
Some Linux distros will raise an AttributeError in keyring when retrieving a password. Given that our code handles cases where keyring fails, we should also catch AttributeErrors.
Comment 1 Radar WebKit Bug Importer 2021-07-29 10:32:09 PDT
<rdar://problem/81278799>
Comment 2 Jonathan Bedard 2021-07-29 10:35:06 PDT
Created attachment 434533 [details]
Patch
Comment 3 Aakash Jain 2021-07-29 10:46:08 PDT
Example of failure: https://ews-build.webkit-uat.org/#/builders/35/builds/105023/steps/10/logs/stdio

Traceback (most recent call last):
  File "Tools/Scripts/check-github-mirror-integrity", line 56, in <module>
    sys.exit(main())
  File "Tools/Scripts/check-github-mirror-integrity", line 37, in main
    mirror_tip = mirror.commit(branch='main')
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py", line 244, in commit
    commit_data = self.request('commits/{}'.format(branch or tag))
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py", line 82, in request
    username, access_token = self.credentials(required=bool(authenticated))
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py", line 71, in credentials
    key_name='token',
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/credentials.py", line 73, in credentials
    key = keyring.get_password(url, username)
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/autoinstalled/python-3/keyring/core.py", line 42, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/autoinstalled/python-3/keyring/backends/file.py", line 62, in get_password
    username = escape_for_ini(username)
  File "/home/ews/worker/GTK-Build-EWS/build/Tools/Scripts/libraries/autoinstalled/python-3/keyring/util/escape.py", line 44, in escape
    return "".join(_escape_char(c) for c in value.encode('utf-8'))
AttributeError: 'NoneType' object has no attribute 'encode'
Comment 4 EWS 2021-07-29 11:18:09 PDT
Committed r280435 (240073@main): <https://commits.webkit.org/240073@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434533 [details].