- Using the file role with {placeholders} is IMO clearer than fake
Python code.
- The fact that sys.version[:3] gives '2.7' is a CPython detail and
should not be advertised (see #9442), even if some stdlib modules
currently rely on that detail.
than a Python module (e.g. "__init__.py"): don't close the file twice.
PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
Apart from adding a section to describe the user scheme, this changeset
also does some much needed cleanup:
- fixed inverted reST targets
- fixed some paths
- avoided duplicating the same options listing five or six times
- added missing entries for C headers locations
- added documentation for --install-lib
- fixed a few misuses of the option role (see #9312), but not all (not
worth the time, but will do it in packaging docs)
- fixed some markup
The paths fixes were done with an eye on the source code in the install
command, so they really describe what’s actually done. The situation on
Mac OS X is rather messy: the fix for #8084 touched site and sysconfig,
but distutils does not use these files anymore since the Great Revert.
I suspect we have a mismatched stdlib at the moment, and the fix is not
even clear (see discussion on #8084).
site.USER_BASE and site.USER_SITE are now fully documented. PEP 370 is
outdated with respects to the Mac framework situation, but the code in
sysconfig and the example in the 3.2 What’s New document helped me find
the right values to document for Mac OS X.
The command-line interface of the site module is also described in the
module docs.
The purpose of the usercustomize module is explained in the site docs,
with a gentle introduction in the tutorial (right after the section that
talks about PYTHONSTARTUP; a comment mentions it should be moved from
the tutorial to another file, but that will be another bug).
Various markup and wording improvements were made along the way in the
site module docs. Duplicate and incomplete declarations of environment
variables have also been removed (the original bug report was actually
about these entries :). The site module docs are still a bit messy;
I’ll see about improving them for #11553.
All these sections are copiously interlinked and findable from the doc
indexes.
This update includes new entries that apply to 2.7 too, mention of class
decorators, mention of nonlocal, notes about bytecode, markup fixes and
some rewrappings. Future backports of changes should be slightly
easier.
No change was necessary to make the file build, contrary to cporting.rst
that uses markup like :c:func: that needs to be changed to :cfunc: in
2.7. Future backports should be straightforward.
Georg added this role in our 3.2 doc tools and gave the greenlight for a
backport on python-dev.
This code is a simplified version of the 3.2 code; the version of Sphinx
used with Python 2.7 doesn’t have the function used to parse markup like
:role:`text to be displayed <text to be processed>` (I was persuaded it
was a standard reST construct, but it is actually a Sphinx innovation
that has to be supported explicitly in role code —I’ll be damned). It
is thus not possible to write for example :source:`the NEWS file
<Misc/NEWS>`, but :source:`Misc/NEWS` will work.
The changed behavior of sdist in 2.7 broke packaging for projects that
wanted to use a manually-maintained MANIFEST file (instead of having a
MANIFEST.in template and letting distutils generate the MANIFEST).
The fixes that were committed for #8688 (d29399100973 by Tarek and
f7639dcdffc3 by me) did not fix all issues exposed in the bug report,
and also added one problem: the MANIFEST file format gained comments,
but the read_manifest method was not updated to handle (i.e. ignore)
them. This changeset should fix everything; the tests have been
expanded and I successfully tested with Mercurial, which suffered from
this regression.
I have grouped the versionchanged directives for these bugs in one place
and added micro version numbers to help users know the quirks of the
exact version they’re using. I also removed a stanza in the docs that
was forgotten in Tarek’s first changeset.
Initial report, thorough diagnosis and patch by John Dennis, further
work on the patch by Stephen Thorne, and a few edits and additions by
me.