Skip to content
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

test: add test for storage_state with lone surrogates #2261

Closed
wants to merge 2 commits into from

Conversation

mxschmitt
Copy link
Member

"""chars => window.localStorage.setItem('foo', String.fromCharCode(55934))"""
)
storage_state = await context.storage_state()
assert storage_state["origins"][0]["localStorage"][0]["value"] == chr(55934)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure python is totally fine with unpaired surrogates.

>>> print(chr(55934))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\uda7e' in position 0: surrogates not allowed

@mxschmitt mxschmitt deleted the storage-state-low-surrogates branch March 6, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants