Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#157 Database passwords with '@' don't parse correctly.

closed-fixed
Oleg Broytman
General (125)
5
2006-08-29
2006-02-07
Anonymous
No

As the title says, if your database password contains
an '@' character, then the connection string is parsed
incorrectly. To remidy this, I've used host.rfind('@')
instead of host.find('@'). A patch for this would look
something like (I hope the indentation works):

dbconnection.py.ORIG dbconnection.py
94,99c94,102
< if host and host.find('@') != -1:
< user, host = host.split('@', 1)
< if user.find(':') != -1:
< user, password = user.split(':', 1)
< else:
< password = None
---
> if host:
> at = host.rfind('@')
> if at != -1:
> user = host[:at]
> host = host[at+1:]
> if user.find(':') != -1:
> user, password = user.split(':', 1)
> else:
> password = None

gkelly@gmail.com

Discussion

  • Logged In: NO

    Doesn't look like the indentation worked, but it should be
    easy to see that rather than using the split function, use
    the reverse find() to split the string.

     
  • Oleg Broytman
    Oleg Broytman
    2006-08-29

    Logged In: YES
    user_id=4799

    Fixed in the revision 1887 in the trunk, rev. 1888 in the
    0.7-branch.

     
  • Oleg Broytman
    Oleg Broytman
    2006-08-29

    • assigned_to: nobody --> phd
    • status: open --> closed-fixed