[New-bugs-announce] [issue33023] Unable to copy ssl.SSLContext

Vitaly Kruglikov report at bugs.python.org
Thu Mar 8 01:09:21 EST 2018


New submission from Vitaly Kruglikov <vitaly.krug at gmail.com>:

```
import copy
import ssl

copy.copy(ssl.create_default_context())
```
results in 

`TypeError: can't pickle SSLContext objects`

This prevents me from being able to `copy.deepcopy()` an object that references `ssl.SSLContext`.

The apparent root cause is apparently that `ssl.SSLContext` passes an extra arg to its `__new__` method, but doesn't implement the method `__getnewargs__` that would let `copy` extract the extra arg.

----------
messages: 313422
nosy: vitaly.krug
priority: normal
severity: normal
status: open
title: Unable to copy ssl.SSLContext
versions: Python 2.7, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33023>
_______________________________________


More information about the New-bugs-announce mailing list