Skip to content

bpo-32107 - Fix test_uuid #4494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ebbaa22
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
941b47d
Return None instead of 0
warsaw Nov 21, 2017
803ddd8
bpo-31324: Optimize support._match_test() (#4421)
vstinner Nov 21, 2017
e529214
Never return a locally administered MAC address
warsaw Nov 22, 2017
bb11c3c
bpo-31324: Fix test.support.set_match_tests(None) (#4505)
vstinner Nov 22, 2017
8265627
bpo-27535: Optimize warnings.warn() (#4508)
vstinner Nov 22, 2017
d434110
bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)
vstinner Nov 22, 2017
20d48a4
bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)
csabella Nov 23, 2017
0784a2e
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Jesse-Bakker Nov 23, 2017
e32e79f
bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)
vstinner Nov 23, 2017
1f15111
bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)
vstinner Nov 23, 2017
5ad7ef8
bpo-28538: Revert all the changes (now using Android Unified Headers)…
xdegaye Nov 23, 2017
c06c22e
bpo-29040: Support building Android with Unified Headers (GH-4492)
xdegaye Nov 23, 2017
5ce1069
bpo-28762: Revert last commit (now using Android Unified Headers) (GH…
xdegaye Nov 23, 2017
bdb8315
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
berkerpeksag Nov 23, 2017
24c4db2
Several sleep-improved fixes
warsaw Nov 23, 2017
c056584
A missed return
warsaw Nov 23, 2017
7fd446e
Two typos
warsaw Nov 23, 2017
0327bde
bpo-32030: Rewrite calculate_path() (#4521)
vstinner Nov 23, 2017
b98f171
bpo-27535: Cleanup create_filter() (#4516)
vstinner Nov 23, 2017
b919795
bpo-32030: Fix calculate_path() on macOS (#4526)
vstinner Nov 23, 2017
6a54c67
bpo-31979: Remove unused align_maxchar() function (#4527)
vstinner Nov 23, 2017
dcaed6b
bpo-19610: setup() now raises TypeError for invalid types (GH-4519)
berkerpeksag Nov 23, 2017
0858495
bpo-32099 Add deque variant of roundrobin() recipe (#4497)
rhettinger Nov 23, 2017
3df02db
bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529)
berkerpeksag Nov 23, 2017
cdfe910
Extending Python Doc minor updates (GH-4518)
lelit Nov 24, 2017
4864a61
bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)
berkerpeksag Nov 24, 2017
9e87e77
bpo-32096: Remove obj and mem from _PyRuntime (#4532)
vstinner Nov 24, 2017
19fb134
bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539)
berkerpeksag Nov 24, 2017
0f86cd3
bpo-28684: asyncio tests handle PermissionError raised on binding uni…
xdegaye Nov 24, 2017
78a5722
Improve the String tutorial docs (GH-4541)
Nov 24, 2017
5742f67
bpo-28684: Remove useless import added by the previous commit (GH-4547)
xdegaye Nov 24, 2017
da9c8c3
bpo-32125: Remove Py_UseClassExceptionsFlag flag (#4544)
vstinner Nov 24, 2017
84c4b19
bpo-32124: Document C functions safe before init (#4540)
vstinner Nov 24, 2017
46972b7
bpo-32030: Add _PyMainInterpreterConfig_ReadEnv() (#4542)
vstinner Nov 24, 2017
f04ebe2
bpo-32030: Add _PyMainInterpreterConfig.program_name (#4548)
vstinner Nov 24, 2017
f8802d8
Asyncion-Dev docs: Fix the reference to sys.excepthook (GH-4414)
ashwoods Nov 24, 2017
706cb31
bpo-32128: Skip test_nntplib.test_article_head_body() (#4552)
vstinner Nov 25, 2017
9316ee4
bpo-32030: Add _PyPathConfig_Init() (#4551)
vstinner Nov 25, 2017
610e5af
bpo-30004: Fix the code example of using group in Regex Howto Docs (G…
mandeep Nov 25, 2017
9d5ec80
Improve Scheduler Objects documentation. (GH-4556)
Mariatta Nov 25, 2017
8d9bb11
bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)
berkerpeksag Nov 25, 2017
fb2c2f2
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
5b48dc6
bpo-32071: Add unittest -k option (#4496)
jonashaag Nov 25, 2017
cfa797c
bpo-24641: Improved error message for JSON unserializible keys. (#4364)
serhiy-storchaka Nov 25, 2017
77f5139
bpo-32059: setup.py now also searches the sysroot paths (GH-4452)
xdegaye Nov 25, 2017
76fdac4
bpo-26856: Skip test_pwd on Android until issue 32033 is fixed (GH-4561)
xdegaye Nov 25, 2017
cef88b9
mark fatal_error as noreturn (#4563)
benjaminp Nov 25, 2017
53efbf3
bpo-11063: Handle uuid.h being in default include path (GH-4565)
ncoghlan Nov 26, 2017
4274609
bpo-32096: Ensure new embedding test can find the encodings module (G…
ncoghlan Nov 26, 2017
a6fba9b
bpo-32126: Skip asyncio test when sem_open() is not functional (GH-4559)
xdegaye Nov 26, 2017
99e86b2
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
74702e3
bpo-32107: Remove the check of the multicast bit in test_uuid.
serhiy-storchaka Nov 26, 2017
d8d6b91
bpo-30487: automatically create a venv and install Sphinx when runnin…
cjrh Nov 26, 2017
0cd2e81
bpo-29879: Update typing documentation. (GH-4573)
ilevkivskyi Nov 26, 2017
ede2ac9
bpo-23033: Improve SSL Certificate handling (GH-937)
daxlab Nov 26, 2017
41adbad
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
d3d0465
Return None instead of 0
warsaw Nov 21, 2017
7c17cd8
Never return a locally administered MAC address
warsaw Nov 22, 2017
511fab0
Several sleep-improved fixes
warsaw Nov 23, 2017
af7929c
A missed return
warsaw Nov 23, 2017
51ba0b3
Two typos
warsaw Nov 23, 2017
909ee79
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
6acb120
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
b7d647c
Merge branch 'test_uuid' of github.com:warsaw/cpython into test_uuid
warsaw Nov 26, 2017
26db2f5
Merge branch 'test-uuid-multicast-bit' of https://github.com/serhiy-s…
warsaw Nov 26, 2017
18a96ce
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
83dc3a3
Return None instead of 0
warsaw Nov 21, 2017
fb156f3
Never return a locally administered MAC address
warsaw Nov 22, 2017
3e8e17d
Several sleep-improved fixes
warsaw Nov 23, 2017
668f4f6
A missed return
warsaw Nov 23, 2017
6eecb80
Two typos
warsaw Nov 23, 2017
87712f3
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
740393e
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
225b063
bpo-32107: Remove the check of the multicast bit in test_uuid.
serhiy-storchaka Nov 26, 2017
5b8ca90
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
2aa4f50
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
71ab3b5
Merge branch 'test_uuid' of github.com:warsaw/cpython into test_uuid
warsaw Nov 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ matrix:
# (Updating the version is fine as long as no warnings are raised by doing so.)
- python -m pip install sphinx~=1.6.1 blurb
script:
- make check suspicious html SPHINXOPTS="-q -W -j4"
- make check suspicious html SPHINXBUILD="sphinx-build" SPHINXOPTS="-q -W -j4"
- os: linux
language: c
compiler: gcc
Expand Down
12 changes: 7 additions & 5 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PA

.PHONY: help build html htmlhelp latex text changes linkcheck \
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
autobuild-dev autobuild-stable venv
autobuild-dev autobuild-stable

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -39,7 +39,7 @@ help:
@echo " check to run a check for frequent markup errors"
@echo " serve to serve the documentation on the localhost (8000)"

build:
build: venv
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
Expand Down Expand Up @@ -122,9 +122,11 @@ clean:
-rm -rf build/* $(VENVDIR)/*

venv:
$(PYTHON) -m venv $(VENVDIR)
$(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
@echo "The venv has been created in the $(VENVDIR) directory"
@if [ "$(SPHINXBUILD)" == "PATH=$(VENVDIR)/bin:$$PATH sphinx-build" ]; then \
$(PYTHON) -m venv $(VENVDIR); \
echo "A virtual environment for Docs has been made in the $(VENVDIR) directory"; \
$(VENVDIR)/bin/python3 -m pip install Sphinx blurb; \
fi

dist:
rm -rf dist
Expand Down
39 changes: 23 additions & 16 deletions Doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,16 @@ tree but are maintained separately and are available from
* `Sphinx <https://pypi.org/project/Sphinx/>`_
* `blurb <https://pypi.org/project/blurb/>`_

The easiest way to install these tools is to create a virtual environment and
install the tools into there.
You could manually create a virtual environment and install them, but there is
a ``Makefile`` already set up to do this for you, as long as you have a working
Python 3 interpreter available.


Using make
----------

To get started on UNIX, you can create a virtual environment with the command ::

make venv

That will install all the tools necessary to build the documentation. Assuming
the virtual environment was created in the ``env`` directory (the default;
configurable with the VENVDIR variable), you can run the following command to
build the HTML output files::
A Makefile has been prepared so that (on Unix), after you change into the
``Doc/`` directory you can simply run ::

make html

Expand All @@ -44,8 +39,17 @@ look for instances of sphinxbuild and blurb installed on your process PATH
(configurable with the SPHINXBUILD and BLURB variables).

On Windows, we try to emulate the Makefile as closely as possible with a
``make.bat`` file. If you need to specify the Python interpreter to use,
set the PYTHON environment variable instead.
``make.bat`` file.

To use a Python interpreter that's not called ``python3``, use the standard
way to set Makefile variables, using e.g. ::

make html PYTHON=python

On Windows, set the PYTHON environment variable instead.

To use a specific sphinx-build (something other than ``sphinx-build``), set
the SPHINXBUILD variable.

Available make targets are:

Expand Down Expand Up @@ -104,11 +108,14 @@ Available make targets are:
Without make
------------

First, install the tool dependencies from PyPI.

Then, from the ``Doc`` directory, run ::
Install the Sphinx package and its dependencies from PyPI. In this situation,
you'll have to create a virtual environment manually, and install Sphinx into
it. Change into the ``Doc`` directory and run ::

sphinx-build -b<builder> . build/<builder>
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install Sphinx
(venv) $ sphinx-build -b<builder> . build/<builder>

where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
see the make targets above).
Expand Down
215 changes: 212 additions & 3 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,213 @@
Initialization, Finalization, and Threads
*****************************************

.. _pre-init-safe:

Before Python Initialization
============================

In an application embedding Python, the :c:func:`Py_Initialize` function must
be called before using any other Python/C API functions; with the exception of
a few functions and the :ref:`global configuration variables
<global-conf-vars>`.

The following functions can be safely called before Python is initialized:

* Configuration functions:

* :c:func:`PyImport_AppendInittab`
* :c:func:`PyImport_ExtendInittab`
* :c:func:`PyInitFrozenExtensions`
* :c:func:`PyMem_SetAllocator`
* :c:func:`PyMem_SetupDebugHooks`
* :c:func:`PyObject_SetArenaAllocator`
* :c:func:`Py_SetPath`
* :c:func:`Py_SetProgramName`
* :c:func:`Py_SetPythonHome`
* :c:func:`Py_SetStandardStreamEncoding`

* Informative functions:

* :c:func:`PyMem_GetAllocator`
* :c:func:`PyObject_GetArenaAllocator`
* :c:func:`Py_GetBuildInfo`
* :c:func:`Py_GetCompiler`
* :c:func:`Py_GetCopyright`
* :c:func:`Py_GetPlatform`
* :c:func:`Py_GetProgramName`
* :c:func:`Py_GetVersion`

* Utilities:

* :c:func:`Py_DecodeLocale`

* Memory allocators:

* :c:func:`PyMem_RawMalloc`
* :c:func:`PyMem_RawRealloc`
* :c:func:`PyMem_RawCalloc`
* :c:func:`PyMem_RawFree`

.. note::

The following functions **should not be called** before
:c:func:`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix` and
:c:func:`Py_GetProgramFullPath` and :c:func:`Py_GetPythonHome`.


.. _global-conf-vars:

Global configuration variables
==============================

Python has variables for the global configuration to control different features
and options. By default, these flags are controlled by :ref:`command line
options <using-on-interface-options>`.

When a flag is set by an option, the value of the flag is the number of times
that the option was set. For example, ``-b`` sets :c:data:`Py_BytesWarningFlag`
to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. c:var:: Py_BytesWarningFlag

Issue a warning when comparing :class:`bytes` or :class:`bytearray` with
:class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater
or equal to ``2``.

Set by the :option:`-b` option.

.. c:var:: Py_DebugFlag

Turn on parser debugging output (for expert only, depending on compilation
options).

Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment
variable.

.. c:var:: Py_DontWriteBytecodeFlag

If set to non-zero, Python won't try to write ``.pyc`` files on the
import of source modules.

Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE`
environment variable.

.. c:var:: Py_FrozenFlag

Suppress error messages when calculating the module search path in
:c:func:`Py_GetPath`.

Private flag used by ``_freeze_importlib`` and ``frozenmain`` programs.

.. c:var:: Py_HashRandomizationFlag

Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to
a non-empty string.

If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment
variable to initialize the secret hash seed.

.. c:var:: Py_IgnoreEnvironmentFlag

Ignore all :envvar:`PYTHON*` environment variables, e.g.
:envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set.

Set by the :option:`-E` and :option:`-I` options.

.. c:var:: Py_InspectFlag

When a script is passed as first argument or the :option:`-c` option is used,
enter interactive mode after executing the script or the command, even when
:data:`sys.stdin` does not appear to be a terminal.

Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment
variable.

.. c:var:: Py_InteractiveFlag

Set by the :option:`-i` option.

.. c:var:: Py_IsolatedFlag

Run Python in isolated mode. In isolated mode :data:`sys.path` contains
neither the script's directory nor the user's site-packages directory.

Set by the :option:`-I` option.

.. versionadded:: 3.4

.. c:var:: Py_LegacyWindowsFSEncodingFlag

If the flag is non-zero, use the ``mbcs`` encoding instead of the UTF-8
encoding for the filesystem encoding.

Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
variable is set to a non-empty string.

See :pep:`529` for more details.

Availability: Windows.

.. c:var:: Py_LegacyWindowsStdioFlag

If the flag is non-zero, use :class:`io.FileIO` instead of
:class:`WindowsConsoleIO` for :mod:`sys` standard streams.

Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment
variable is set to a non-empty string.

See :pep:`528` for more details.

Availability: Windows.

.. c:var:: Py_NoSiteFlag

Disable the import of the module :mod:`site` and the site-dependent
manipulations of :data:`sys.path` that it entails. Also disable these
manipulations if :mod:`site` is explicitly imported later (call
:func:`site.main` if you want them to be triggered).

Set by the :option:`-S` option.

.. c:var:: Py_NoUserSiteDirectory

Don't add the :data:`user site-packages directory <site.USER_SITE>` to
:data:`sys.path`.

Set by the :option:`-s` and :option:`-I` options, and the
:envvar:`PYTHONNOUSERSITE` environment variable.

.. c:var:: Py_OptimizeFlag

Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment
variable.

.. c:var:: Py_QuietFlag

Don't display the copyright and version messages even in interactive mode.

Set by the :option:`-q` option.

.. versionadded:: 3.2

.. c:var:: Py_UnbufferedStdioFlag

Force the stdout and stderr streams to be unbuffered.

Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED`
environment variable.

.. c:var:: Py_VerboseFlag

Print a message each time a module is initialized, showing the place
(filename or built-in module) from which it is loaded. If greater or equal
to ``2``, print a message for each file that is checked for when
searching for a module. Also provides information on module cleanup at exit.

Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment
variable.


Initializing and finalizing the interpreter
===========================================
Expand All @@ -27,9 +234,11 @@ Initializing and finalizing the interpreter
single: PySys_SetArgvEx()
single: Py_FinalizeEx()

Initialize the Python interpreter. In an application embedding Python, this
should be called before using any other Python/C API functions; with the
exception of :c:func:`Py_SetProgramName`, :c:func:`Py_SetPythonHome` and :c:func:`Py_SetPath`. This initializes
Initialize the Python interpreter. In an application embedding Python,
this should be called before using any other Python/C API functions; see
:ref:`Before Python Initialization <pre-init-safe>` for the few exceptions.

This initializes
the table of loaded modules (``sys.modules``), and creates the fundamental
modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It also initializes
the module search path (``sys.path``). It does not set ``sys.argv``; use
Expand Down
4 changes: 4 additions & 0 deletions Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ the full reference.
See the :func:`setup` function for a list of keyword arguments accepted by the
Distribution constructor. :func:`setup` creates a Distribution instance.

.. versionchanged:: 3.7
:class:`~distutils.core.Distribution` now raises a :exc:`TypeError` if
``classifiers``, ``keywords`` and ``platforms`` fields are not specified
as a list.

.. class:: Command

Expand Down
Loading