-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert all script metadata to text #23644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And can we add a test that would fail without this fix?
f9b2d22
to
6edd225
Compare
6edd225
to
61eada9
Compare
61eada9
to
c16e45f
Compare
tools/manifest/sourcefile.py
Outdated
assert isinstance(value, text_type), value | ||
except Exception: | ||
import pdb | ||
pdb.post_mortem() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you add this to debug something? Most other pdb.post_mortem()
go together with a traceback.print_exc()
, and many are also conditional. So it's hard to tell if this is leftover debugging or useful to leave here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Pure debugging leftover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nits, my comments don't require another round of review
Otherwise we were getting a different type when loading the manifest compared to when reading data from the initial file. This caused problems in Python 3.
dfd5cb7
to
6ddad08
Compare
Reusing variables can cause a mypy type error (python/mypy#1174). This previously went unnoticed because the previous and current use of `key` was `str`, but in #23644 the previous use was retyped to `Text` and as such caused a unicode-vs-str type error in mypy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay; it was a holiday. And thanks for reviewing, Philip!
LGTM % a nit/question
@@ -864,11 +864,11 @@ def manifest_items(self): | |||
)] | |||
|
|||
elif self.name_is_multi_global: | |||
globals = b"" | |||
globals = u"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it's a bit inconsistent that some text strings are prefixed with u
while the others are not. Shall we apply the future lint for string literals to tools/
as well? @jgraham
…, a=testonly Automatic update from web-platform-tests Rename variable to avoid mypy type error (#23669) Reusing variables can cause a mypy type error (python/mypy#1174). This previously went unnoticed because the previous and current use of `key` was `str`, but in web-platform-tests/wpt#23644 the previous use was retyped to `Text` and as such caused a unicode-vs-str type error in mypy. -- wpt-commits: 7b9a66f8a9cf68bbe220473f9eff0e652998c072 wpt-pr: 23669
…, a=testonly Automatic update from web-platform-tests Rename variable to avoid mypy type error (#23669) Reusing variables can cause a mypy type error (python/mypy#1174). This previously went unnoticed because the previous and current use of `key` was `str`, but in web-platform-tests/wpt#23644 the previous use was retyped to `Text` and as such caused a unicode-vs-str type error in mypy. -- wpt-commits: 7b9a66f8a9cf68bbe220473f9eff0e652998c072 wpt-pr: 23669
Otherwise we were getting a different type when loading the manifest
compared to when reading data from the initial file. This caused problems
in Python 3.