This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python39/lib/logging/__init__.py SyntaxError: cannot delete starred
Type: compile error Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, kathleenwest
Priority: normal Keywords:

Created on 2021-05-07 01:22 by kathleenwest, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
PythonError.jpg kathleenwest, 2021-05-07 01:22 logging/__init__.py
Messages (8)
msg393156 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 01:22
There is a syntax error in the python library "Python39/lib/logging/__init__.py" that when I run this is VS Code in debug mode, this shows up all the time.  

python --version
Python 3.9.4

Python39/lib/logging/__init__.py

{
	"resource": "/C:/Users/kathl/AppData/Local/Programs/Python/Python39/lib/logging/__init__.py",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "SyntaxError: cannot delete starred",
	"source": "jedi",
	"startLineNumber": 1030,
	"startColumn": 17,
	"endLineNumber": 1030,
	"endColumn": 29
}
msg393157 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-05-07 01:27
Line 1030 of 3.9.4 is at https://github.com/python/cpython/blob/1f2e3088f3c097b5bde69bbd63dfcd0852d31984/Lib/logging/__init__.py#L1030 and doesn't have a del statement or a syntax error. Most likely there's some mismatch where you're running the wrong version of Python.
msg393158 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 01:41
Jelle Zijlstra (Jelle Zijlstra)

"Saying it so doesn't make it so"

See the photo for proof. If you could reply with more details and clear steps on how to resolve the issue, that would be appreciated.
msg393159 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 01:49
The "del" statement
*******************

   del_stmt ::= "del" target_list

Deletion is recursively defined very similar to the way assignment is
defined. Rather than spelling it out in full details, here are some
hints.

Deletion of a target list recursively deletes each target, from left
to right.

Deletion of a name removes the binding of that name from the local or
global namespace, depending on whether the name occurs in a "global"
statement in the same code block.  If the name is unbound, a
"NameError" exception will be raised.

Deletion of attribute references, subscriptions and slicings is passed
to the primary object involved; deletion of a slicing is in general
equivalent to assignment of an empty slice of the right type (but even
this is determined by the sliced object).

Changed in version 3.2: Previously it was illegal to delete a name
from the local namespace if it occurs as a free variable in a nested
block.
msg393160 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 01:51
I literally changed the base logging code to this and it worked

            finally:
                del t
                del v
                del tb
msg393162 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-05-07 02:32
"del t, v, tb" is perfectly legal Python syntax. It's whatever tool is showing a syntax error there (jedi, apparently) that's buggy.

% python3.9
Python 3.9.4 (default, Apr  9 2021, 09:47:14) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = b = c = 1
>>> del a, b, c
>>>
msg393163 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 02:38
We have a root cause/answer to the issue for future reference.

Jedi is a static analysis tool for Python that is typically used in IDEs/editors plugins (VS Code)

I will create a bug here:

https://github.com/Microsoft/vscode-python
msg393164 - (view) Author: Kathleen West (kathleenwest) Date: 2021-05-07 02:57
Created an issue @ microsoft/vscode-python

https://github.com/microsoft/vscode-python/issues/16174
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88230
2021-05-07 02:57:37kathleenwestsetstatus: open -> closed

messages: + msg393164
stage: resolved
2021-05-07 02:38:51kathleenwestsetresolution: third party
messages: + msg393163
2021-05-07 02:32:06JelleZijlstrasetmessages: + msg393162
2021-05-07 01:51:37kathleenwestsetmessages: + msg393160
2021-05-07 01:49:01kathleenwestsetmessages: + msg393159
2021-05-07 01:41:17kathleenwestsetmessages: + msg393158
2021-05-07 01:27:29JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg393157
2021-05-07 01:22:04kathleenwestcreate