TSQLEasy
TSQLEasy copied to clipboard
Execute with an unreachable server: dialog, then AttributeError 'NoneType' has no attribute 'sqlconnection'
Sublime Text 4200 (Windows, Python 3.3 host), TSQLEasy 1.6.4, default settings (server 127.0.0.1, no SQL Server running).
Open a .sql file and run "TSQL Easy: Execute".
- A dialog appears: "[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied."
- After OK, the console shows:
AttributeError: 'NoneType' object has no attribute 'sqlconnection' File ".../base/te_sql_exec.py", line 30, in run
Cause: SQLInfo.get_connection() in te_utils.py catches the connection error, shows the dialog, and then returns None. te_sql_exec.py line 30 uses the result without checking for None. The same unchecked result is used in te_utils.py (get_tables, get_columns, te_show_data), so I expect the same traceback for completions and the other commands when the server is unreachable; I only ran Execute.