Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-778

Document URI quoting rules

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8, 3.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            wichert Wichert Akkerman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: