Modify ↓
Opened 10 years ago
Closed 10 years ago
#11983 closed defect (fixed)
Cannot connect PostgreSQL database if password uses single quote characters
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | low | Milestone: | 1.0.6 |
Component: | database backend | Version: | |
Severity: | minor | Keywords: | postgresql |
Cc: | Branch: | ||
Release Notes: |
Fix wrong connection string for libpg when single quotes and/or backslashs are used in the password. |
||
API Changes: | |||
Internal Changes: |
Description
Trac [/dev/shm/testtest]> initenv ... Database connection string [sqlite:db/trac.db]> postgres://testuser:pass%27@localhost/trac?schema=testtest Creating and Initializing Project Initenv for '/dev/shm/testtest' failed. Failed to create environment. missing "=" after "'" in connection info string Traceback (most recent call last): File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/admin/console.py", line 461, in do_initenv options=options) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/core.py", line 124, in __call__ self.__init__(*args, **kwargs) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/env.py", line 281, in __init__ self.create(options) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/env.py", line 601, in create DatabaseManager(self).init_db() File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/db/api.py", line 252, in init_db connector.init_db(**args) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 101, in init_db params) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 87, in get_connection params) File "/home/jun66j5/venv/trac/1.0.4/lib/python2.5/site-packages/trac/db/postgres_backend.py", line 221, in __init__ port)) File "/home/jun66j5/venv/py25-1.0/lib/python2.5/site-packages/psycopg2/__init__.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) OperationalError: missing "=" after "'" in connection info string
According to PostgreSQL: Documentation: 8.2: Database Connection Control Functions, Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.
Attachments (1)
Change History (5)
comment:1 by , 10 years ago
Keywords: | postgresql added; postgres removed |
---|
by , 10 years ago
Attachment: | t11983.diff added |
---|
comment:2 by , 10 years ago
Milestone: | next-stable-1.0.x → 1.0.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:4 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Proposed changes: t11983.diff.