Commit graph

128633 commits

Author SHA1 Message Date
Dino Viehland
c63198cba4 Move eager check for from imports into import from 2025-10-07 16:20:47 -07:00
Dino Viehland
7d07ae13d7 Add test case for external usage 2025-10-07 16:20:47 -07:00
Pablo Galindo Salgado
2799a4d0ce
Merge pull request #7 from LazyImportsCabal/lazy_dir
dir() doesn't reify module
2025-10-07 23:09:10 +01:00
Dino Viehland
aa85f9d79e dir() doesn't reify module 2025-10-07 14:52:23 -07:00
Pablo Galindo Salgado
e5e9592863 C was a mistake 2025-10-07 16:23:45 +01:00
Pablo Galindo
214b2543ee Fix global membership in LOAD_NAME 2025-10-07 11:42:13 +01:00
Pablo Galindo Salgado
5ff0dd2363
Merge pull request #2 from bswck/lazy-import-pyrepl-highlight
Highlight lazy imports in the new REPL
2025-10-04 00:22:27 +01:00
bswck
c0c0d80a75
Highlight lazy imports in the new REPL 2025-10-04 01:02:12 +02:00
Pablo Galindo Salgado
5d6026a800 Make imports in with blocks syntax errors 2025-10-02 21:35:49 +01:00
Dino Viehland
7c494053b0 Don't allow __lazy_imports__ to work in try/except 2025-10-02 13:22:55 -07:00
Dino Viehland
c8c8838b1c Move __lazy_imports__ check into the interpreter 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
39c33df51a Simplify grammar 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
f67310c9b9 Add sys.set_lazy_imports_filter 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
9078f571e4 Fix __lazy_modules__ 2025-10-02 13:22:54 -07:00
Dino Viehland
b179da2cf5 Re-enable eagerly returning imported module 2025-10-02 13:22:54 -07:00
Dino Viehland
9be59ecebd Publish lazy imported packages on parent 2025-10-02 13:22:54 -07:00
Dino Viehland
781eedb9d4 Add PyExc_ImportCycleError and raise it when a cycle is detected 2025-10-02 13:22:54 -07:00
Dino Viehland
00e7800e4c Implement disabling imports in try/except and * imports, report errors on bad usage of lazy 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
164423b42b Fix submodules crash 2025-10-02 13:22:54 -07:00
Pablo Galindo
20b14d9ca4 Syntax restrictions for lazy imports 2025-10-02 13:22:54 -07:00
Pablo Galindo
07a633f1f4 Draft: force * imports to be eager 2025-10-02 13:22:54 -07:00
Pablo Galindo
73de8d0928 Add global flag 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
44a3e46770 fix offset in addr2line 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
f3f5795e31 Fix recursive lazy imports and error path in bytecodes.c 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
f9880bfd5f More fixes 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
e0878bedf7 Remove copyright 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
03a419ac2d Fix reference and global dict in spezializing LOAD_GLOBAL 2025-10-02 13:22:54 -07:00
Pablo Galindo Salgado
6a911327d0 Implement better error 2025-10-02 13:22:54 -07:00
Dino Viehland
f992ee760e Import lazy.get 2025-10-02 13:22:54 -07:00
Dino Viehland
6d7c87a3fe Reify lazy objects when accessed via the module object 2025-10-02 13:22:54 -07:00
Dino Viehland
058bc6e884 Flow import func through to lazy imports object and __lazy_import__ 2025-10-02 13:22:54 -07:00
Dino Viehland
41ab092407 Add compatiblity mode 2025-10-02 13:22:53 -07:00
Dino Viehland
de281fd894 Add lazy import filter 2025-10-02 13:22:53 -07:00
Dino Viehland
9eef03cc80 Export lazy_import in imp module 2025-10-02 13:22:53 -07:00
Dino Viehland
3b0d745e73 Add __lazy_import__, check sys.modules before import 2025-10-02 13:22:53 -07:00
Dino Viehland
1c691ea756 Lazy imports grammar / AST changes 2025-10-02 13:22:53 -07:00
Alex Willmer
fb114cf497
gh-139495: Fix hashlib.file_digest() versionchanged description of BlockingIOError (GH-139496)
* Fix `hashlib.file_digest()` versionchanged description of `BlockingIOError`

The sentence was missing a negation and contradicted the other two
descriptions in the same commit. I believe code behaviour is correct.

* fixup! Fix `hashlib.file_digest()` versionchanged description of `BlockingIOError`

* Remove unncessary NEWS.d entry
2025-10-02 12:50:36 -07:00
Victor Stinner
af01b46866
gh-139322: Remove redundant test_os.Win32ErrorTests (#139477)
test_os.OSErrorTests already covers the OSError class and is more
complete than Win32ErrorTests.
2025-10-02 20:46:25 +02:00
Victor Stinner
9bf69659e1
gh-55258: Reenable support test_get_original_stdout() (#139499) 2025-10-02 18:10:36 +02:00
Victor Stinner
ea4027e179
gh-139504: Catch BrokenPipeError in ssl test_client_sigalgs_mismatch() (#139505)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-02 18:08:29 +02:00
Victor Stinner
16da633dfe
Remove @tiran from CODEOWNERS (#139513)
Christian Heimes is now inactive for 2 years.
2025-10-02 18:05:37 +02:00
Victor Stinner
8797e1a8c3
gh-77476: Remove urllib HTTP test (#139502)
Remove test_sites_no_connection_close() which is skipped since 2018
(commit 36d56ea826).
2025-10-02 17:30:08 +02:00
Eric Snow
46a1f0a9ff
gh-135944: Add a "Runtime Components" Section to the Execution Model Docs (gh-135945)
The section provides a brief overview of the Python runtime's execution environment.  It is meant to be implementation agnostic,
2025-10-02 09:13:22 -06:00
Victor Stinner
6826ebf986
gh-89745: Remove test_embed.test_init_read_set() (#139500)
Since Python 3.11, it's no longer possible to call PyConfig_Read() to
get the path configuration, and then modify the path configuration.
2025-10-02 16:52:10 +02:00
Adam Turner
60655cd6fa
GH-123299: Copyedit 3.14 What's New: Other Language Changes (#139425) 2025-10-02 15:51:48 +01:00
Victor Stinner
c985822d86
gh-135329: Use longer timeout in pyrepl test_repl_eio() (#139503)
Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
2025-10-02 16:44:02 +02:00
Peter
f3d7faeafa
gh-139487: add missing imports for standalone doctest Enum examples (#139488) 2025-10-02 12:28:29 +02:00
ivonastojanovic
75b1afe562
gh-135953: Add Gecko reporter to sampling profiler (#139364)
Signed-off-by: Pablo Galindo Salgado <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-10-01 21:18:54 +01:00
Kumar Aditya
76b07c035c
gh-116946: partial revert gh-139073 for thread handle type (#139474) 2025-10-01 17:49:31 +00:00
Victor Stinner
0158890005
gh-139322: Create test_os package (#139453)
* Move test_posix.py and test_os.py to Lib/test/test_os/.
* Split Windows specific test cases to a new test_windows.py file.
2025-10-01 16:42:45 +02:00