title: ValueError: dictionary update sequence element #6 has length 1; 2 is required
body: <p>I have some Python code meant to take some data and recreate a string from that data, but I'm receiving an error. </p>
  
  <pre><code>def remove_cruft(s):
       return s[1:-2]
  
  import re
  
  filetouse = input("What file would you like to use?\n&gt;&gt;&gt;")
  filetouse = filetouse + ".txt"
  f = open(filetouse,"r")
  lines = f.readlines()
  indexlist = lines[2]
  indexdict = lines[1]
  
  indexdict = indexdict.split()
  indexdict.remove("['")
  indexdict.remove("']") 
  for item in indexdict:
      if "'," in indexdict:
          indexdict.remove("',")
      if "'" in indexdict:
          indexdict.remove("'")
      if '",' in indexdict:
          indexdict.remove('",')
      if '"' in indexdict:
          indexdict.remove('"')
  
  indexdict = str(indexdict)
  indexdict = indexdict[1:-1]
  indexdict.replace(" ", "")
  
  dict(x.split('=') for x in indexdict.split(','))
  
  print(indexlist)
  print(indexdict)
  newindexlist = remove_cruft(indexlist)
  newindexlist = re.findall(r"[\w']+|[.,!?;]", newindexlist)
  del newindexlist[1::2]
  print(newindexlist)
  
  posindexdict = 0
  finaloutput = []
  
  print(finaloutput)
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "\\IOTA\ControlledAssessment\assess87\My Documents\Python\Task 3\Decompression v1.3.py", line 31, in &lt;module&gt;
      dict(x.split('=') for x in indexdict.split(','))
  ValueError: dictionary update sequence element #6 has length 1; 2 is required
  </code></pre>