title: python's json: AttributeError: 'str' object has no attribute 'keys'
body: <p>I am trying to load a string (the actual program read this line from a file and it is a very large file that I can not manually modify) formatted as a dictionary. </p>
  
  <p>I need to convert the string line into a json object so I can check value of specific key, e.g. <code>myJson[Date]</code> . </p>
  
  <p>This is the script:</p>
  
  <pre><code>import json
  
  mystring = "{'Date': 'Fri, 19 Apr 2019 03:58:04 GMT', 'Server': 'Apache/2.4.39', 'Accept-Ranges': 'bytes'}"
  
  
  mystring = json.dumps(mystring)
  myJson = json.loads(mystring)
  
  print(str(myJson.keys()))
  print(str(myJson))
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'keys'
  </code></pre>
  
  <p>I suspect that the <code>mystring</code> format is not conforming and that the single quotes should be double quotes? Given that I have a large data, and I can not simply replace single colons with double one using simple search/replace as single colons may be included in the values which I should not modify. If this is the cause of the problem, is there any way to replace the colons of the key/value pair only without touching the colons in the values? I am hoping that this is not the problem. </p>