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

Skip to content

Commit cd2a603

Browse files
committed
Branch merge
2 parents bd249c1 + 89dfd5c commit cd2a603

15 files changed

Lines changed: 55 additions & 46 deletions

File tree

Doc/distutils/apiref.rst

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,9 @@ This module provides the following functions.
449449
Define a preprocessor macro for all compilations driven by this compiler object.
450450
The optional parameter *value* should be a string; if it is not supplied, then
451451
the macro will be defined without an explicit value and the exact outcome
452-
depends on the compiler used (XXX true? does ANSI say anything about this?)
452+
depends on the compiler used.
453+
454+
.. XXX true? does ANSI say anything about this?
453455
454456
455457
.. method:: CCompiler.undefine_macro(name)
@@ -603,7 +605,9 @@ This module provides the following functions.
603605

604606
*output_libname* should be a library name, not a filename; the filename will be
605607
inferred from the library name. *output_dir* is the directory where the library
606-
file will be put. XXX defaults to what?
608+
file will be put.
609+
610+
.. XXX defaults to what?
607611
608612
*debug* is a boolean; if true, debugging information will be included in the
609613
library (note that on most platforms, it is the compile step where this matters:
@@ -723,30 +727,29 @@ This module provides the following functions.
723727

724728
Invokes :func:`distutils.util.execute` This method invokes a Python function
725729
*func* with the given arguments *args*, after logging and taking into account
726-
the *dry_run* flag. XXX see also.
730+
the *dry_run* flag.
727731

728732

729733
.. method:: CCompiler.spawn(cmd)
730734

731735
Invokes :func:`distutils.util.spawn`. This invokes an external process to run
732-
the given command. XXX see also.
736+
the given command.
733737

734738

735739
.. method:: CCompiler.mkpath(name[, mode=511])
736740

737741
Invokes :func:`distutils.dir_util.mkpath`. This creates a directory and any
738-
missing ancestor directories. XXX see also.
742+
missing ancestor directories.
739743

740744

741745
.. method:: CCompiler.move_file(src, dst)
742746

743-
Invokes :meth:`distutils.file_util.move_file`. Renames *src* to *dst*. XXX see
744-
also.
747+
Invokes :meth:`distutils.file_util.move_file`. Renames *src* to *dst*.
745748

746749

747750
.. method:: CCompiler.announce(msg[, level=1])
748751

749-
Write a message using :func:`distutils.log.debug`. XXX see also.
752+
Write a message using :func:`distutils.log.debug`.
750753

751754

752755
.. method:: CCompiler.warn(msg)
@@ -874,8 +877,6 @@ tarballs or zipfiles.
874877
prefix of all files and directories in the archive. *root_dir* and *base_dir*
875878
both default to the current directory. Returns the name of the archive file.
876879

877-
.. XXX This should be changed to support bz2 files.
878-
879880

880881
.. function:: make_tarball(base_name, base_dir[, compress='gzip', verbose=0, dry_run=0])
881882

@@ -887,8 +888,6 @@ tarballs or zipfiles.
887888
possibly plus the appropriate compression extension (:file:`.gz`, :file:`.bz2`
888889
or :file:`.Z`). Return the output filename.
889890

890-
.. XXX This should be replaced with calls to the :mod:`tarfile` module.
891-
892891

893892
.. function:: make_zipfile(base_name, base_dir[, verbose=0, dry_run=0])
894893

@@ -1000,8 +999,6 @@ directories.
1000999
errors are ignored (apart from being reported to ``sys.stdout`` if *verbose* is
10011000
true).
10021001

1003-
.. XXX Some of this could be replaced with the shutil module?
1004-
10051002

10061003
:mod:`distutils.file_util` --- Single file operations
10071004
=====================================================
@@ -1115,8 +1112,6 @@ other utility module.
11151112

11161113
* ``macosx-10.6-intel``
11171114

1118-
.. % XXX isn't this also provided by some other non-distutils module?
1119-
11201115

11211116
.. function:: convert_path(pathname)
11221117

@@ -1321,8 +1316,6 @@ provides the following additional features:
13211316
the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
13221317
command line sets *verbose* to false.
13231318

1324-
.. XXX Should be replaced with optparse
1325-
13261319
.. function:: fancy_getopt(options, negative_opt, object, args)
13271320

13281321
Wrapper function. *options* is a list of ``(long_option, short_option,
@@ -1338,9 +1331,6 @@ provides the following additional features:
13381331

13391332
Wraps *text* to less than *width* wide.
13401333

1341-
.. XXX Should be replaced with :mod:`textwrap` (which is available in Python
1342-
2.3 and later).
1343-
13441334

13451335
.. class:: FancyGetopt([option_table=None])
13461336

@@ -1403,10 +1393,6 @@ filesystem and building lists of files.
14031393
:synopsis: A simple logging mechanism, 282-style
14041394

14051395

1406-
.. XXX Should be replaced with standard :mod:`logging` module.
1407-
1408-
1409-
14101396
:mod:`distutils.spawn` --- Spawn a sub-process
14111397
==============================================
14121398

Doc/extending/embedding.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ it.
271271

272272
To find out the required compiler and linker flags, you can execute the
273273
:file:`python{X.Y}-config` script which is generated as part of the
274-
installation process (a generic :file:`python3-config` script is also
274+
installation process (a :file:`python3-config` script may also be
275275
available). This script has several options, of which the following will
276276
be directly useful to you:
277277

@@ -294,9 +294,10 @@ be directly useful to you:
294294
example.
295295

296296
If this procedure doesn't work for you (it is not guaranteed to work for
297-
all Unix-like platforms; however, we welcome bug reports at
298-
http://bugs.python.org), you will have to read your system's documentation
299-
about dynamic linking and/or examine Python's Makefile and compilation
297+
all Unix-like platforms; however, we welcome :ref:`bug reports <reporting-bugs>`)
298+
you will have to read your system's documentation about dynamic linking and/or
299+
examine Python's :file:`Makefile` (use :func:`sysconfig.get_makefile_filename`
300+
to find its location) and compilation
300301
options. In this case, the :mod:`sysconfig` module is a useful tool to
301302
programmatically extract the configuration values that you will want to
302303
combine together::

Doc/library/archiving.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Data Compression and Archiving
66

77
The modules described in this chapter support data compression with the zlib,
88
gzip, and bzip2 algorithms, and the creation of ZIP- and tar-format archives.
9+
See also :ref:`archiving-operations` provided by the :mod:`shutil` module.
910

1011

1112
.. toctree::

Doc/library/bz2.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ This module provides a comprehensive interface for the bz2 compression library.
1212
It implements a complete file interface, one-shot (de)compression functions, and
1313
types for sequential (de)compression.
1414

15-
For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and
16-
:mod:`tarfile` modules.
17-
1815
Here is a summary of the features offered by the bz2 module:
1916

2017
* :class:`BZ2File` class implements a complete file interface, including

Doc/library/gzip.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ Note that additional file formats which can be decompressed by the
2121
:program:`gzip` and :program:`gunzip` programs, such as those produced by
2222
:program:`compress` and :program:`pack`, are not supported by this module.
2323

24-
For other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
25-
:mod:`tarfile` modules.
26-
2724
The module defines the following items:
2825

2926

Doc/library/json.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ Basic Usage
125125
:class:`bytes` objects. Therefore, ``fp.write()`` must support :class:`str`
126126
input.
127127

128+
If *ensure_ascii* is ``True`` (the default), the output is guaranteed to
129+
have all incoming non-ASCII characters escaped. If *ensure_ascii* is
130+
``False``, these characters will be output as-is.
131+
128132
If *check_circular* is ``False`` (default: ``True``), then the circular
129133
reference check for container types will be skipped and a circular reference
130134
will result in an :exc:`OverflowError` (or worse).

Doc/library/shutil.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ copying and removal. For operations on individual files, see also the
3131
are not copied.
3232

3333

34+
.. _file-operations:
35+
3436
Directory and files operations
3537
------------------------------
3638

@@ -181,7 +183,7 @@ Directory and files operations
181183
(*srcname*, *dstname*, *exception*).
182184

183185

184-
.. _shutil-example:
186+
.. _shutil-copytree-example:
185187

186188
copytree example
187189
::::::::::::::::
@@ -248,6 +250,9 @@ Another example that uses the *ignore* argument to add a logging call::
248250
Archiving operations
249251
--------------------
250252

253+
High-level utilities to create and read compressed and archived files are also
254+
provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
255+
251256
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]])
252257

253258
Create an archive file (such as zip or tar) and return its name.
@@ -375,6 +380,7 @@ Archiving operations
375380
.. versionadded:: 3.2
376381

377382

383+
.. _shutil-archiving-example:
378384

379385
Archiving example
380386
:::::::::::::::::
@@ -400,5 +406,3 @@ The resulting archive contains::
400406
-rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa
401407
-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub
402408
-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts
403-
404-

Doc/library/tarfile.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
The :mod:`tarfile` module makes it possible to read and write tar
1616
archives, including those using gzip or bz2 compression.
17-
(:file:`.zip` files can be read and written using the :mod:`zipfile` module.)
17+
Use the :mod:`zipfile` module to read or write :file:`.zip` files, or the
18+
higher-level functions in :ref:`shutil <archiving-operations>`.
1819

1920
Some facts and figures:
2021

Doc/library/zipfile.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ decryption of encrypted files in ZIP archives, but it currently cannot
2323
create an encrypted file. Decryption is extremely slow as it is
2424
implemented in native Python rather than C.
2525

26-
For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
27-
:mod:`tarfile` modules.
28-
2926
The module defines the following items:
3027

3128
.. exception:: BadZipFile

Doc/library/zlib.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ order. This documentation doesn't attempt to cover all of the permutations;
1818
consult the zlib manual at http://www.zlib.net/manual.html for authoritative
1919
information.
2020

21-
For reading and writing ``.gz`` files see the :mod:`gzip` module. For
22-
other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
23-
:mod:`tarfile` modules.
21+
For reading and writing ``.gz`` files see the :mod:`gzip` module.
2422

2523
The available exception and functions in this module are:
2624

0 commit comments

Comments
 (0)