diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 7f06648bcb4572f..647f7c4b2f81407 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -509,8 +509,7 @@ Process-wide parameters Return the platform identifier for the current platform. On Unix, this is formed from the "official" name of the operating system, converted to lower - case, followed by the major revision number; e.g., for Solaris 2.x, which is - also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, it is + case, followed by the major revision number. On Mac OS X, it is ``'darwin'``. On Windows, it is ``'win'``. The returned string points into static storage; the caller should not modify its value. The value is available to Python code as ``sys.platform``. diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index b14197c2f94dbab..0d1a2b297dcd090 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -1115,7 +1115,6 @@ other utility module. * ``linux-i586`` * ``linux-alpha`` - * ``solaris-2.6-sun4u`` For non-POSIX platforms, currently just returns ``sys.platform``. diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index ec2c12806b41608..5c5ff38b5c3e3cb 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -466,14 +466,6 @@ unexpected, or if other problems occur while reading the file, instantiating a .. deprecated-removed:: 3.8 3.10 -Solaris message catalog support -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The Solaris operating system defines its own binary :file:`.mo` file format, but -since no documentation can be found on this format, it is not supported at this -time. - - The Catalog constructor ^^^^^^^^^^^^^^^^^^^^^^^ @@ -722,7 +714,7 @@ implementations, and valuable experience to the creation of this module: .. rubric:: Footnotes .. [#] The default locale directory is system dependent; for example, on RedHat Linux - it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`. + it is :file:`/usr/share/locale`. The :mod:`gettext` module does not try to support these system dependent defaults; instead its default is :file:`{sys.base_prefix}/share/locale` (see :data:`sys.base_prefix`). For this reason, it is always best to call diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 718d98138d26794..1bf504cb8ce4bf5 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2663,14 +2663,6 @@ features: Time of file creation. - On Solaris and derivatives, the following attributes may also be - available: - - .. attribute:: st_fstype - - String that uniquely identifies the type of the filesystem that - contains the file. - On Mac OS systems, the following attributes may also be available: .. attribute:: st_rsize @@ -2735,6 +2727,10 @@ features: files as :const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate. + .. versionadded:: 3.10 + Removed the :attr:`st_fstype` member of Solaris/derivatives. + + .. function:: statvfs(path) Perform a :c:func:`statvfs` system call on the given path. The return value is diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 8e8e3775aaff4a1..01f76126bc4ef20 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -72,9 +72,8 @@ Cross Platform may look different on different platforms and this is intended. If *aliased* is true, the function will use aliases for various platforms that - report system names which differ from their common names, for example SunOS will - be reported as Solaris. The :func:`system_alias` function is used to implement - this. + report system names which differ from their common names. The + :func:`system_alias` function is used to implement this. Setting *terse* to true causes the function to return only the absolute minimum information needed to identify the platform. diff --git a/Doc/library/posix.rst b/Doc/library/posix.rst index 2105af9215f7694..5e4bfd29cd4c855 100644 --- a/Doc/library/posix.rst +++ b/Doc/library/posix.rst @@ -37,7 +37,7 @@ Large File Support .. sectionauthor:: Steve Clift -Several operating systems (including AIX, HP-UX, Irix and Solaris) provide +Several operating systems (including AIX) provide support for files that are larger than 2 GiB from a C programming model where :c:type:`int` and :c:type:`long` are 32-bit values. This is typically accomplished by defining the relevant size and offset types as 64-bit values. Such files are @@ -47,11 +47,7 @@ Large file support is enabled in Python when the size of an :c:type:`off_t` is larger than a :c:type:`long` and the :c:type:`long long` is at least as large as an :c:type:`off_t`. It may be necessary to configure and compile Python with certain compiler flags -to enable this mode. For example, it is enabled by default with recent versions -of Irix, but with Solaris 2.6 and 2.7 you need to do something like:: - - CFLAGS="`getconf LFS_CFLAGS`" OPT="-g -O2 $CFLAGS" \ - ./configure +to enable this mode. On large-file-capable Linux systems, this might work:: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 468a30d326891b1..934a2ebda523582 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1121,7 +1121,7 @@ always available. For Unix systems, except on Linux and AIX, this is the lowercased OS name as returned by ``uname -s`` with the first part of the version as returned by - ``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time + ``uname -r`` appended, e.g. ``'freebsd8'``, *at the time when Python was built*. Unless you want to test for a specific system version, it is therefore recommended to use the following idiom:: @@ -1561,7 +1561,6 @@ always available. | | | | | * ``'nt'``: Windows threads | | | * ``'pthread'``: POSIX threads | - | | * ``'solaris'``: Solaris threads | +------------------+---------------------------------------------------------+ | :const:`lock` | Name of the lock implementation: | | | | diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst index 78a1dfce9ae05cd..05a566151e02f9c 100644 --- a/Doc/library/sysconfig.rst +++ b/Doc/library/sysconfig.rst @@ -181,7 +181,6 @@ Other functions - linux-i586 - linux-alpha (?) - - solaris-2.6-sun4u Windows will return one of: diff --git a/Doc/library/time.rst b/Doc/library/time.rst index cff6320b526db56..f37d3bc4d993edb 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -685,7 +685,7 @@ Functions >>> time.strftime('%X %x %Z') '16:08:12 05/08/03 AEST' - On many Unix systems (including \*BSD, Linux, Solaris, and Darwin), it is more + On many Unix systems (including \*BSD, Linux, and Darwin), it is more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) database to specify the timezone rules. To do this, set the :envvar:`TZ` environment variable to the path of the required timezone datafile, relative to the root of @@ -726,17 +726,6 @@ These constants are used as parameters for :func:`clock_getres` and .. versionadded:: 3.7 -.. data:: CLOCK_HIGHRES - - The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal - hardware source, and may give close to nanosecond resolution. - ``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock. - - .. availability:: Solaris. - - .. versionadded:: 3.3 - - .. data:: CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some unspecified diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst index c0a5643fc2c2429..49ebb5a797e76a6 100644 --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -54,13 +54,6 @@ On FreeBSD and OpenBSD pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz -On OpenSolaris --------------- - -You can get Python from `OpenCSW `_. Various versions -of Python are available and can be installed with e.g. ``pkgutil -i python27``. - - .. _building-python-on-unix: Building Python diff --git a/Include/pyport.h b/Include/pyport.h index 7137006870bf014..99b6f10fad3643c 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -581,11 +581,6 @@ Please be conservative with adding new ones, document them and enclose them in platform-specific #ifdefs. **************************************************************************/ -#ifdef SOLARIS -/* Unchecked */ -extern int gethostname(char *, int); -#endif - #ifdef HAVE__GETPTY #include /* we need to import mode_t */ extern char * _getpty(int *, int, mode_t, int); diff --git a/Lib/cgi.py b/Lib/cgi.py index 77ab703cc036004..31e2872fe639695 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -1,8 +1,8 @@ #! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is -# intentionally NOT "/usr/bin/env python". On many systems -# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI +# intentionally NOT "/usr/bin/env python". On many systems, +# /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env would be unable to find python. Granted, # binary installations by Linux vendors often install Python in diff --git a/Lib/ctypes/test/test_byteswap.py b/Lib/ctypes/test/test_byteswap.py index 01c97e83ca7af68..61d0208a7928abe 100644 --- a/Lib/ctypes/test/test_byteswap.py +++ b/Lib/ctypes/test/test_byteswap.py @@ -238,7 +238,7 @@ def test_struct_fields_2(self): # So, we have to align using pad bytes. # # Unaligned accesses will crash Python (on those platforms that - # don't allow it, like sparc solaris). + # don't allow it, like sparc). if sys.byteorder == "little": base = BigEndianStructure fmt = ">bxhid" diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 0c2510e1619c8ed..d9510547f64a216 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -149,46 +149,27 @@ def _findLib_gcc(name): return os.fsdecode(file) - if sys.platform == "sunos5": - # use /usr/ccs/bin/dump on solaris - def _get_soname(f): - if not f: - return None - - try: - proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f), - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL) - except OSError: # E.g. command not found - return None - with proc: - data = proc.stdout.read() - res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data) - if not res: - return None - return os.fsdecode(res.group(1)) - else: - def _get_soname(f): - # assuming GNU binutils / ELF - if not f: - return None - objdump = shutil.which('objdump') - if not objdump: - # objdump is not available, give up - return None + def _get_soname(f): + # assuming GNU binutils / ELF + if not f: + return None + objdump = shutil.which('objdump') + if not objdump: + # objdump is not available, give up + return None - try: - proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f), - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL) - except OSError: # E.g. bad executable - return None - with proc: - dump = proc.stdout.read() - res = re.search(br'\sSONAME\s+([^\s]+)', dump) - if not res: - return None - return os.fsdecode(res.group(1)) + try: + proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f), + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + except OSError: # E.g. bad executable + return None + with proc: + dump = proc.stdout.read() + res = re.search(br'\sSONAME\s+([^\s]+)', dump) + if not res: + return None + return os.fsdecode(res.group(1)) if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")): @@ -224,47 +205,6 @@ def find_library(name): res.sort(key=_num_version) return os.fsdecode(res[-1]) - elif sys.platform == "sunos5": - - def _findLib_crle(name, is64): - if not os.path.exists('/usr/bin/crle'): - return None - - env = dict(os.environ) - env['LC_ALL'] = 'C' - - if is64: - args = ('/usr/bin/crle', '-64') - else: - args = ('/usr/bin/crle',) - - paths = None - try: - proc = subprocess.Popen(args, - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL, - env=env) - except OSError: # E.g. bad executable - return None - with proc: - for line in proc.stdout: - line = line.strip() - if line.startswith(b'Default Library Path (ELF):'): - paths = os.fsdecode(line).split()[4] - - if not paths: - return None - - for dir in paths.split(":"): - libfile = os.path.join(dir, "lib%s.so" % name) - if os.path.exists(libfile): - return libfile - - return None - - def find_library(name, is64 = False): - return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) - else: def _findSoname_ldconfig(name): diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py index 014871d280edb57..87bd0973c9733f2 100644 --- a/Lib/distutils/command/bdist.py +++ b/Lib/distutils/command/bdist.py @@ -56,7 +56,7 @@ class bdist(Command): no_format_option = ('bdist_rpm',) # This won't do in reality: will need to distinguish RPM-ish Linux, - # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS. + # Debian-ish Linux, FreeBSD, ..., Windows, Mac OS. default_format = {'posix': 'gztar', 'nt': 'zip'} diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 23b907b607efad9..040340704ec9f61 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -58,7 +58,7 @@ def setUp(self): self.tempdirs = [] def tearDown(self): - # Restore working dir, for Solaris and derivatives, where rmdir() + # Restore working dir, for Windows, where rmdir() # on the current directory fails. os.chdir(self.old_cwd) super().tearDown() diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index f9e0d766d870e04..70106c20d414f37 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -112,27 +112,6 @@ def test_xx(self): """) assert_python_ok('-c', code) - def test_solaris_enable_shared(self): - dist = Distribution({'name': 'xx'}) - cmd = self.build_ext(dist) - old = sys.platform - - sys.platform = 'sunos' # fooling finalize_options - from distutils.sysconfig import _config_vars - old_var = _config_vars.get('Py_ENABLE_SHARED') - _config_vars['Py_ENABLE_SHARED'] = 1 - try: - cmd.ensure_finalized() - finally: - sys.platform = old - if old_var is None: - del _config_vars['Py_ENABLE_SHARED'] - else: - _config_vars['Py_ENABLE_SHARED'] = old_var - - # make sure we get some library dirs under solaris - self.assertGreater(len(cmd.library_dirs), 0) - def test_user_site(self): import site dist = Distribution({'name': 'xx'}) diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 4b002ecef1df8ff..eaea181ae044ff8 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -26,7 +26,6 @@ def get_host_platform(): Examples of returned values: linux-i586 linux-alpha (?) - solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) @@ -68,16 +67,6 @@ def get_host_platform(): # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) - elif osname[:5] == "sunos": - if release[0] >= "5": # SunOS 5 == Solaris 2 - osname = "solaris" - release = "%d.%s" % (int(release[0]) - 3, release[2:]) - # We can't use "platform.architecture()[0]" because a - # bootstrap problem. We use a dict to get an error - # if some suspicious happens. - bitness = {2147483647:"32bit", 9223372036854775807:"64bit"} - machine += ".%s" % bitness[sys.maxsize] - # fall through to standard osname-release-machine representation elif osname[:3] == "aix": from _aix_support import aix_platform return aix_platform() diff --git a/Lib/gettext.py b/Lib/gettext.py index 77b67aef4204c90..13b48ee36ed86d5 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -41,9 +41,6 @@ # to do binary searches and lazy initializations. Or you might want to use # the undocumented double-hash algorithm for .mo files with hash tables, but # you'll need to study the GNU gettext code to do this. -# -# - Support Solaris .mo file formats. Unfortunately, we've been unable to -# find this format documented anywhere. import os diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 867ef4ebc7600a0..f3c6ff2bd1251df 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -745,7 +745,6 @@ class SysLogHandler(logging.Handler): LOG_NTP = 12 # NTP subsystem LOG_SECURITY = 13 # Log audit LOG_CONSOLE = 14 # Log alert - LOG_SOLCRON = 15 # Scheduling daemon (Solaris) # other codes through 15 reserved for system use LOG_LOCAL0 = 16 # reserved for local use @@ -785,7 +784,6 @@ class SysLogHandler(logging.Handler): "news": LOG_NEWS, "ntp": LOG_NTP, "security": LOG_SECURITY, - "solaris-cron": LOG_SOLCRON, "syslog": LOG_SYSLOG, "user": LOG_USER, "uucp": LOG_UUCP, diff --git a/Lib/platform.py b/Lib/platform.py index e9f50ab622d3169..07f4fa4392dba53 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -502,29 +502,7 @@ def system_alias(system, release, version): where it would otherwise cause confusion. """ - if system == 'SunOS': - # Sun's OS - if release < '5': - # These releases use the old name SunOS - return system, release, version - # Modify release (marketing release = SunOS release - 3) - l = release.split('.') - if l: - try: - major = int(l[0]) - except ValueError: - pass - else: - major = major - 3 - l[0] = str(major) - release = '.'.join(l) - if release < '6': - system = 'Solaris' - else: - # XXX Whatever the new SunOS marketing name is... - system = 'Solaris' - - elif system == 'IRIX64': + if system == 'IRIX64': # IRIX reports IRIX64 on platforms with 64-bit support; yet it # is really a version and not a different platform, since 32-bit # apps are also supported.. @@ -1180,8 +1158,7 @@ def platform(aliased=0, terse=0): If "aliased" is true, the function will use aliases for various platforms that report system names which differ from - their common names, e.g. SunOS will be reported as - Solaris. The system_alias() function is used to implement + their common names. The system_alias() function is used to implement this. Setting terse to true causes the function to return only the diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 6c87b06634c4579..7bbc92121986d4f 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -618,7 +618,6 @@ def get_platform(): Examples of returned values: linux-i586 linux-alpha (?) - solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) @@ -658,16 +657,6 @@ def get_platform(): # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) - elif osname[:5] == "sunos": - if release[0] >= "5": # SunOS 5 == Solaris 2 - osname = "solaris" - release = "%d.%s" % (int(release[0]) - 3, release[2:]) - # We can't use "platform.architecture()[0]" because a - # bootstrap problem. We use a dict to get an error - # if some suspicious happens. - bitness = {2147483647:"32bit", 9223372036854775807:"64bit"} - machine += ".%s" % bitness[sys.maxsize] - # fall through to standard osname-release-machine representation elif osname[:3] == "aix": from _aix_support import aix_platform return aix_platform() diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py index 4d3dbd8e83f5a9b..dea28232d81f470 100644 --- a/Lib/test/fork_wait.py +++ b/Lib/test/fork_wait.py @@ -5,8 +5,8 @@ We want fork1() semantics -- only the forking thread survives in the child after a fork(). -On some systems (e.g. Solaris without posix threads) we find that all -active threads survive in the child after a fork(); this is an error. +On some systems, we find that all active threads survive in the child +after a fork(); this is an error. """ import os, sys, time, unittest diff --git a/Lib/test/subprocessdata/fd_status.py b/Lib/test/subprocessdata/fd_status.py index d12bd95abee61ce..fa4aee8ecb5bd42 100644 --- a/Lib/test/subprocessdata/fd_status.py +++ b/Lib/test/subprocessdata/fd_status.py @@ -28,7 +28,4 @@ if e.errno == errno.EBADF: continue raise - # Ignore Solaris door files - if not stat.S_ISDOOR(st.st_mode): - fds.append(fd) print(','.join(map(str, fds))) diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py index 59a00bad7d98a3d..22a97db967e471c 100644 --- a/Lib/test/test__locale.py +++ b/Lib/test/test__locale.py @@ -28,30 +28,6 @@ def setUpModule(): global candidate_locales - # Issue #13441: Skip some locales (e.g. cs_CZ and hu_HU) on Solaris to - # workaround a mbstowcs() bug. For example, on Solaris, the hu_HU locale uses - # the locale encoding ISO-8859-2, the thousands separator is b'\xA0' and it is - # decoded as U+30000020 (an invalid character) by mbstowcs(). - if sys.platform == 'sunos5': - old_locale = locale.setlocale(locale.LC_ALL) - try: - locales = [] - for loc in candidate_locales: - try: - locale.setlocale(locale.LC_ALL, loc) - except Error: - continue - encoding = locale.getpreferredencoding(False) - try: - localeconv() - except Exception as err: - print("WARNING: Skip locale %s (encoding %s): [%s] %s" - % (loc, encoding, type(err), err)) - else: - locales.append(loc) - candidate_locales = locales - finally: - locale.setlocale(locale.LC_ALL, old_locale) # Workaround for MSVC6(debug) crash bug if "MSC v.1200" in sys.version: diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 01c698653ec67e5..a30d9b9b4d9a012 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -446,12 +446,6 @@ def test_sendfile_ssl_close_peer_after_receiving(self): self.assertEqual(srv_proto.data, self.DATA) self.assertEqual(self.file.tell(), len(self.DATA)) - # On Solaris, lowering SO_RCVBUF on a TCP connection after it has been - # established has no effect. Due to its age, this bug affects both Oracle - # Solaris as well as all other OpenSolaris forks (unless they fixed it - # themselves). - @unittest.skipIf(sys.platform.startswith('sunos'), - "Doesn't work on Solaris") def test_sendfile_close_peer_in_the_middle_of_receiving(self): srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) with self.assertRaises(ConnectionError): diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 06c6bc2e99dc02a..4d3a2bd65b45fed 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -652,8 +652,6 @@ def writable(self): client = TestClient(self.family, server.address) self.loop_waiting_for_flag(client) - @unittest.skipIf(sys.platform.startswith("sunos"), - "OOB support is broken on Solaris") def test_handle_expt(self): # Make sure handle_expt is called on OOB data received. # Note: this might fail on some platforms as OOB data is diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index fa3329efa28b827..d0a4128f370c3fa 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -182,7 +182,7 @@ def test_undecodable_code(self): pattern = b"Unable to decode the command from the command line:" elif p.returncode == 0: # _Py_char2wchar() decoded b'\xff' as '\xff' even if the locale is - # C and the locale encoding is ASCII. It occurs on FreeBSD, Solaris + # C and the locale encoding is ASCII. It occurs on FreeBSD # and Mac OS X. pattern = b"'\\xff' " # The output is followed by the encoding name, an alias to ASCII. diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index cabc10da8365c3f..8e696a59c577c32 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -185,7 +185,7 @@ def test_window_funcs(self): stdscr.setscrreg(10,15) win3 = stdscr.subwin(10,10) win3 = stdscr.subwin(10,10, 5,5) - if hasattr(stdscr, 'syncok') and not sys.platform.startswith("sunos"): + if hasattr(stdscr, 'syncok'): stdscr.syncok(1) stdscr.timeout(5) stdscr.touchline(5,5) diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index ff611a90eede3bd..60cca5edcdac2e4 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -385,7 +385,7 @@ def testAbles(self): self.assertEqual(f.writable(), True) if sys.platform != "darwin" and \ 'bsd' not in sys.platform and \ - not sys.platform.startswith(('sunos', 'aix')): + not sys.platform.startswith('aix'): # Somehow /dev/tty appears seekable on some BSDs self.assertEqual(f.seekable(), False) self.assertEqual(f.isatty(), True) diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py index 18c81dda45c8c70..99962e1f10112d8 100644 --- a/Lib/test/test_importlib/import_/test_path.py +++ b/Lib/test/test_importlib/import_/test_path.py @@ -172,7 +172,7 @@ def test_deleted_cwd(self): try: os.rmdir(new_dir) except OSError: - # EINVAL on Solaris, EBUSY on AIX, ENOTEMPTY on Windows + # EBUSY on AIX, ENOTEMPTY on Windows self.skipTest("platform does not allow " "the deletion of the cwd") except: diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index bd08c4f3007fc7f..da4f7368ba38071 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -159,7 +159,7 @@ def _test_currency(self, value, out, **format_opts): class EnUSNumberFormatting(BaseFormattingTest): # XXX there is a grouping + padding bug when the thousands separator - # is empty but the grouping array contains values (e.g. Solaris 10) + # is empty but the grouping array contains values def setUp(self): self.sep = locale.localeconv()['thousands_sep'] diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 5126c84cf30c68b..1d61863de3c8e64 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -3158,9 +3158,7 @@ def handle_error(self): class TestSendfile(unittest.TestCase): DATA = b"12345abcde" * 16 * 1024 # 160 KiB - SUPPORT_HEADERS_TRAILERS = not sys.platform.startswith("linux") and \ - not sys.platform.startswith("solaris") and \ - not sys.platform.startswith("sunos") + SUPPORT_HEADERS_TRAILERS = not sys.platform.startswith("linux") requires_headers_trailers = unittest.skipUnless(SUPPORT_HEADERS_TRAILERS, 'requires headers and trailers support') requires_32b = unittest.skipUnless(sys.maxsize < 2**32, @@ -3260,14 +3258,8 @@ def test_send_at_certain_offset(self): def test_offset_overflow(self): # specify an offset > file size offset = len(self.DATA) + 4096 - try: - sent = os.sendfile(self.sockno, self.fileno, offset, 4096) - except OSError as e: - # Solaris can raise EINVAL if offset >= file length, ignore. - if e.errno != errno.EINVAL: - raise - else: - self.assertEqual(sent, 0) + sent = os.sendfile(self.sockno, self.fileno, offset, 4096) + self.assertEqual(sent, 0) self.client.shutdown(socket.SHUT_RDWR) self.client.close() self.server.wait() diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index f57c88234b5fed9..5be438663a81487 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -402,7 +402,7 @@ def test_posix_fallocate(self): # issue33655: Also ignore EINVAL on *BSD since ZFS is also # often used there. if inst.errno == errno.EINVAL and sys.platform.startswith( - ('sunos', 'freebsd', 'netbsd', 'openbsd', 'gnukfreebsd')): + ('freebsd', 'netbsd', 'openbsd', 'gnukfreebsd')): raise unittest.SkipTest("test may fail on ZFS filesystems") else: raise @@ -740,9 +740,8 @@ def check_stat(uid, gid): check_stat(big_value, big_value) chown_func(first_param, uid, gid) check_stat(uid, gid) - elif platform.system() in ('HP-UX', 'SunOS'): - # HP-UX and Solaris can allow a non-root user to chown() to root - # (issue #5113) + elif platform.system() == 'HP-UX': + # HP-UX can allow a non-root user to chown() to root (issue #5113) raise unittest.SkipTest("Skipping because of non-standard chown() " "behavior") else: diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 7ca0557800b6d8d..a87a670de146db3 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -103,10 +103,6 @@ def test_basic(self): self.assertTrue(os.isatty(slave_fd), 'slave_fd is not a tty') - # Solaris requires reading the fd before anything is returned. - # My guess is that since we open and close the slave fd - # in master_open(), we need to read the EOF. - # Ensure the fd is non-blocking in case there's nothing to read. blocking = os.get_blocking(master_fd) try: diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index 851b1fc1b9e0c49..c12c53417bf000c 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -469,7 +469,7 @@ def test_above_fd_setsize(self): rd, wr = self.make_socketpair() except OSError: # too many FDs, skip - note that we should only catch EMFILE - # here, but apparently *BSD and Solaris can fail upon connect() + # here, but apparently *BSD can fail upon connect() # or bind() with EADDRNOTAVAIL, so let's be safe self.skipTest("FD limit reached") diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 890f2c7d406c246..94a69c5616985f6 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -118,7 +118,7 @@ def rlistdir(path): return res def supports_file2file_sendfile(): - # ...apparently Linux and Solaris are the only ones + # ...apparently Linux is the only one if not hasattr(os, "sendfile"): return False srcname = None diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 67ac045330f3eba..91455eceb4e2664 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5129,10 +5129,6 @@ def test_create_connection(self): # create_connection() enumerates through all the addresses returned # and if it doesn't successfully bind to any of them, it propagates # the last exception it encountered. - # - # On Solaris, ENETUNREACH is returned in this circumstance instead - # of ECONNREFUSED. So, if that errno exists, add it to our list of - # expected errnos. expected_errnos = socket_helper.get_socket_conn_refused_errs() self.assertIn(cm.exception.errno, expected_errnos) diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index ec305e54ff24f0c..c52a9b54965a675 100644 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -187,8 +187,7 @@ class Y1900Tests(unittest.TestCase): def test_y_before_1900(self): # Issue #13674, #19634 t = (1899, 1, 1, 0, 0, 0, 0, 0, 0) - if (sys.platform == "win32" - or sys.platform.startswith(("aix", "sunos", "solaris"))): + if sys.platform == "win32" or sys.platform.startswith("aix"): with self.assertRaises(ValueError): time.strftime("%y", t) else: diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 30c29a26a992707..196fdbc24beb7cc 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -522,7 +522,7 @@ def test_attributes(self): def test_thread_info(self): info = sys.thread_info self.assertEqual(len(info), 3) - self.assertIn(info.name, ('nt', 'pthread', 'solaris', None)) + self.assertIn(info.name, ('nt', 'pthread', None)) self.assertIn(info.lock, ('semaphore', 'mutex+cond', None)) def test_43581(self): diff --git a/Lib/uuid.py b/Lib/uuid.py index 5ae0a3e5fa449d9..d3318a87307f3e8 100644 --- a/Lib/uuid.py +++ b/Lib/uuid.py @@ -528,11 +528,6 @@ def _arp_getnode(): except OSError: return None - # Try getting the MAC addr from arp based on our IP address (Solaris). - mac = _find_mac_near_keyword('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1) - if mac: - return mac - # This works on OpenBSD mac = _find_mac_near_keyword('arp', '-an', [os.fsencode(ip_addr)], lambda i: i+1) if mac: diff --git a/Modules/Setup b/Modules/Setup index 6f9bb813cef2732..885b286ef959894 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -274,8 +274,6 @@ _symtable symtablemodule.c # -I/usr/local/include \ # *** Uncomment and edit to reflect where your X11 header files are: # -I/usr/X11R6/include \ -# *** Or uncomment this for Solaris: -# -I/usr/openwin/include \ # *** Uncomment and edit for Tix extension only: # -DWITH_TIX -ltix8.1.8.2 \ # *** Uncomment and edit for BLT extension only: @@ -289,8 +287,6 @@ _symtable symtablemodule.c # -ltk8.2 -ltcl8.2 \ # *** Uncomment and edit to reflect where your X11 libraries are: # -L/usr/X11R6/lib \ -# *** Or uncomment this for Solaris: -# -L/usr/openwin/lib \ # *** Uncomment these for TOGL extension only: # -lGL -lGLU -lXext -lXmu \ # *** Uncomment for AIX: diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h index 1effccf9cc5ff93..460a0ccf4ecb4ac 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -1,7 +1,3 @@ -#if defined (__SVR4) && defined (__sun) -# include -#endif - #ifndef MS_WIN32 #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 34331017f85c7b9..e29c14ed9f90ff0 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -125,7 +125,7 @@ static const char PyCursesVersion[] = "2.2"; #include #endif -#if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(__sun) || defined(SCO5)) +#if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(SCO5)) #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ typedef chtype attr_t; /* No attr_t type is available */ #endif diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h index 277963bc1575bb4..3e8bc1bd83d9385 100644 --- a/Modules/_multiprocessing/multiprocessing.h +++ b/Modules/_multiprocessing/multiprocessing.h @@ -29,21 +29,6 @@ # endif #endif -/* - * Issue 3110 - Solaris does not define SEM_VALUE_MAX - */ -#ifndef SEM_VALUE_MAX - #if defined(HAVE_SYSCONF) && defined(_SC_SEM_VALUE_MAX) - # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX) - #elif defined(_SEM_VALUE_MAX) - # define SEM_VALUE_MAX _SEM_VALUE_MAX - #elif defined(_POSIX_SEM_VALUE_MAX) - # define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX - #else - # define SEM_VALUE_MAX INT_MAX - #endif -#endif - /* * Format codes diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index 5e5fbb2e79a7f82..137697e3d9856b3 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -44,17 +44,6 @@ # define VFORK_USABLE 1 #endif -#if defined(__sun) && defined(__SVR4) -/* readdir64 is used to work around Solaris 9 bug 6395699. */ -# define readdir readdir64 -# define dirent dirent64 -# if !defined(HAVE_DIRFD) -/* Some versions of Solaris lack dirfd(). */ -# define dirfd(dirp) ((dirp)->dd_fd) -# define HAVE_DIRFD -# endif -#endif - #if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) # define FD_DIR "/dev/fd" #else diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c index d99bed45bd6a239..5e06f7f5089d724 100644 --- a/Modules/errnomodule.c +++ b/Modules/errnomodule.c @@ -100,8 +100,7 @@ errno_exec(PyObject *module) /* * The names and comments are borrowed from linux/include/errno.h, - * which should be pretty all-inclusive. However, the Solaris specific - * names and comments are borrowed from sys/errno.h in Solaris. + * which should be pretty all-inclusive. * MacOSX specific names and comments are borrowed from sys/errno.h in * MacOSX. */ @@ -848,26 +847,6 @@ errno_exec(PyObject *module) add_errcode("ERFKILL", ERFKILL, "Operation not possible due to RF-kill"); #endif - /* Solaris-specific errnos */ -#ifdef ECANCELED - add_errcode("ECANCELED", ECANCELED, "Operation canceled"); -#endif -#ifdef ENOTSUP - add_errcode("ENOTSUP", ENOTSUP, "Operation not supported"); -#endif -#ifdef EOWNERDEAD - add_errcode("EOWNERDEAD", EOWNERDEAD, "Process died with the lock"); -#endif -#ifdef ENOTRECOVERABLE - add_errcode("ENOTRECOVERABLE", ENOTRECOVERABLE, "Lock is not recoverable"); -#endif -#ifdef ELOCKUNMAPPED - add_errcode("ELOCKUNMAPPED", ELOCKUNMAPPED, "Locked lock was unmapped"); -#endif -#ifdef ENOTACTIVE - add_errcode("ENOTACTIVE", ENOTACTIVE, "Facility is not active"); -#endif - /* MacOSX specific errnos */ #ifdef EAUTH add_errcode("EAUTH", EAUTH, "Authentication error"); diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 45b03028753a3fe..c1029080dc7be86 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -721,7 +721,7 @@ m_remainder(double x, double y) /* - Various platforms (Solaris, OpenBSD) do nonstandard things for log(0), + Various platforms (OpenBSD) do nonstandard things for log(0), log(-ve), log(NaN). Here are wrappers for log and log10 that deal with special values directly, passing positive non-special values through to the system log/log10. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ccd64d63dd0b323..8ec1322360abf03 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -350,8 +350,8 @@ extern char *ctermid_r(char *); # define WAIT_STATUS_INT(s) (s) #endif /* UNION_WAIT */ -/* Don't use the "_r" form if we don't need it (also, won't have a - prototype for it, at least on Solaris -- maybe others as well?). */ +/* Don't use the "_r" form if we don't need it + (also, won't have a prototype for it. */ #if defined(HAVE_CTERMID_R) # define USE_CTERMID_R #endif @@ -391,11 +391,6 @@ extern char *ctermid_r(char *); # define MODNAME "posix" #endif -#if defined(__sun) -/* Something to implement in autoconf, not present in autoconf 2.69 */ -# define HAVE_STRUCT_STAT_ST_FSTYPE 1 -#endif - /* memfd_create is either defined in sys/mman.h or sys/memfd.h * linux/memfd.h defines additional flags */ @@ -788,16 +783,9 @@ _Py_Dev_Converter(PyObject *obj, void *p) #ifdef AT_FDCWD -/* - * Why the (int) cast? Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965); - * without the int cast, the value gets interpreted as uint (4291925331), - * which doesn't play nicely with all the initializer lines in this file that - * look like this: - * int dir_fd = DEFAULT_DIR_FD; - */ -#define DEFAULT_DIR_FD (int)AT_FDCWD +# define DEFAULT_DIR_FD AT_FDCWD #else -#define DEFAULT_DIR_FD (-100) +# define DEFAULT_DIR_FD (-100) #endif static int @@ -2001,9 +1989,6 @@ static PyStructSequence_Field stat_result_fields[] = { #ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES {"st_file_attributes", "Windows file attribute bits"}, #endif -#ifdef HAVE_STRUCT_STAT_ST_FSTYPE - {"st_fstype", "Type of filesystem"}, -#endif #ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG {"st_reparse_tag", "Windows reparse tag"}, #endif @@ -2052,16 +2037,10 @@ static PyStructSequence_Field stat_result_fields[] = { #define ST_FILE_ATTRIBUTES_IDX ST_BIRTHTIME_IDX #endif -#ifdef HAVE_STRUCT_STAT_ST_FSTYPE -#define ST_FSTYPE_IDX (ST_FILE_ATTRIBUTES_IDX+1) -#else -#define ST_FSTYPE_IDX ST_FILE_ATTRIBUTES_IDX -#endif - #ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG -#define ST_REPARSE_TAG_IDX (ST_FSTYPE_IDX+1) +#define ST_REPARSE_TAG_IDX (ST_FILE_ATTRIBUTES_IDX+1) #else -#define ST_REPARSE_TAG_IDX ST_FSTYPE_IDX +#define ST_REPARSE_TAG_IDX ST_FILE_ATTRIBUTES_IDX #endif static PyStructSequence_Desc stat_result_desc = { @@ -2333,10 +2312,6 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st) PyStructSequence_SET_ITEM(v, ST_FILE_ATTRIBUTES_IDX, PyLong_FromUnsignedLong(st->st_file_attributes)); #endif -#ifdef HAVE_STRUCT_STAT_ST_FSTYPE - PyStructSequence_SET_ITEM(v, ST_FSTYPE_IDX, - PyUnicode_FromString(st->st_fstype)); -#endif #ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG PyStructSequence_SET_ITEM(v, ST_REPARSE_TAG_IDX, PyLong_FromUnsignedLong(st->st_reparse_tag)); @@ -6472,7 +6447,7 @@ os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy, /* ** sched_setscheduler() returns 0 in Linux, but the previous - ** scheduling policy under Solaris/Illumos, and others. + ** scheduling policy under others. ** On error, -1 is returned in all Operating Systems. */ if (sched_setscheduler(pid, policy, ¶m) == -1) @@ -6809,9 +6784,6 @@ os_openpty_impl(PyObject *module) #endif #if defined(HAVE_DEV_PTMX) && !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY) PyOS_sighandler_t sig_saved; -#if defined(__sun) && defined(__SVR4) - extern char *ptsname(int fildes); -#endif #endif #ifdef HAVE_OPENPTY @@ -6995,10 +6967,9 @@ os_getpid_impl(PyObject *module) #endif /* HAVE_GETPID */ #ifdef NGROUPS_MAX -#define MAX_GROUPS NGROUPS_MAX +# define MAX_GROUPS NGROUPS_MAX #else - /* defined to be 16 on Solaris7, so this should be a small number */ -#define MAX_GROUPS 64 +# define MAX_GROUPS 64 #endif #ifdef HAVE_GETGROUPLIST @@ -9458,24 +9429,6 @@ os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj, if (!Py_off_t_converter(offobj, &offset)) return NULL; -#if defined(__sun) && defined(__SVR4) - // On Solaris, sendfile raises EINVAL rather than returning 0 - // when the offset is equal or bigger than the in_fd size. - struct stat st; - - do { - Py_BEGIN_ALLOW_THREADS - ret = fstat(in_fd, &st); - Py_END_ALLOW_THREADS - } while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); - if (ret < 0) - return (!async_err) ? posix_error() : NULL; - - if (offset >= st.st_size) { - return Py_BuildValue("i", 0); - } -#endif - do { Py_BEGIN_ALLOW_THREADS ret = sendfile(out_fd, in_fd, &offset, count); diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 0ab3a71b1809949..a6d3e198c3bedf0 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -95,7 +95,7 @@ class sigset_t_converter(CConverter): We still have the problem that in some implementations signals generated by the keyboard (e.g. SIGINT) are delivered to all - threads (e.g. SGI), while in others (e.g. Solaris) such signals are + threads (e.g. SGI), while in others such signals are delivered to one random thread. On Linux, signals are delivered to the main thread (unless the main thread is blocking the signal, for example because it's already handling the same signal). Since we diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index d7738367029e857..0ff89d0c00dccfb 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -182,8 +182,6 @@ if_indextoname(index) -- return the corresponding interface name\n\ #ifdef HAVE_GETHOSTBYNAME_R # if defined(_AIX) && !defined(_LINUX_SOURCE_COMPAT) # define HAVE_GETHOSTBYNAME_R_3_ARG -# elif defined(__sun) || defined(__sgi) -# define HAVE_GETHOSTBYNAME_R_5_ARG # elif defined(__linux__) /* Rely on the configure script */ # elif defined(_LINUX_SOURCE_COMPAT) /* Linux compatibility on AIX */ @@ -225,11 +223,6 @@ if_indextoname(index) -- return the corresponding interface name\n\ #include #endif -/* Solaris fails to define this variable at all. */ -#if (defined(__sun) && defined(__SVR4)) && !defined(INET_ADDRSTRLEN) -#define INET_ADDRSTRLEN 16 -#endif - /* Generic includes */ #ifdef HAVE_SYS_TYPES_H #include diff --git a/Modules/termios.c b/Modules/termios.c index a6649598ec1710e..471b52def1b99b0 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -8,12 +8,6 @@ #define CTRL(c) ((c)&037) #endif -#if defined(__sun) -/* We could do better. Check issue-32660 */ -#include -#include -#endif - #include #include @@ -1004,7 +998,7 @@ static void termiosmodule_free(void *m) { termiosmodule_clear((PyObject *)m); } -static int +static int termios_exec(PyObject *mod) { struct constant *constant = termios_constants; diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 8a4d149befb52a4..1cd1772ef4f037e 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -730,7 +730,7 @@ time_strftime(PyObject *self, PyObject *args) return NULL; } -#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__) +#if defined(_MSC_VER) || defined(_AIX) || defined(__VXWORKS__) if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) { PyErr_SetString(PyExc_ValueError, "strftime() requires year in [1; 9999]"); @@ -776,7 +776,7 @@ time_strftime(PyObject *self, PyObject *args) return NULL; } } -#elif (defined(_AIX) || (defined(__sun) && defined(__SVR4))) && defined(HAVE_WCSFTIME) +#elif defined(_AIX) && defined(HAVE_WCSFTIME) for (outbuf = wcschr(fmt, '%'); outbuf != NULL; outbuf = wcschr(outbuf+2, '%')) @@ -1788,11 +1788,6 @@ time_exec(PyObject *module) return -1; } #endif -#ifdef CLOCK_HIGHRES - if (PyModule_AddIntMacro(module, CLOCK_HIGHRES) < 0) { - return -1; - } -#endif #ifdef CLOCK_PROCESS_CPUTIME_ID if (PyModule_AddIntMacro(module, CLOCK_PROCESS_CPUTIME_ID) < 0) { return -1; diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index 47369305ee88e9e..3eda30fcee279d1 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -13,9 +13,6 @@ # ifdef HAVE_LINUX_RANDOM_H # include # endif -# if defined(HAVE_SYS_RANDOM_H) && (defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)) -# include -# endif # if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL) # include # endif @@ -101,8 +98,7 @@ static int py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) { /* Is getrandom() supported by the running kernel? Set to 0 if getrandom() - failed with ENOSYS or EPERM. Need Linux kernel 3.17 or newer, or Solaris - 11.3 or newer */ + failed with ENOSYS or EPERM. Need Linux kernel 3.17 or newer. */ static int getrandom_works = 1; int flags; char *dest; @@ -115,14 +111,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) flags = blocking ? 0 : GRND_NONBLOCK; dest = buffer; while (0 < size) { -#if defined(__sun) && defined(__SVR4) - /* Issue #26735: On Solaris, getrandom() is limited to returning up - to 1024 bytes. Call it multiple times if more bytes are - requested. */ - n = Py_MIN(size, 1024); -#else n = Py_MIN(size, LONG_MAX); -#endif errno = 0; #ifdef HAVE_GETRANDOM @@ -265,7 +254,7 @@ py_getentropy(char *buffer, Py_ssize_t size, int raise) } return 1; } -#endif /* defined(HAVE_GETENTROPY) && !(defined(__sun) && defined(__SVR4)) */ +#endif /* defined(HAVE_GETENTROPY) */ static struct { @@ -439,7 +428,7 @@ lcg_urandom(unsigned int x0, unsigned char *buffer, size_t size) Used sources of entropy ordered by preference, preferred source first: - CryptGenRandom() on Windows - - getrandom() function (ex: Linux and Solaris): call py_getrandom() + - getrandom() function (ex: Linux): call py_getrandom() - getentropy() function (ex: OpenBSD): call py_getentropy() - /dev/urandom device diff --git a/Python/fileutils.c b/Python/fileutils.c index e125ba46c21baee..69f2942e9d68574 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1179,8 +1179,7 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works) else { /* Issue #22258: Here, ENOTTY means "Inappropriate ioctl for device". The ioctl is declared but not supported by the kernel. - Remember that ioctl() doesn't work. It is the case on - Illumos-based OS for example. + Remember that ioctl() doesn't work. Issue #27057: When SELinux policy disallows ioctl it will fail with EACCES. While FIOCLEX is safe operation it may be diff --git a/Python/import.c b/Python/import.c index b79bda058db8224..505ff3f0f2069c2 100644 --- a/Python/import.c +++ b/Python/import.c @@ -199,8 +199,7 @@ _PyImport_ReleaseLock(void) #ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child() to ensure that newly created child processes do not share locks with the parent. - We now acquire the import lock around fork() calls but on some platforms - (Solaris 9 and earlier? see isue7242) that still left us with problems. */ + We now acquire the import lock around fork() calls. */ PyStatus _PyImport_ReInitLock(void) { diff --git a/Tools/freeze/README b/Tools/freeze/README index 5bc5b049d5b86cd..bdb8e9448ce1d9a 100644 --- a/Tools/freeze/README +++ b/Tools/freeze/README @@ -121,11 +121,6 @@ elif sys.platform == "linux2": os.environ['TCL_LIBRARY'] = RootDir + '/lib/tcl8.2' os.environ['TK_LIBRARY'] = RootDir + '/lib/tk8.2' os.environ['TIX_LIBRARY'] = RootDir + '/lib/tix8.1' -elif sys.platform == "solaris": - sys.path = ['', '../../lib/python-2.0'] - os.environ['TCL_LIBRARY'] = RootDir + '/lib/tcl8.2' - os.environ['TK_LIBRARY'] = RootDir + '/lib/tk8.2' - os.environ['TIX_LIBRARY'] = RootDir + '/lib/tix8.1' This also adds /lib/python-2.0 to your Python path for any Python files such as _tkinter.pyd you may need. diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py index b1d281d793bd023..fbcef28c96c4f3f 100755 --- a/Tools/i18n/pygettext.py +++ b/Tools/i18n/pygettext.py @@ -22,7 +22,7 @@ __doc__ = _("""pygettext -- Python equivalent of xgettext(1) -Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the +Many systems (Linux, Gnu) provide extensive tools that ease the internationalization of C programs. Most of these tools are independent of the programming language and can be used from within Python programs. Martin von Loewis' work[1] helps considerably in this regard. @@ -123,7 +123,6 @@ Specify which style to use for location comments. Two styles are supported: - Solaris # File: filename, line: line-number GNU #: filename:line The style name is case insensitive. GNU style is the default. diff --git a/Tools/pynche/Main.py b/Tools/pynche/Main.py index 4db560b568179cd..159160c282987e3 100644 --- a/Tools/pynche/Main.py +++ b/Tools/pynche/Main.py @@ -67,8 +67,6 @@ # Default locations of rgb.txt or other textual color database RGB_TXT = [ - # Solaris OpenWindows - '/usr/openwin/lib/rgb.txt', # Linux '/usr/lib/X11/rgb.txt', # The X11R6.4 rgb.txt file diff --git a/Tools/pynche/README b/Tools/pynche/README index e026159e3c67f87..15a3a321f7abeba 100644 --- a/Tools/pynche/README +++ b/Tools/pynche/README @@ -18,7 +18,7 @@ Introduction Pynche should work with any variant of Python after 1.5.2 (e.g. 2.0.1 and 2.1.1), using Tk 8.0.x. It's been tested on - Solaris 2.6, Windows NT 4, and various Linux distros. You'll want + Windows NT 4, and various Linux distros. You'll want to be sure to have at least Tk 8.0.3 for Windows. Also, Pynche is very colormap intensive, so it doesn't work very well on 8-bit graphics cards; 24bit+ graphics cards are so cheap these days, diff --git a/Tools/scripts/nm2def.py b/Tools/scripts/nm2def.py index a885ebd6fecc2ff..40d4040945ffe3c 100755 --- a/Tools/scripts/nm2def.py +++ b/Tools/scripts/nm2def.py @@ -3,7 +3,7 @@ Helpers to extract symbols from Unix libs and auto-generate Windows definition files from them. Depends on nm(1). Tested -on Linux and Solaris only (-p option to nm is for Solaris only). +on Linux only (-p option to nm is for Solaris only). By Marc-Andre Lemburg, Aug 1998. diff --git a/configure b/configure index bc87485bf516d12..d7694646c166d14 100755 --- a/configure +++ b/configure @@ -3403,13 +3403,6 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h # Marc Recht NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S]) define_xopen_source=no;; - # From the perspective of Solaris, _XOPEN_SOURCE is not so much a - # request to enable features supported by the standard as a request - # to disable features not supported by the standard. The best way - # for Python to use Solaris is simply to leave _XOPEN_SOURCE out - # entirely and define __EXTENSIONS__ instead. - SunOS/*) - define_xopen_source=no;; # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE, # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice. # Reconfirmed for 7.1.4 by Martin v. Loewis. @@ -5940,16 +5933,6 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h LDLIBRARY='libpython$(LDVERSION).dll.a' DLLLIBRARY='libpython$(LDVERSION).dll' ;; - SunOS*) - LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - INSTSONAME="$LDLIBRARY".$SOVERSION - if test "$with_pydebug" != yes - then - PY3LIBRARY=libpython3.so - fi - ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' @@ -8022,7 +8005,7 @@ utime.h \ poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ -sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ @@ -9469,7 +9452,6 @@ fi $as_echo "$SHLIB_SUFFIX" >&6; } # LDSHARED is the ld *command* used to create shared library -# -- "cc -G" on SunOS 5.x. # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 @@ -9481,14 +9463,6 @@ then BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp" LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp" ;; - SunOS/5*) - if test "$GCC" = "yes" ; then - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared' - else - LDSHARED='$(CC) -G' - LDCXXSHARED='$(CXX) -G' - fi ;; hp*|HP*) if test "$GCC" = "yes" ; then LDSHARED='$(CC) -shared' @@ -9614,12 +9588,6 @@ $as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in - SunOS*) if test "$GCC" = yes; - then CCSHARED="-fPIC"; - elif test `uname -p` = sparc; - then CCSHARED="-xcode=pic32"; - else CCSHARED="-Kpic"; - fi;; hp*|HP*) if test "$GCC" = yes; then CCSHARED="-fPIC"; else CCSHARED="+z"; @@ -9680,13 +9648,6 @@ then then LINKFORSHARED="-Wl,--export-dynamic" fi;; - SunOS/5*) case $CC in - *gcc*) - if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null - then - LINKFORSHARED="-Xlinker --export-dynamic" - fi;; - esac;; CYGWIN*) if test $enable_shared = "no" then @@ -9833,7 +9794,7 @@ _ACEOF LIBS="-ldl $LIBS" fi - # Dynamic linking for SunOS/Solaris and SYSV + # Dynamic linking for SYSV { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : @@ -9989,8 +9950,6 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# 'Real Time' functions on Solaris -# posix4 on Solaris 2.6 # pthread (first!) on Linux { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 $as_echo_n "checking for library containing sem_init... " >&6; } @@ -10016,7 +9975,7 @@ return sem_init (); return 0; } _ACEOF -for ac_lib in '' pthread rt posix4; do +for ac_lib in '' pthread rt; do if test -z "$ac_lib"; then ac_res="none required" else @@ -10316,88 +10275,6 @@ $as_echo "no" >&6; } fi -# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 -$as_echo_n "checking for t_open in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_t_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char t_open (); -int -main () -{ -return t_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_t_open=yes -else - ac_cv_lib_nsl_t_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 -$as_echo "$ac_cv_lib_nsl_t_open" >&6; } -if test "x$ac_cv_lib_nsl_t_open" = xyes; then : - LIBS="-lnsl $LIBS" -fi - # SVR4 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_socket=yes -else - ac_cv_lib_socket_socket=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : - LIBS="-lsocket $LIBS" -fi - # SVR4 sockets - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libs" >&5 $as_echo_n "checking for --with-libs... " >&6; } @@ -10716,9 +10593,6 @@ then $as_echo "#define _REENTRANT 1" >>confdefs.h posix_threads=yes - if test "$ac_sys_system" = "SunOS"; then - CFLAGS="$CFLAGS -D_REENTRANT" - fi elif test "$ac_cv_kpthread" = "yes" then CC="$CC -Kpthread" @@ -11052,16 +10926,7 @@ $as_echo "#define _POSIX_THREADS 1" >>confdefs.h fi - # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. case $ac_sys_system/$ac_sys_release in - SunOS/5.6) -$as_echo "#define HAVE_PTHREAD_DESTRUCTOR 1" >>confdefs.h - - ;; - SunOS/5.8) -$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h - - ;; AIX/*) $as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h @@ -12288,94 +12153,6 @@ done test -n "$TRUE" || TRUE="/bin/true" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc" >&5 -$as_echo_n "checking for inet_aton in -lc... " >&6; } -if ${ac_cv_lib_c_inet_aton+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inet_aton (); -int -main () -{ -return inet_aton (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_inet_aton=yes -else - ac_cv_lib_c_inet_aton=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton" >&5 -$as_echo "$ac_cv_lib_c_inet_aton" >&6; } -if test "x$ac_cv_lib_c_inet_aton" = xyes; then : - $ac_cv_prog_TRUE -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 -$as_echo_n "checking for inet_aton in -lresolv... " >&6; } -if ${ac_cv_lib_resolv_inet_aton+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lresolv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inet_aton (); -int -main () -{ -return inet_aton (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_resolv_inet_aton=yes -else - ac_cv_lib_resolv_inet_aton=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 -$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } -if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF - - LIBS="-lresolv $LIBS" - -fi - - -fi - - # On Tru64, chflags seems to be present, but calling it will # exit Python { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 @@ -17151,43 +16928,6 @@ $as_echo "#define HAVE_GETRANDOM_SYSCALL 1" >>confdefs.h fi -# check if the getrandom() function is available -# the test was written for the Solaris function of -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the getrandom() function" >&5 -$as_echo_n "checking for the getrandom() function... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - - int main() { - char buffer[1]; - const size_t buflen = sizeof(buffer); - const int flags = 0; - /* ignore the result, Python checks for ENOSYS at runtime */ - (void)getrandom(buffer, buflen, flags); - return 0; - } - - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_getrandom=yes -else - have_getrandom=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getrandom" >&5 -$as_echo "$have_getrandom" >&6; } - -if test "$have_getrandom" = yes; then - -$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h - -fi - # checks for POSIX shared memory, used by Modules/_multiprocessing/posixshmem.c # shm_* may only be available if linking against librt save_LIBS="$LIBS" diff --git a/configure.ac b/configure.ac index 49ed09a3a009bf2..cb1915897100279 100644 --- a/configure.ac +++ b/configure.ac @@ -485,13 +485,6 @@ case $ac_sys_system/$ac_sys_release in # Marc Recht NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@) define_xopen_source=no;; - # From the perspective of Solaris, _XOPEN_SOURCE is not so much a - # request to enable features supported by the standard as a request - # to disable features not supported by the standard. The best way - # for Python to use Solaris is simply to leave _XOPEN_SOURCE out - # entirely and define __EXTENSIONS__ instead. - SunOS/*) - define_xopen_source=no;; # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE, # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice. # Reconfirmed for 7.1.4 by Martin v. Loewis. @@ -1136,16 +1129,6 @@ if test $enable_shared = "yes"; then LDLIBRARY='libpython$(LDVERSION).dll.a' DLLLIBRARY='libpython$(LDVERSION).dll' ;; - SunOS*) - LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - INSTSONAME="$LDLIBRARY".$SOVERSION - if test "$with_pydebug" != yes - then - PY3LIBRARY=libpython3.so - fi - ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) LDLIBRARY='libpython$(LDVERSION).so' BLDLIBRARY='-L. -lpython$(LDVERSION)' @@ -2200,7 +2183,7 @@ utime.h \ poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ -sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ @@ -2379,7 +2362,7 @@ if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ [Defined to enable large file support when an off_t is bigger than a long and long long is at least as big as an off_t. You may need to add some flags for configuration and compilation to enable this mode. - (For Solaris and Linux, the necessary defines are already defined.)]) + (For Linux, the necessary defines are already defined.)]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -2569,7 +2552,6 @@ fi AC_MSG_RESULT($SHLIB_SUFFIX) # LDSHARED is the ld *command* used to create shared library -# -- "cc -G" on SunOS 5.x. # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) AC_MSG_CHECKING(LDSHARED) @@ -2580,14 +2562,6 @@ then BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp" LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp" ;; - SunOS/5*) - if test "$GCC" = "yes" ; then - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared' - else - LDSHARED='$(CC) -G' - LDCXXSHARED='$(CXX) -G' - fi ;; hp*|HP*) if test "$GCC" = "yes" ; then LDSHARED='$(CC) -shared' @@ -2711,12 +2685,6 @@ AC_MSG_CHECKING(CCSHARED) if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in - SunOS*) if test "$GCC" = yes; - then CCSHARED="-fPIC"; - elif test `uname -p` = sparc; - then CCSHARED="-xcode=pic32"; - else CCSHARED="-Kpic"; - fi;; hp*|HP*) if test "$GCC" = yes; then CCSHARED="-fPIC"; else CCSHARED="+z"; @@ -2775,13 +2743,6 @@ then then LINKFORSHARED="-Wl,--export-dynamic" fi;; - SunOS/5*) case $CC in - *gcc*) - if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null - then - LINKFORSHARED="-Xlinker --export-dynamic" - fi;; - esac;; CYGWIN*) if test $enable_shared = "no" then @@ -2835,7 +2796,7 @@ AC_MSG_RESULT($SHLIBS) # checks for libraries AC_CHECK_LIB(sendfile, sendfile) -AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV +AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX # checks for uuid.h location @@ -2878,10 +2839,8 @@ void *x = uuid_enc_be [AC_MSG_RESULT(no)] ) -# 'Real Time' functions on Solaris -# posix4 on Solaris 2.6 # pthread (first!) on Linux -AC_SEARCH_LIBS(sem_init, pthread rt posix4) +AC_SEARCH_LIBS(sem_init, pthread rt) # check if we need libintl for locale functions AC_CHECK_LIB(intl, textdomain, @@ -3041,10 +3000,6 @@ LDFLAGS="-fsanitize=undefined $LDFLAGS" ], [AC_MSG_RESULT(no)]) -# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 -AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - AC_MSG_CHECKING(for --with-libs) AC_ARG_WITH(libs, AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs (default is no)]), @@ -3189,9 +3144,6 @@ then # Defining _REENTRANT on system with POSIX threads should not hurt. AC_DEFINE(_REENTRANT) posix_threads=yes - if test "$ac_sys_system" = "SunOS"; then - CFLAGS="$CFLAGS -D_REENTRANT" - fi elif test "$ac_cv_kpthread" = "yes" then CC="$CC -Kpthread" @@ -3284,14 +3236,7 @@ if test "$posix_threads" = "yes"; then and your system does not define that.]) fi - # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. case $ac_sys_system/$ac_sys_release in - SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, - [Defined for Solaris 2.6 bug in pthread header.]) - ;; - SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, - [Define if the Posix semaphores do not work on your system]) - ;; AIX/*) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, [Define if the Posix semaphores do not work on your system]) ;; @@ -3844,12 +3789,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ dnl check for true AC_CHECK_PROGS(TRUE, true, /bin/true) -dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv -dnl On others, they are in the C library, so we to take no action -AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE], - AC_CHECK_LIB(resolv, inet_aton) -) - # On Tru64, chflags seems to be present, but calling it will # exit Python AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl @@ -5121,7 +5060,7 @@ fi AC_CHECK_HEADERS(curses.h ncurses.h) -# On Solaris, term.h requires curses.h +# On Linux, term.h requires curses.h AC_CHECK_HEADERS(term.h,,,[ #ifdef HAVE_CURSES_H #include @@ -5650,31 +5589,6 @@ if test "$have_getrandom_syscall" = yes; then [Define to 1 if the Linux getrandom() syscall is available]) fi -# check if the getrandom() function is available -# the test was written for the Solaris function of -AC_MSG_CHECKING(for the getrandom() function) -AC_LINK_IFELSE( -[ - AC_LANG_SOURCE([[ - #include - - int main() { - char buffer[1]; - const size_t buflen = sizeof(buffer); - const int flags = 0; - /* ignore the result, Python checks for ENOSYS at runtime */ - (void)getrandom(buffer, buflen, flags); - return 0; - } - ]]) -],[have_getrandom=yes],[have_getrandom=no]) -AC_MSG_RESULT($have_getrandom) - -if test "$have_getrandom" = yes; then - AC_DEFINE(HAVE_GETRANDOM, 1, - [Define to 1 if the getrandom() function is available]) -fi - # checks for POSIX shared memory, used by Modules/_multiprocessing/posixshmem.c # shm_* may only be available if linking against librt save_LIBS="$LIBS" diff --git a/pyconfig.h.in b/pyconfig.h.in index af8a3d6d9c370d5..83165cbc7ea470e 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -498,9 +498,6 @@ /* Define to 1 if you have the `getpwuid_r' function. */ #undef HAVE_GETPWUID_R -/* Define to 1 if the getrandom() function is available */ -#undef HAVE_GETRANDOM - /* Define to 1 if the Linux getrandom() syscall is available */ #undef HAVE_GETRANDOM_SYSCALL @@ -576,8 +573,8 @@ /* Defined to enable large file support when an off_t is bigger than a long and long long is at least as big as an off_t. You may need to add some - flags for configuration and compilation to enable this mode. (For Solaris - and Linux, the necessary defines are already defined.) */ + flags for configuration and compilation to enable this mode. (For Linux, + the necessary defines are already defined.) */ #undef HAVE_LARGEFILE_SUPPORT /* Define to 1 if you have the 'lchflags' function. */ @@ -607,9 +604,6 @@ /* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE -/* Define to 1 if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - /* Define to 1 if you have the `sendfile' library (-lsendfile). */ #undef HAVE_LIBSENDFILE @@ -793,9 +787,6 @@ /* Define to 1 if you have the `pthread_condattr_setclock' function. */ #undef HAVE_PTHREAD_CONDATTR_SETCLOCK -/* Defined for Solaris 2.6 bug in pthread header. */ -#undef HAVE_PTHREAD_DESTRUCTOR - /* Define to 1 if you have the `pthread_getcpuclockid' function. */ #undef HAVE_PTHREAD_GETCPUCLOCKID @@ -1156,9 +1147,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RANDOM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H diff --git a/setup.py b/setup.py index 8a4abe5a648fd93..1c3688ad03ceec8 100644 --- a/setup.py +++ b/setup.py @@ -2048,10 +2048,7 @@ def detect_tkinter(self): include_dirs.append(dir) # Check for various platform-specific directories - if HOST_PLATFORM == 'sunos5': - include_dirs.append('/usr/openwin/include') - added_lib_dirs.append('/usr/openwin/lib') - elif os.path.exists('/usr/X11R6/include'): + if os.path.exists('/usr/X11R6/include'): include_dirs.append('/usr/X11R6/include') added_lib_dirs.append('/usr/X11R6/lib64') added_lib_dirs.append('/usr/X11R6/lib') @@ -2157,17 +2154,6 @@ def detect_ctypes(self): # XXX Is this still needed? # extra_link_args.extend(['-read_only_relocs', 'warning']) - elif HOST_PLATFORM == 'sunos5': - # XXX This shouldn't be necessary; it appears that some - # of the assembler code is non-PIC (i.e. it has relocations - # when it shouldn't. The proper fix would be to rewrite - # the assembler code to be PIC. - # This only works with GCC; the Sun compiler likely refuses - # this option. If you want to compile ctypes with the Sun - # compiler, please research a proper solution, instead of - # finding some -z option for the Sun compiler. - extra_link_args.append('-mimpure-text') - elif HOST_PLATFORM.startswith('hp-ux'): extra_link_args.append('-fPIC') @@ -2300,9 +2286,7 @@ def detect_decimal(self): define_macros = config['ansi64'] elif sizeof_size_t == 4: ppro = sysconfig.get_config_var('HAVE_GCC_ASM_FOR_X87') - if ppro and ('gcc' in cc or 'clang' in cc) and \ - not 'sunos' in HOST_PLATFORM: - # solaris: problems with register allocation. + if ppro and ('gcc' in cc or 'clang' in cc): # icc >= 11.0 works as well. define_macros = config['ppro'] extra_compile_args.append('-Wno-unknown-pragmas')