Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 Doc/library/colorsys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spaces, the coordinates are all between 0 and 1.
.. seealso::

More information about color spaces can be found at
https://poynton.ca/ColorFAQ.html and
https://www.poynton.ca/pdf/ColourFAQ.pdf and
https://www.cambridgeincolour.com/tutorials/color-spaces.htm.

The :mod:`!colorsys` module defines the following functions:
Expand Down
1 change: 1 addition & 0 deletions Doc/library/importlib.metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ collection of :ref:`EntryPoint <entry-points>` objects.

You can get the :ref:`metadata for a distribution <metadata>`::

>>> from importlib.metadata import metadata # doctest: +SKIP
>>> list(metadata('wheel')) # doctest: +SKIP
['Metadata-Version', 'Name', 'Version', 'Summary', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Project-URL', 'Project-URL', 'Project-URL', 'Keywords', 'Platform', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Requires-Python', 'Provides-Extra', 'Requires-Dist', 'Requires-Dist']

Expand Down
31 changes: 31 additions & 0 deletions Doc/using/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,37 @@ checking for that feed.
}


Proxy Settings
--------------

.. versionadded:: 26.4

By default, the Python install manager will use your system-wide proxy settings,
including automatic authentication. For most users, this behaves the same as
your browser and other applications.

To override the settings, use the ``NO_PROXY``, ``HTTP_PROXY`` and
``HTTPS_PROXY`` environment variables. These should be set in the terminal
session before using the Python install manager. Other applications may also
use the variables, so use caution before setting them globally for your entire
machine.

Setting ``NO_PROXY`` to any non-empty value will disable the use of any proxy.
Use this to bypass your system's default proxy setting and attempt to access the
index server directly.

Setting ``HTTPS_PROXY`` to a string like ``example.com:8080`` will connect to
that proxy server for all HTTPS connections. For the default index, all
connections will be using HTTPS, and so this is the usual setting to override.

The ``HTTP_PROXY`` variable may be needed if you are using a private index
server that does not use encrypted connections, but does require the default
proxy server to be overridden. It follows the same format as ``HTTPS_PROXY``.

Credentials may be embedded in either setting, however, when ``HTTPS_PROXY`` has
credentials embedded they will be used in preference to other credentials. Only
one set of credentials will be used for both types of proxy.

.. _pymanager-troubleshoot:

Troubleshooting
Expand Down
4 changes: 2 additions & 2 deletions Include/cpython/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
#ifdef _Py_TYPEOF
#define Py_SETREF(dst, src) \
do { \
_Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(&(dst)) _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
*_tmp_dst_ptr = (src); \
Py_DECREF(_tmp_old_dst); \
Expand All @@ -374,7 +374,7 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
#ifdef _Py_TYPEOF
#define Py_XSETREF(dst, src) \
do { \
_Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(&(dst)) _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
*_tmp_dst_ptr = (src); \
Py_XDECREF(_tmp_old_dst); \
Expand Down
11 changes: 7 additions & 4 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,18 @@ extern "C" {
//
// Example: _Py_TYPEOF(x) x_copy = (x);
//
// On C23, use typeof(). Otherwise __typeof__() if on GCC, clang or
// MSVC 17.9 and newer. Else if on C++11 or newer, decltype() is used.
// On C23, use typeof(). On C++11, use decltype(). Otherwise, use __typeof__()
// if on GCC, clang or MSVC 17.9 and newer.
//
// On MSVC, check also _MSVC_LANG since __cplusplus is 199711L unless
// the /Zc:__cplusplus flag is used.
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
# define _Py_TYPEOF(expr) typeof(expr)
#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSVC_LANG >= 201103L)
# define _Py_TYPEOF(expr) decltype(expr)
#elif defined(__GNUC__) || defined(__clang__) || \
(defined(_MSC_VER) && _MSC_VER >= 1939)
# define _Py_TYPEOF(expr) __typeof__(expr)
#elif defined(__cplusplus) && __cplusplus >= 201103L
# define _Py_TYPEOF(expr) decltype(expr)
#endif


Expand Down
2 changes: 1 addition & 1 deletion Include/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
#ifdef _Py_TYPEOF
#define Py_CLEAR(op) \
do { \
_Py_TYPEOF(op)* _tmp_op_ptr = &(op); \
_Py_TYPEOF(&(op)) _tmp_op_ptr = &(op); \
_Py_TYPEOF(op) _tmp_old_op = (*_tmp_op_ptr); \
if (_tmp_old_op != _Py_NULL) { \
*_tmp_op_ptr = _Py_NULL; \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support os.getrandom() when building Python with old glibc versions and recent Linux kernel (glibc 2.25 or older and Linux kernel 3.17 or newer). Get the syscall number from kernel headers, rather than glibc headers.
3 changes: 3 additions & 0 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
#ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h> // syscall(), __NR_xxx syscall numbers
#endif
#if !defined(SYS_getrandom) && defined(__NR_getrandom)
# define SYS_getrandom __NR_getrandom
#endif

#ifdef HAVE_POSIX_SPAWN
# include <spawn.h> // posix_spawn()
Expand Down
5 changes: 4 additions & 1 deletion Python/bootstrap_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
# include <sys/random.h> // getrandom()
# endif
# if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)
# include <sys/syscall.h> // SYS_getrandom
# include <sys/syscall.h> // __NR_getrandom, SYS_getrandom
# if !defined(SYS_getrandom) && defined(__NR_getrandom)
# define SYS_getrandom __NR_getrandom
# endif
# endif
#endif

Expand Down
6 changes: 5 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7895,7 +7895,11 @@ AC_LINK_IFELSE(
#include <stddef.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/random.h>
#include <linux/random.h> // GRND_NONBLOCK

#if !defined(SYS_getrandom) && defined(__NR_getrandom)
# define SYS_getrandom __NR_getrandom
#endif

int main(void) {
char buffer[1];
Expand Down
Loading