Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using manage.py dbshell with ODBC 17 results in a error by runshell #100

Open
braiam opened this issue Jan 21, 2021 · 1 comment
Open

Using manage.py dbshell with ODBC 17 results in a error by runshell #100

braiam opened this issue Jan 21, 2021 · 1 comment

Comments

@braiam
Copy link

braiam commented Jan 21, 2021

For the following database configuration

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'actual_name',
        'HOST': 'actual_ip',
        'USER': 'user',
        'PASSWORD': 'secret',
        'OPTIONS': {
            'driver': 'ODBC Driver 17 for SQL Server',
            'connection_timeout': 15
        },
    },
}

Calling dbshell results on the following error:

Traceback (most recent call last):
  File "/home/braiam/Documents/incart/src/incart/./manage.py", line 22, in <module>
    main()
  File "/home/braiam/Documents/incart/src/incart/./manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/dbshell.py", line 26, in handle
    connection.client.runshell(options['parameters'])
TypeError: runshell() takes 1 positional argument but 2 were given

According to 3.1 release notes there's a backwards incompatible change for the runshell function.

@aceofwings
Copy link

Seems to be a simple fix. Ill have something written up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants