MongoDB itself can handle passwords containing a slash without problems. Unfortunately this breaks in pymongo's URI parser:
>>> from pymongo import uri_parser >>> uri_parser.parse_uri('mongodb://user:pass/word@127.0.0.1') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pymongo/uri_parser.py", line 296, in parse_uri nodes = split_hosts(hosts, default_port=default_port) File "pymongo/uri_parser.py", line 236, in split_hosts nodes.append(parse_host(entity, port)) File "pymongo/uri_parser.py", line 138, in parse_host raise ConfigurationError("Port number must be an integer.") pymongo.errors.ConfigurationError: Port number must be an integer.