You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError when pickling directly instantiated urllib.parse result objects #160761
When directly instantiating result objects from urllib.parse (SplitResult, ParseResult, DefragResult, or their bytes counterparts), pickling or calling __getstate__() raises a TypeError:
When _keep_empty has not been set (for instance, when constructing the result class directly rather than via urlsplit() or urlparse()), object.__getstate__() returns None. state[1] then fails with TypeError: 'NoneType' object is not subscriptable, which is not handled by except LookupError:.
Checking if state is not None: before subscripting resolves the error.
Activity
pythongh-160761: Fix TypeError when pickling directly instantiated ur…