I get the error:

ValueError: dictionary update sequence element #0 has length 1; 2 is required

at the output of this line:

pprint.pprint(dict(os.environ['MOTECOM']), width= 1)

I'm using Python 3.6.2 on docker container.

1

There are 1 best solutions below

0
On BEST ANSWER

You get this error when messing around with dict and str. Using literal_eval should help:

>>> pprint.pprint(literal_eval(os.environ['MOTECOM']), width= 1)
'MOTECOM value'