| Summary: | [Flatpak SDK] Avoid "Invalid byte sequence in conversion input" errors and other encoding issues | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Lauro Moura <lmoura> | ||||
| Component: | Tools / Tests | Assignee: | Lauro Moura <lmoura> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | aboya, aperez, bugs-noreply, pnormand, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=220781 | ||||||
| Attachments: |
|
||||||
|
Description
Lauro Moura
2021-01-27 16:38:56 PST
Created attachment 418600 [details]
Patch
Comment on attachment 418600 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418600&action=review > Tools/ChangeLog:10 > + (WebkitFlatpak.run_in_sandbox): Avoid iterating mutating dict and What's wrong with that? Comment on attachment 418600 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418600&action=review >> Tools/ChangeLog:10 >> + (WebkitFlatpak.run_in_sandbox): Avoid iterating mutating dict and > > What's wrong with that? It's not supported in Python, it's a case of iterator invalidation: e.g. a = {"a":1, "b": 2, "c": 3} for k in a.keys(): print(k) del a[k] RuntimeError: dictionary changed size during iteration (In reply to Alicia Boya García from comment #3) > Comment on attachment 418600 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=418600&action=review > > >> Tools/ChangeLog:10 > >> + (WebkitFlatpak.run_in_sandbox): Avoid iterating mutating dict and > > > > What's wrong with that? > > It's not supported in Python, it's a case of iterator invalidation: > > e.g. > > a = {"a":1, "b": 2, "c": 3} > > for k in a.keys(): > print(k) > del a[k] > > RuntimeError: dictionary changed size during iteration This. Py2[1] had dict.keys()[1], returning a list, and dict.viewkeys()[2], which returned an iterator (a view) on them. Py3 changed the behavior of keys() to return the view[3]. [1] https://python.readthedocs.io/en/v2.7.2/library/stdtypes.html#dict.keys [2] https://python.readthedocs.io/en/v2.7.2/library/stdtypes.html#dict.viewkeys [3] https://docs.python.org/3/library/stdtypes.html#dict.keys Committed r272011: <https://trac.webkit.org/changeset/272011> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418600 [details]. |