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: [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
Type: Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, xtreak
Priority: normal Keywords: easy, newcomer friendly, patch

Created on 2021-04-14 11:38 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25407 merged vstinner, 2021-04-14 14:47
Messages (3)
msg391062 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-14 11:38
<string>:2: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

$ ./python -m test -v test_lib2to3
(...)
test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) ... <string>:2: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
ok
(...)
Tests result: SUCCESS

Command to only re-run this test:

./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess
msg391076 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-04-14 13:15
I fixed this in https://github.com/python/cpython/pull/21694 . Somehow this seems to emit warning over full test run and not in individual case :( Is there a command to reproduce this always? I ran the command but it's successful for me and doesn't show the warning.

./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess
== CPython 3.10.0a7+ (heads/master:d9151cb453, Apr 13 2021, 03:10:47) [GCC 7.5.0]
== Linux-4.15.0-99-generic-x86_64-with-glibc2.27 little-endian
== cwd: /root/cpython/build/test_python_20462æ
== CPU count: 1
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.02 Run tests sequentially
0:00:00 load avg: 0.02 [1/1] test_lib2to3
test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) ... ok

----------------------------------------------------------------------

Ran 1 test in 0.164s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 303 ms
Tests result: SUCCESS
msg391176 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-16 09:27
New changeset 471870fc504b0d69c767b188f180b17248be6998 by Victor Stinner in branch 'master':
bpo-43844: Fix PendingDeprecationWarning in test_lib2to3 (GH-25407)
https://github.com/python/cpython/commit/471870fc504b0d69c767b188f180b17248be6998
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 88010
2021-04-16 09:46:02vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-16 09:27:05vstinnersetmessages: + msg391176
2021-04-14 14:47:21vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request24140
2021-04-14 13:15:30xtreaksetnosy: + xtreak
messages: + msg391076
2021-04-14 11:39:50vstinnersetkeywords: + easy, newcomer friendly
components: + Tests
versions: + Python 3.10
2021-04-14 11:39:37vstinnersettitle: [easy] -> [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
2021-04-14 11:38:57vstinnercreate