| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Since we need the code for Python and C implementations of warn_explicit(), and it is relatively complex, it is only implemented in Python, and the C code imports the Python implementation. |
Sorry, something went wrong.
…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.
|
Ready for review. |
Sorry, something went wrong.
|
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.
| if is_py and filename[-9:].lower() in (r'\__init__', '/__init__'): | ||
| filename = filename[:-9] | ||
| elif not is_py and filename[-4:].lower() == '.pyw': | ||
| filename = filename[:-4] |
There was a problem hiding this comment.
\__init__.pyw is supported on Windows, you can do something like:
| if is_py and filename[-9:].lower() in (r'\__init__', '/__init__'): | |
| filename = filename[:-9] | |
| elif not is_py and filename[-4:].lower() == '.pyw': | |
| filename = filename[:-4] | |
| if not is_py and filename[-4:].lower() == '.pyw': | |
| filename = filename[:-4] | |
| is_py = True | |
| if is_py and filename[-9:].lower() in (r'\__init__', '/__init__'): | |
| filename = filename[:-9] |
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, I was too lazy to check and mistakenly supposed that .pyw is not supported for __init__. But I just checked -- indeed, it works.
Sorry, something went wrong.
| filename = support.findfile('test_import/data/syntax_warnings.py') | ||
| with open(filename, 'rb') as f: | ||
| source = f.read() | ||
| with warnings.catch_warnings(record=True) as wlog: |
There was a problem hiding this comment.
You may use a loop since the code is basically duplicated. Something like:
for exec_globals in ...:
Sorry, something went wrong.
There was a problem hiding this comment.
Most of tests (except test_warnings) is actually a ground for other PR. They will not be duplicates in https://github.com/python/cpython/pull/139652/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for your review. You noticed 👀 some details that I missed.
Sorry, something went wrong.
| if is_py and filename[-9:].lower() in (r'\__init__', '/__init__'): | ||
| filename = filename[:-9] | ||
| elif not is_py and filename[-4:].lower() == '.pyw': | ||
| filename = filename[:-4] |
There was a problem hiding this comment.
Hmm, I was too lazy to check and mistakenly supposed that .pyw is not supported for __init__. But I just checked -- indeed, it works.
Sorry, something went wrong.
| filename = support.findfile('test_import/data/syntax_warnings.py') | ||
| with open(filename, 'rb') as f: | ||
| source = f.read() | ||
| with warnings.catch_warnings(record=True) as wlog: |
There was a problem hiding this comment.
Most of tests (except test_warnings) is actually a ground for other PR. They will not be duplicates in https://github.com/python/cpython/pull/139652/files#diff-f23235c1f5dea0e2d79b33a58e00025ad3c440f96bb76013a1a37868e70a776b
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
⚠️⚠️⚠️ 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 502 45605 1 0 17Jun25 ?? 1253:47.79 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService 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.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.