See also Compile CPython on Windows.
Python developer mode¶
Strict developer mode:
PYTHONMALLOC=debug python3.6 -Werror -bb -X faulthandler script.py
PYTHONMALLOC=debug python3.6 -Wd -b -X faulthandler script.py
faulthandlerto get a Python traceback on segfault and fatal errors:
python -X faulthandler
- Debug hooks on Python memory allocators:
- Enable Python assertions (assert) and set
True: remove (or just ignore) -O or -OO command line arguments
PYTHONASYNCIODEBUG=1 for asyncio.
=> implementated in Python 3.7 as: “python3 -X dev” or PYTHONDEVMODE=1 !
- https://status.python.org/ Status of services maintained by the Python infra team
- PSF pays a full-time sysadmin to maintain the Python infra: XXX
- Managed services: http://infra.psf.io/overview/#details-of-various-services
- http://www.pythontest.net/ used by the test suite, see https://github.com/python/pythontestdotnet/
Services used by unit tests¶
- pythontestdotnet: source of pythontest.net (resources used for Python test suite).
- test_urllib2net: http://www.pythontest.net/index.html#frag, tcp/80 (HTTP)
- FTP: ftp://www.pythontest.net/README
- Copies of unicode text files like http://www.pythontest.net/unicode/EUC-CN.TXT
- test_hashlib test files like http://www.pythontest.net/hashlib/blake2b.txt
- test_httplib: self-signed.pythontest.net, tcp/443 (HTTPS)
- test_robotparser: http://www.pythontest.net/elsewhere/robots.txt
- test_socket: испытание.pythontest.net
# Testing connect timeout is tricky: we need to have IP connectivity # to a host that silently drops our packets. We can't simulate this # from Python because it's a function of the underlying TCP/IP stack. # So, the following Snakebite host has been defined: blackhole = resolve_address('blackhole.snakebite.net', 56666) # Blackhole has been configured to silently drop any incoming packets. # No RSTs (for TCP) or ICMP UNREACH (for UDP/ICMP) will be sent back # to hosts that attempt to connect to this address: which is exactly # what we need to confidently test connect timeout. # However, we want to prevent false positives. It's not unreasonable # to expect certain hosts may not be able to reach the blackhole, due # to firewalling or general network configuration. In order to improve # our confidence in testing the blackhole, a corresponding 'whitehole' # has also been set up using one port higher: whitehole = resolve_address('whitehole.snakebite.net', 56667)
- Used by test_nntplib
- NNTP (tcp/119) and and NNTP/SSL (tcp/563)
- Server administrator: email@example.com
- test_ssl uses it to test IPv6: HTTP (tcp/80) and HTTPS (tcp/443)
- test_ssl uses it to test x509 certificate signed by SHA256: HTTPS (tcp/443)
Package Index (PyPI)¶
cpython GitHub project¶
- GitHub uses mention-bot: https://github.com/facebook/mention-bot
- http://bugs.python.org/ Bug tracker (modified instance of Roundup)
- Mailing lists: https://mail.python.org/mailman/listinfo
- lot of Special Interest Groups (SIG)
- GitHub CLA bot: XXX
Update dependencies: https://github.com/python/cpython-source-deps/blob/master/README.rst
See my external_versions.py script: external version of embedded libraries from CPython source code (locally).
On security branches, some dependencies are outdated because no more macOS nor Windows installer is built. It was decided to not upgrade outdated zlib 1.2.5 in Python 3.3.7, since it’s specific to Windows, and no Windows user is expected to build his/her own Python 3.3 anymore.
Modules/_ctypes/libffi/: copy of libffi
- Removed from Python 3.7: https://bugs.python.org/issue27979
Modules/_ctypes/libffi_osx/: libffi for macOS?
grep PACKAGE_VERSION Modules/_ctypes/libffi_osx/include/fficonfig.h
- Python 2.7-3.6 uses libffi 2.1
Modules/_ctypes/libffi_msvc/: libffi for Windows (for Microsoft Visual Studio)?
- Version: second line of
- Python 2.7-3.6 use libffi 2.0 beta, copied from ctypes-0.9.9.4 in 2006
- Version: second line of
Modules/expat/: copy of libexpat
- Rationale: https://mail.python.org/pipermail/python-dev/2017-June/148287.html
- Used on Windows and macOS, Linux distributions use system libexpat
- Version: search for
- Script to update it: see attached script to https://bugs.python.org/issue30947
- Recent update: https://bugs.python.org/issue30947
- Python 2.7, 3.3-3.6 use libexpat 2.2.1
Modules/zlib/: copy of zlib
- Only used on Windows (system zlib is used on macOS and Linux)
- Python zlib module not built if system zlib is older than 1.1.3
- Script to update it: XXX
- Recent update: https://bugs.python.org/issue29169
- Python 2.7, 3.4 and 3.5, 3.6 use zlib 1.2.11
- Python 3.3 uses zlib 1.2.5: https://github.com/python/cpython/pull/3108
Modules/_decimal/libmpdec/: copy of libmpdec
- Included since Python 3.3 for _decimal
- Maintained by Stefan Krah
- Used on all platforms
- Script to update: XXX
- Recent update: https://bugs.python.org/issue26621
- Python 3.6 uses libmpdec 2.4.2 (released at february 2016)
- Python 3.4 and 3.5 uses libmpdec 2.4.1
- Python 3.3 uses libmpdec 2.4.0
- Windows and macOS installers include OpenSSL (binary library)
- Windows version: search for
- macOS version: search for
- See: http://python-security.readthedocs.io/ssl.html#openssl-versions
- See: https://www.python.org/dev/peps/pep-0543/
- Windows version: search for
- Windows and macOS installers include SQLite
- Recent update: https://bugs.python.org/issue28791
- macOS: search for
- Windows: search for
PEP 11 lists removal of supported platforms:
- MS-DOS: 2014: bpo-22591: Drop support of MS-DOS (DJGPP compiler), commit b71c7dc9
- Python 3.4: VMS, OS/2, Windows 2000
- Python 3.7: IRIX
PEP 11 on Windows:
CPython’s Windows support now follows [Microsoft product support lifecycle]. A new feature release X.Y.0 will support all Windows releases whose extended support phase is not yet expired. Subsequent bug fix releases will support the same Windows releases as the original feature release (even if the extended support phase has ended).
- Windows Supported Versions in Python
(in the Python development
- Windows Vista support dropped in Python 3.7
- Windows XP support dropped in Python 3.5
- Windows 2000 support dropped in Python 3.4
- bpo-23451, 2015-03: “Python 3.5 now requires Windows Vista or newer”. See change1 and change2.
- Python 2.7 supports Windows XP and newer
- Python 3.7 dropped support for FreeBSD 9 and older.
- FreeBSD 9 buildbot wokers have been removed in 2017
Well supported platforms on Python 3.6 and 2.7:
- Windows: Vista and newer for Python 3.6, XP and newer for Python 2.7
- macOS: XXX min version?
Tested by Travis CI and buildbots.
Supported platform with best effort support:
- Android API 24
- Solaris, OpenIndiana
Platforms not supported officially: