gh-135801: Improve filtering by module in warn_explicit() without module argument#140151
Conversation
|
Since we need the code for Python and C implementations of |
Sorry, something went wrong.
a0aeb4f to
50be3cc
Compare
October 15, 2025 13:29
…ut module argument * Try to match the module name pattern with module names constructed starting from different parent directories of the filename. E.g., for "/path/to/package/module" try to match with "path.to.package.module", "to.package.module", "package.module" and "module". * Ignore trailing "/__init__.py". * Ignore trailing ".py" on Windows. * Keep matching with the full filename (without optional ".py" extension) for compatibility. * Only ignore the case of the ".py" extension on Windows.
649c884 to
f37f14c
Compare
October 16, 2025 18:31
|
Ready for review. |
Sorry, something went wrong.
5aaff03 to
bc5981e
Compare
October 17, 2025 12:32
ff502b6 to
c0b9a69
Compare
October 22, 2025 11:15
|
This is definitely a new feature, but it would be nice to backport it to 3.14.1, taking into account how much fuss was made by new syntax warnings in 3.14. This would mitigate impact. cc @hugovk |
Sorry, something went wrong.
|
Thank you for working on this. Before even considering this for 3.14, I'd want to see it in a 3.15 alpha first, with testing and feedback from those unhappy with the 3.14 syntax warnings that this addresses their needs. |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Thank you for your review. You noticed 👀 some details that I missed.
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
6826166
into
python:main
Oct 30, 2025
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot aarch64 Android 3.x (tier-3) has failed when building commit 6826166. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/1594/builds/3659 Summary of the results of the build (if available): Click to see traceback logsremote: Enumerating objects: 55, done.
remote: Counting objects: 1% (1/55)
remote: Counting objects: 3% (2/55)
remote: Counting objects: 5% (3/55)
remote: Counting objects: 7% (4/55)
remote: Counting objects: 9% (5/55)
remote: Counting objects: 10% (6/55)
remote: Counting objects: 12% (7/55)
remote: Counting objects: 14% (8/55)
remote: Counting objects: 16% (9/55)
remote: Counting objects: 18% (10/55)
remote: Counting objects: 20% (11/55)
remote: Counting objects: 21% (12/55)
remote: Counting objects: 23% (13/55)
remote: Counting objects: 25% (14/55)
remote: Counting objects: 27% (15/55)
remote: Counting objects: 29% (16/55)
remote: Counting objects: 30% (17/55)
remote: Counting objects: 32% (18/55)
remote: Counting objects: 34% (19/55)
remote: Counting objects: 36% (20/55)
remote: Counting objects: 38% (21/55)
remote: Counting objects: 40% (22/55)
remote: Counting objects: 41% (23/55)
remote: Counting objects: 43% (24/55)
remote: Counting objects: 45% (25/55)
remote: Counting objects: 47% (26/55)
remote: Counting objects: 49% (27/55)
remote: Counting objects: 50% (28/55)
remote: Counting objects: 52% (29/55)
remote: Counting objects: 54% (30/55)
remote: Counting objects: 56% (31/55)
remote: Counting objects: 58% (32/55)
remote: Counting objects: 60% (33/55)
remote: Counting objects: 61% (34/55)
remote: Counting objects: 63% (35/55)
remote: Counting objects: 65% (36/55)
remote: Counting objects: 67% (37/55)
remote: Counting objects: 69% (38/55)
remote: Counting objects: 70% (39/55)
remote: Counting objects: 72% (40/55)
remote: Counting objects: 74% (41/55)
remote: Counting objects: 76% (42/55)
remote: Counting objects: 78% (43/55)
remote: Counting objects: 80% (44/55)
remote: Counting objects: 81% (45/55)
remote: Counting objects: 83% (46/55)
remote: Counting objects: 85% (47/55)
remote: Counting objects: 87% (48/55)
remote: Counting objects: 89% (49/55)
remote: Counting objects: 90% (50/55)
remote: Counting objects: 92% (51/55)
remote: Counting objects: 94% (52/55)
remote: Counting objects: 96% (53/55)
remote: Counting objects: 98% (54/55)
remote: Counting objects: 100% (55/55)
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 5% (1/20)
remote: Compressing objects: 10% (2/20)
remote: Compressing objects: 15% (3/20)
remote: Compressing objects: 20% (4/20)
remote: Compressing objects: 25% (5/20)
remote: Compressing objects: 30% (6/20)
remote: Compressing objects: 35% (7/20)
remote: Compressing objects: 40% (8/20)
remote: Compressing objects: 45% (9/20)
remote: Compressing objects: 50% (10/20)
remote: Compressing objects: 55% (11/20)
remote: Compressing objects: 60% (12/20)
remote: Compressing objects: 65% (13/20)
remote: Compressing objects: 70% (14/20)
remote: Compressing objects: 75% (15/20)
remote: Compressing objects: 80% (16/20)
remote: Compressing objects: 85% (17/20)
remote: Compressing objects: 90% (18/20)
remote: Compressing objects: 95% (19/20)
remote: Compressing objects: 100% (20/20)
remote: Compressing objects: 100% (20/20), done.
remote: Total 29 (delta 24), reused 14 (delta 9), pack-reused 0 (from 0)
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to '6826166280d6518441a729b444173db205c4ab20'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 6826166280d gh-135801: Improve filtering by module in warn_explicit() without module argument (GH-140151)
Switched to and reset branch 'main'
configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 192k 100 192k 0 0 1371k 0 --:--:-- --:--:-- --:--:-- 1371k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 42455 100 42455 0 0 419k 0 --:--:-- --:--:-- --:--:-- 419k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 5044k 100 5044k 0 0 21.0M 0 --:--:-- --:--:-- --:--:-- 21.0M
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
44 1257k 44 556k 0 0 4751k 0 --:--:-- --:--:-- --:--:-- 4751k
100 1257k 100 1257k 0 0 9995k 0 --:--:-- --:--:-- --:--:-- 85.5M
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 635k 100 635k 0 0 5205k 0 --:--:-- --:--:-- --:--:-- 5205k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 479k 100 479k 0 0 3970k 0 --:--:-- --:--:-- --:--:-- 3970k
../../configure: line 4071: pkg-config: command not found
configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
../../Python/fileutils.c:458:1: warning: unused function 'decode_current_locale' [-Wunused-function]
458 | decode_current_locale(const char* arg, wchar_t **wstr, size_t *wlen,
| ^~~~~~~~~~~~~~~~~~~~~
../../Python/fileutils.c:677:1: warning: unused function 'encode_current_locale' [-Wunused-function]
677 | encode_current_locale(const wchar_t *text, char **str,
| ^~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
../../Modules/_localemodule.c:195:1: warning: unused function 'is_all_ascii' [-Wunused-function]
195 | is_all_ascii(const char *str)
| ^~~~~~~~~~~~
1 warning generated.
../../Modules/pwdmodule.c:69:16: warning: unused variable 'pwd_db_mutex' [-Wunused-variable]
69 | static PyMutex pwd_db_mutex = {0};
| ^~~~~~~~~~~~
1 warning generated.
../../Modules/_hacl/Lib_Memzero0.c:66:6: warning: "Your platform does not support any safe implementation of memzero -- consider a pull request!" [-W#warnings]
66 | #warning "Your platform does not support any safe implementation of memzero -- consider a pull request!"
| ^
1 warning generated.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 8784 100 8784 0 0 852k 0 --:--:-- --:--:-- --:--:-- 857k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2894 100 2894 0 0 394k 0 --:--:-- --:--:-- --:--:-- 403k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 43504 100 43504 0 0 1709k 0 --:--:-- --:--:-- --:--:-- 1770k |
Sorry, something went wrong.
|
The Android failure was probably caused by low disk space, as in #138649 (comment). This time there was no CoreSimulator.prev.log, so I had to delete the live CoreSimulator.log (over 20 GB), and then kill
It restarted automatically on the next iOS buildbot run. @freakboy3742: is there any way we can stop this log file from getting so large? /Users/buildbot/Library/Logs/CoreSimulator also contains 7,000 smaller log files, which is a number that might start causing its own problems (my terminal wasn't very happy when I tried to list them). |
Sorry, something went wrong.
So - I've taken a look at the log file, and it looks like the simulator itself might have gotten into a weird state. The log was filled with errors that indicated problems with missing SDKs and the like. I've updated the SDK on the buildbot machine, and purged all the simulators except for the one that we're - and now it's not even creating a CoreSimulator.log... so... success? I'll keep an eye on this, but maybe it was just a configuration issue.
This looks like it might have been an artefact of the Xcode setup that existed before August. It was creating a cloned simulator every time it ran the test suite; evidently it wasn't cleaning up those clones. I've purged them all, and now there's a single simulator image in that directory. |
Sorry, something went wrong.
…ut module argument (pythonGH-140151) * Try to match the module name pattern with module names constructed starting from different parent directories of the filename. E.g., for "/path/to/package/module" try to match with "path.to.package.module", "to.package.module", "package.module" and "module". * Ignore trailing "/__init__.py". * Ignore trailing ".pyw" on Windows. * Keep matching with the full filename (without optional ".py" extension) for compatibility. * Only ignore the case of the ".py" extension on Windows.
/__init__.py".