psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.09k stars 9.31k forks source link

{'error': "object of type 'filter' has no len()"} after a get request #5035

Closed StrangeTcy closed 4 years ago

StrangeTcy commented 5 years ago

Summary.

An error occurs when trying to run https://github.com/opencog/opencog/blob/master/examples/restapi/exampleclient.py

Expected Result

A parseable JSON:

GET /api/v1.1/atoms/57:
{
  "outgoing": [],
  "incoming": [],
  "name": "giant_frog",
  "truthvalue": {
    "type": "simple",
    "details": {
      "count": "0.20000000298023224",
      "confidence": "0.0002499375259503722",
      "strength": "0.07999999821186066"
    }
  },
  "attentionvalue": {
    "lti": 0,
    "sti": 0,
    "vlti": false
  },
  "handle": 57,
  "type": "ConceptNode"
}

Actual Result

An error occured:

{'error': "object of type 'filter' has no len()"}

Reproduction Steps

Follow the instructions in https://github.com/opencog/opencog/tree/master/examples/restapi/README.md (admittedly, you'd have to compile cogutil and atomspace, but I doubt they're the cause of the problem)

System Information

$ python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": "2.1.4"
  },
  "idna": {
    "version": "2.8"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.7"
  },
  "platform": {
    "release": "4.15.0-46-generic",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "1010007f",
    "version": "17.5.0"
  },
  "requests": {
    "version": "2.21.0"
  },
  "system_ssl": {
    "version": "1010007f"
  },
  "urllib3": {
    "version": "1.24.1"
  },
  "using_pyopenssl": true
}

This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c).

qq292 commented 5 years ago

your error info for me, please.

StrangeTcy commented 5 years ago

Sorry, I've quoted the error message in my post. What would the error info look like?

nateprewitt commented 4 years ago

This doesn't appear to be an issue with Requests, I'd recommend following up with opencog or opening a question on StackOverflow.