Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa73a1c

Browse files
committed
Issue #17222: Document that py_compile now uses importlib for its file
writing and thus its semantics.
1 parent 3b965a2 commit aa73a1c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/library/py_compile.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ byte-code cache files in the directory containing the source code.
2828

2929
.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1)
3030

31-
Compile a source file to byte-code and write out the byte-code cache file.
31+
Compile a source file to byte-code and write out the byte-code cache file.
3232
The source code is loaded from the file name *file*. The byte-code is
3333
written to *cfile*, which defaults to the :PEP:`3147` path, ending in
3434
``.pyc`` (``.pyo`` if optimization is enabled in the current interpreter).
@@ -50,6 +50,11 @@ byte-code cache files in the directory containing the source code.
5050
default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
5151
Also added the *optimize* parameter.
5252

53+
.. versionchanged:: 3.4
54+
Changed code to use :mod:`importlib` for the byte-code cache file writing.
55+
This means file creation/writing semantics now match what :mod:`importlib`
56+
does, e.g. permissions, write-and-move semantics, etc.
57+
5358

5459
.. function:: main(args=None)
5560

0 commit comments

Comments
 (0)