python-memcached icon indicating copy to clipboard operation
python-memcached copied to clipboard

Bugs in Client constructor when the servers parameter is a string, and the set_servers docstring is wrong

Open xtaje opened this issue 4 years ago • 0 comments

See here https://github.com/linsomniac/python-memcached/blob/master/memcache.py#L280. The docstring indicates that when a string is passed in for the servers parameter, the client will treat it as a single host.

Instead what actually happens, is that it will iterate over the string and attempt to create a host for every letter in the string. Then one of two things is possible:

  • If the host name contains a port, the constructor will fail on trying to parse the ':' separator.
  • If the host name does not contain a port, the constructor will succeed, but set and get calls will run.

xtaje avatar Dec 05 '20 07:12 xtaje