Skip to content

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

@xtaje

Description

@xtaje

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions