Export to GitHub

django-pyodbc - issue #92

Port number incorrect for dsnless connections


Posted on Oct 21, 2010 by Helpful Horse

What steps will reproduce the problem? 1. when using host_is_server=True in settings.py, the port number is inserted incorrectly into the connection string.

What is the expected output? What do you see instead? The connections string should look like this: DRIVER={FreeTDS};SERVER=<myserver>;Port=1433;UID=... but instead looks like this: DRIVER={FreeTDS};SERVER=<myserver>,1433;UID=... So the 'Port=' text is missing, and the comma should be a semicolon.

What version of the product are you using? On what operating system? Trunk at r183 on Linux Mint 9 with unixodbc and freetds.

Please provide any additional information below. I tried adding the missing text in base.py and the connection now works. So the fix is in the line after the one containing "if port_str:", replace host_str += ',%s' % port_str with host_str += ';Port=%s' % port_str

Comment #1

Posted on Oct 30, 2010 by Helpful Horse

Update: the same thing happens on WinXP.

Comment #2

Posted on Jan 5, 2011 by Grumpy Cat

This is just the change described by the OP in form of a patch file.

Attachments

Comment #3

Posted on Mar 24, 2011 by Swift Panda

(No comment was entered for this change.)

Comment #4

Posted on Apr 17, 2011 by Swift Panda

Fixed in r188, thanks.

Status: Fixed

Labels:
Type-Defect Priority-Medium