Whole file
joke2k/django-environ
The author described this change as “Fix db_url_config to work the same for all postgres-like schemes”. It counts as a record because the check below fails on the code as it stood at 3e02a6445 and passes on f8ba4f6c6, with nothing else changed between the two runs.
Projectjoke2k/django-environ
Fix saved2021-09-01
Sharing licenceMIT · LICENSE.txt
Change size+3 −1
What the code was meant to do, written into the code itself as a save note
Fix db_url_config to work the same for all postgres-like schemes
The change
| 80 | 80 | BOOLEAN_TRUE_STRINGS = ('true', 'on', 'ok', 'y', 'yes', '1') | |
| 81 | 81 | URL_CLASS = ParseResult | |
| 82 | 82 | DEFAULT_DATABASE_ENV = 'DATABASE_URL' | |
| 83 | + | ||
| 84 | + | POSTGRES_FAMILY = ('postgres', 'postgresql', 'psql', 'pgsql', 'postgis') | |
| 83 | 85 | DB_SCHEMES = { | |
| 84 | 86 | 'postgres': DJANGO_POSTGRES, | |
| 85 | 87 | 'postgresql': DJANGO_POSTGRES, | |
| ⋯ | |||
| 480 | 482 | 'PORT': _cast_int(url.port) or '', | |
| 481 | 483 | }) | |
| 482 | 484 | ||
| 483 | - | if url.scheme == 'postgres' and path.startswith('/'): | |
| 485 | + | if url.scheme in cls.POSTGRES_FAMILY and path.startswith('/'): | |
| 484 | 486 | config['HOST'], config['NAME'] = path.rsplit('/', 1) | |
| 485 | 487 | ||
| 486 | 488 | if url.scheme == 'oracle' and path == '': | |
The check that tells the two apart
fail→pass·tests/test_db.py::test_postgres_like_scheme_parsing[postgresql]
Check file tests/test_db.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it3e02a644584e6dda44b2fa9176ad4c759d169916
Broken version dated2021-09-01
Moduleenviron.environ
Units changedEnv
Fingerprintdbd41592be038427
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in joke2k/django-environ
- 2026-02-20Fix prometheus DB scheme aliases: underscores → hyphens (#585)
- 2026-02-17Feature/add choice parameter and raise an exception if fetched value is not within (#555)
- 2022-06-14Fix `environ.Path.__eq__()` to compare paths correctly
- 2021-12-13fix unquote vs unquote_plus issue
- 2021-12-09fix[db_url_config]: added postgres cluster DSN support (ie postgresql://username:password@host1:port1,host2:port2/database)