DictWriter instance has no attribute '__exit__'

So I’m messing around with a DictWriter and was trying to use the typical “with” syntax I use with short-lived things in python… and got this error:

Error: DictWriter instance has no attribute '__exit__'

Turns out, that’s not really a thing, and I should have followed the example. Don’t judge me please for using Py2, Splunk hasn’t caught up (yet).



#python #errors #fixes #splunk