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

UnboundLocalError in mssql/base.py:1925 #4273

Closed
sqlalchemy-bot opened this issue Jun 8, 2018 · 8 comments
Closed

UnboundLocalError in mssql/base.py:1925 #4273

sqlalchemy-bot opened this issue Jun 8, 2018 · 8 comments
Labels
bug Something isn't working SQL Server Microsoft SQL Server, e.g. mssql
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Umberto Prim

In my call to engine.raw_connection() I have got this error:

File "D:\Anaconda\lib\site-packages\sqlalchemy\dialects\mssql\base.py", line 1925, in get_isolation_level
    "tried views: %s; final error was: %s" % (views, err))
UnboundLocalError: local variable 'err' referenced before assignment

Which looks like an easy fix.

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

pr at zzzeek/sqlalchemy#453

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

what's the actual error it is trying to report?

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

also this is a Python 3 error...heh

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

https://gerrit.sqlalchemy.org/#/q/I39877c1f65f9cf8602fb1dceaf03072357759564 for 1.2 / master

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • set milestone to "1.2.x"

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

Fix UnboundLocalError in mssql during isolation level grab

Fixed issue within the SQL Server dialect under Python 3 where when running
against a non-standard SQL server database that does not contain either the
"sys.dm_exec_sessions" or "sys.dm_pdw_nodes_exec_sessions" views, leading
to a failure to fetch the isolation level, the error raise would fail due
to an UnboundLocalError.

Fixes: #4273
Co-authored-by: wikiped wikiped@yandex.ru
Change-Id: I39877c1f65f9cf8602fb1dceaf03072357759564

e2913f6

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

Fix UnboundLocalError in mssql during isolation level grab

Fixed issue within the SQL Server dialect under Python 3 where when running
against a non-standard SQL server database that does not contain either the
"sys.dm_exec_sessions" or "sys.dm_pdw_nodes_exec_sessions" views, leading
to a failure to fetch the isolation level, the error raise would fail due
to an UnboundLocalError.

Fixes: #4273
Co-authored-by: wikiped wikiped@yandex.ru
Change-Id: I39877c1f65f9cf8602fb1dceaf03072357759564
(cherry picked from commit e2913f6)

d404111

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot sqlalchemy-bot added SQL Server Microsoft SQL Server, e.g. mssql bug Something isn't working labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the 1.2.x milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SQL Server Microsoft SQL Server, e.g. mssql
Projects
None yet
Development

No branches or pull requests

1 participant