Skip to content

db_url does not handle '#' in password? #55

@lisac

Description

@lisac

I'm trying to configure a database password that happens to contain a #. Is that character not supported in this package's processing of the database url? When I alter the test_postgres_parsing in test.py so that the password contains that character, eg wegauwhgeuioweg --> weg#auwhgeuioweg, the test encounters this error:

ERROR: test_postgres_parsing (environ.test.DatabaseTestSuite)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\django-environ\environ\test.py", line 241, in test_postgres_parsing
    url = Env.db_url_config(url)
  File "c:\projects\django-environ\environ\environ.py", line 371, in db_url_config
    'PORT': _cast_int(url.port),
  File "C:\Python27\Lib\urlparse.py", line 113, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: 'weg'

I've found that other special chars, such as these: }{)(}|!\^><; can be embedded in the database password and not break the test. For example, when I alter the password from wegauwhgeuioweg to :wegauw}{)(}|!\^><;hgeuioweg on lines 238 and 245 of the test case in test.py, no tests fail.

My environment is python 2.7.10.

Summary: Is it true that a # included in the db password will corrupt the db url?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions