1

I am getting TypeError: cannot pickle 'sqlite3.Connection' object when attempting to pickle a function. The thing is, I don't use sqlite anywhere in my project and definitely nowhere in this function.

Here is a minimal working example that shows the error:

    def test_outer(a):
        def test_inner(a):
            return a+1
        return a
    dill.dumps(test_outer)
skrhee
  • 336
  • 5
  • 19
  • Let's work out the issue here: https://github.com/uqfoundation/dill/issues/435. Essentially, this exact code is run in the dill tests, and passes for all versions of python... so I expect it has to be something in your environment. – Mike McKerns Oct 21 '21 at 22:57
  • Did you run this in pyconsole from Pycharm ? – Alex Deft Feb 10 '22 at 10:56

0 Answers0