From 2bddc53cb96baa9ba799915c82648e0fa4318632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:34:58 +0100 Subject: Fix typo (#13467) --- Doc/library/sysconfig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst index 5b2509a..c47dcce 100644 --- a/Doc/library/sysconfig.rst +++ b/Doc/library/sysconfig.rst @@ -130,7 +130,7 @@ identifier. Python currently uses eight paths: one may call this function and get the default value. If *scheme* is provided, it must be a value from the list returned by - :func:`get_path_names`. Otherwise, the default scheme for the current + :func:`get_scheme_names`. Otherwise, the default scheme for the current platform is used. If *vars* is provided, it must be a dictionary of variables that will update -- cgit v0.12 From a2b89e364f863d9dab51c32aefb934c511a19e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:36:17 +0100 Subject: Fix last remaining references to ex-devguide --- Lib/locale.py | 3 +-- Misc/python.man | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/locale.py b/Lib/locale.py index d9dbce6..d2a885d 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -1598,8 +1598,7 @@ locale_alias = { # to include every locale up to Windows Vista. # # NOTE: this mapping is incomplete. If your language is missing, please -# submit a bug report to Python bug manager, which you can find via: -# http://www.python.org/dev/ +# submit a bug report to the Python bug tracker at http://bugs.python.org/ # Make sure you include the missing language identifier and the suggested # locale code. # diff --git a/Misc/python.man b/Misc/python.man index 0921e4c..3dca604 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -420,7 +420,7 @@ Main website: http://www.python.org/ .br Documentation: http://docs.python.org/py3k/ .br -Developer resources: http://www.python.org/dev/ +Developer resources: http://docs.python.org/devguide/ .br Downloads: http://python.org/download/ .br -- cgit v0.12 From ff913061270d85f9f6a01a2bbbf74fe3852c89ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:45:07 +0100 Subject: Add a regrtest cleanup check for shutil registries --- Lib/test/regrtest.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index cbbf1ca..c3d2a2b 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -165,6 +165,7 @@ import os import platform import random import re +import shutil import sys import sysconfig import tempfile @@ -887,6 +888,7 @@ class saved_test_environment: 'os.environ', 'sys.path', 'sys.path_hooks', '__import__', 'warnings.filters', 'asyncore.socket_map', 'logging._handlers', 'logging._handlerList', + 'shutil.archive_formats', 'shutil.unpack_formats', 'sys.warnoptions', 'threading._dangling', 'multiprocessing.process._dangling') @@ -956,6 +958,23 @@ class saved_test_environment: asyncore.close_all(ignore_all=True) asyncore.socket_map.update(saved_map) + def get_shutil_archive_formats(self): + # we could call get_archives_formats() but that only returns the + # registry keys; we want to check the values too (the functions that + # are registered) + return shutil._ARCHIVE_FORMATS, shutil._ARCHIVE_FORMATS.copy() + def restore_shutil_archive_formats(self, saved): + shutil._ARCHIVE_FORMATS = saved[0] + shutil._ARCHIVE_FORMATS.clear() + shutil._ARCHIVE_FORMATS.update(saved[1]) + + def get_shutil_unpack_formats(self): + return shutil._UNPACK_FORMATS, shutil._UNPACK_FORMATS.copy() + def restore_shutil_unpack_formats(self, saved): + shutil._UNPACK_FORMATS = saved[0] + shutil._UNPACK_FORMATS.clear() + shutil._UNPACK_FORMATS.update(saved[1]) + def get_logging__handlers(self): # _handlers is a WeakValueDictionary return id(logging._handlers), logging._handlers, logging._handlers.copy() -- cgit v0.12 From e1886bfaf43383d481566b2c6a317f2f7c0b2b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:45:34 +0100 Subject: Fix instructions on how to rebuild some modules --- Lib/keyword.py | 2 +- Lib/symbol.py | 2 +- Lib/token.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/keyword.py b/Lib/keyword.py index a3788a6..dad39cc 100755 --- a/Lib/keyword.py +++ b/Lib/keyword.py @@ -7,7 +7,7 @@ This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: - python Lib/keyword.py + ./python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] diff --git a/Lib/symbol.py b/Lib/symbol.py index e3fff34..679e5c8 100755 --- a/Lib/symbol.py +++ b/Lib/symbol.py @@ -7,7 +7,7 @@ # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # -# python Lib/symbol.py +# ./python Lib/symbol.py #--start constants-- single_input = 256 diff --git a/Lib/token.py b/Lib/token.py index 7e2bfcf..7ddd35e 100755 --- a/Lib/token.py +++ b/Lib/token.py @@ -7,7 +7,7 @@ __all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # -# python Lib/token.py +# ./python Lib/token.py #--start constants-- ENDMARKER = 0 -- cgit v0.12 From c4d7d8c49d3a78fc7eeb19588a9f44a74bec71e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:46:38 +0100 Subject: Mark up constants in sockets docs as such --- Doc/library/socket.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 64b4183..ef81c4d 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -64,20 +64,20 @@ Socket addresses are represented as follows: tuple, and the fields depend on the address type. The general tuple form is ``(addr_type, v1, v2, v3 [, scope])``, where: - - *addr_type* is one of TIPC_ADDR_NAMESEQ, TIPC_ADDR_NAME, or - TIPC_ADDR_ID. - - *scope* is one of TIPC_ZONE_SCOPE, TIPC_CLUSTER_SCOPE, and - TIPC_NODE_SCOPE. - - If *addr_type* is TIPC_ADDR_NAME, then *v1* is the server type, *v2* is + - *addr_type* is one of :const:`TIPC_ADDR_NAMESEQ`, :const:`TIPC_ADDR_NAME`, + or :const:`TIPC_ADDR_ID`. + - *scope* is one of :const:`TIPC_ZONE_SCOPE`, :const:`TIPC_CLUSTER_SCOPE`, and + :const:`TIPC_NODE_SCOPE`. + - If *addr_type* is :const:`TIPC_ADDR_NAME`, then *v1* is the server type, *v2* is the port identifier, and *v3* should be 0. - If *addr_type* is TIPC_ADDR_NAMESEQ, then *v1* is the server type, *v2* + If *addr_type* is :const:`TIPC_ADDR_NAMESEQ`, then *v1* is the server type, *v2* is the lower port number, and *v3* is the upper port number. - If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the + If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the reference, and *v3* should be set to 0. - If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the + If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the reference, and *v3* should be set to 0. - Certain other address families (:const:`AF_BLUETOOTH`, :const:`AF_PACKET`) -- cgit v0.12 From a74f8ef419d2c7c5f398a80165f8d8fd5e4d7b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 29 Nov 2011 16:58:53 +0100 Subject: Fix inspect.getmodule to use a copy of sys.modules for iteration (#13487). This fixes a regression compared to 2.x, where sys.modules.items() returns a copy, as indicated by a comment in the source. Diagnosis and patch by Erik Tollerud. --- Lib/inspect.py | 2 +- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index bb46ea6..4e17f1b 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -483,7 +483,7 @@ def getmodule(object, _filename=None): return sys.modules.get(modulesbyfile[file]) # Update the filename to module name cache and check yet again # Copy sys.modules in order to cope with changes while iterating - for modname, module in sys.modules.items(): + for modname, module in list(sys.modules.items()): if ismodule(module) and hasattr(module, '__file__'): f = module.__file__ if f == _filesbymodname.get(modname, None): diff --git a/Misc/ACKS b/Misc/ACKS index 5d75404..4effde3 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -905,6 +905,7 @@ Christian Tismer Frank J. Tobin R Lindsay Todd Bennett Todd +Erik Tollerud Matias Torchinsky Sandro Tosi Richard Townsend diff --git a/Misc/NEWS b/Misc/NEWS index f79e57a..2172853 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -87,6 +87,9 @@ Core and Builtins Library ------- +- Issue #13487: Make inspect.getmodule robust against changes done to + sys.modules while it is iterating over it. + - Issue #12618: Fix a bug that prevented py_compile from creating byte compiled files in the current directory. Initial patch by Sjoerd de Vries. -- cgit v0.12