Issue 28: pyodbc.connect method no longer handles autocommit passed as non-keyword argument
Status:  Complete
Owner: ----
Closed:  Jan 2009
Reported by sal.scoz...@gmail.com, Jan 22, 2009
What steps will reproduce the problem?
1. Call pyodbc.connect("DSN=MyDSN", True)
2.
3.

What is the expected output? What do you see instead?
This call worked with version 2.0.36. In 2.1.3, this error is the result:
TypeError: function takes at most 1 non-keyword argument

What version of the product are you using? On what operating system?
2.1.3, on Windows XP SP3

Please provide any additional information below.
According to the documentation, the method should support up to 3 non-
keyword args:
connect(str, autocommit=False, ansi=False, **kwargs)


Jan 22, 2009
Project Member #1 mkleehammer
An issue was recently opened here to request the kwargs, in order to match the DB API
better.  There were a couple of projects that would benefit from this (SQLAlchemy was
one, I believe).

The new method doesn't actually require the connection string (str).  To allow the
keywords to be passed in any order, I've removed the special parameters 'autocommit'
and 'ansi' and simply look for them in the keyword dictionary.

This does lose the ability to pass positional parameters, which I didn't actually
notice since I always pass them as keywords.  Now that it has been pointed out,
however, I think I would like to keep it as is.  I think it will be much more
readable and less restrictive.  For example, with the API as is, you make calls such as:

   connect(dsn='x', user='y', ansi=True)

I have updated the documentation to reflect this.  Thanks.  I hope this didn't cause
too much trouble.
Status: Fixed
Nov 21, 2010
Project Member #2 mkleehammer
(No comment was entered for this change.)
Status: Complete