dbcli / dbcli/mssql-cli

Logger returns NameError in non-interactive mode for Python 2

Offen
#317 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: non-interactive bug impact: test reliability
Vorherrschende Sprache
Python
Sterne
1.4k
Forks
191
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

`pytest -s tests/test_noninteractive_mode` shows the following warning:
```Exception ignored in:
Traceback (most recent call last):
File "/Users/ellbosch/Repos/mssql-cli/mssqlcli/mssql_cli.py", line 196, in __del__
File "/Users/ellbosch/Repos/mssql-cli/mssqlcli/sqltoolsclient.py", line 90, in shutdown
File "/Users/ellbosch/Repos/mssql-cli/mssqlcli/jsonrpc/jsonrpcclient.py", line 184, in shutdown
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1378, in info
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1514, in _log
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1524, in handle
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 894, in handle
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1126, in emit
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1116, in _open
NameError: name 'open' is not defined
```

Looks like the logger is referenced post-deconstruction.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by running pytest -s tests/test_noninteractive_mode, then inspect mssqlcli/mssql_cli.py at __del__, mssqlcli/sqltoolsclient.py at shutdown, and mssqlcli/jsonrpc/jsonrpcclient.py at its logging call. Confirm the teardown path can run during interpreter deconstruction, and consider the issue done when the test no longer emits the NameError warning.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.