Skip to content

Commit 13ff245

Browse files
authored
bpo-32593: Drop FreeBSD 9 and older support (#5232)
Drop support of FreeBSD 9 and older.
1 parent b0a7a03 commit 13ff245

File tree

18 files changed

+23
-108
lines changed

18 files changed

+23
-108
lines changed

Doc/library/time.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ These constants are used as parameters for :func:`clock_getres` and
792792

793793
High-resolution per-process timer from the CPU.
794794

795-
Availability: FreeBSD 3 or later, NetBSD 7 or later, OpenBSD.
795+
Availability: FreeBSD, NetBSD 7 or later, OpenBSD.
796796

797797
.. versionadded:: 3.7
798798

@@ -812,7 +812,7 @@ These constants are used as parameters for :func:`clock_getres` and
812812
suspended, providing accurate uptime measurement, both absolute and
813813
interval.
814814

815-
Availability: FreeBSD 7 or later, OpenBSD 5.5 or later.
815+
Availability: FreeBSD, OpenBSD 5.5 or later.
816816

817817
.. versionadded:: 3.7
818818

Doc/whatsnew/3.7.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,11 @@ Windows Only
806806
Removed
807807
=======
808808

809+
Platform Support Removals
810+
-------------------------
811+
812+
* FreeBSD 9 and older are no longer supported.
813+
809814
API and Feature Removals
810815
------------------------
811816

Include/py_curses.h

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,15 @@
1212
#endif
1313
#endif /* __APPLE__ */
1414

15-
#ifdef __FreeBSD__
16-
/*
17-
** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards
18-
** against multiple definition of wchar_t and wint_t.
19-
*/
20-
#ifdef _XOPEN_SOURCE_EXTENDED
21-
#ifndef __FreeBSD_version
22-
#include <osreldate.h>
23-
#endif
24-
#if __FreeBSD_version >= 500000
25-
#ifndef __wchar_t
26-
#define __wchar_t
27-
#endif
28-
#ifndef __wint_t
29-
#define __wint_t
30-
#endif
31-
#else
32-
#ifndef _WCHAR_T
33-
#define _WCHAR_T
34-
#endif
35-
#ifndef _WINT_T
36-
#define _WINT_T
37-
#endif
38-
#endif
39-
#endif
15+
/* On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards
16+
against multiple definition of wchar_t and wint_t. */
17+
#if defined(__FreeBSD__) && defined(_XOPEN_SOURCE_EXTENDED)
18+
# ifndef __wchar_t
19+
# define __wchar_t
20+
# endif
21+
# ifndef __wint_t
22+
# define __wint_t
23+
# endif
4024
#endif
4125

4226
#if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS)

Include/pyport.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,8 @@ extern char * _getpty(int *, int, mode_t, int);
564564
* workaround was provided by Tim Robbins of FreeBSD project.
565565
*/
566566

567-
#ifdef __FreeBSD__
568-
#include <osreldate.h>
569-
#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \
570-
(__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \
571-
(__FreeBSD_version >= 800000 && __FreeBSD_version < 800001)
572-
# define _PY_PORT_CTYPE_UTF8_ISSUE
573-
#endif
574-
#endif
575-
576-
577567
#if defined(__APPLE__)
578-
# define _PY_PORT_CTYPE_UTF8_ISSUE
568+
# define _PY_PORT_CTYPE_UTF8_ISSUE
579569
#endif
580570

581571
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE

Lib/test/test_asyncio/test_events.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,8 +1471,6 @@ async def connect():
14711471
@unittest.skipUnless(sys.platform != 'win32',
14721472
"Don't support pipes for Windows")
14731473
@unittest.skipIf(sys.platform == 'darwin', 'test hangs on MacOS')
1474-
# Issue #20495: The test hangs on FreeBSD 7.2 but pass on FreeBSD 9
1475-
@support.requires_freebsd_version(8)
14761474
def test_read_pty_output(self):
14771475
proto = MyReadPipeProto(loop=self.loop)
14781476

Lib/test/test_io.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,8 +4107,6 @@ def test_interrupted_write_unbuffered(self):
41074107
def test_interrupted_write_buffered(self):
41084108
self.check_interrupted_write(b"xy", b"xy", mode="wb")
41094109

4110-
# Issue #22331: The test hangs on FreeBSD 7.2
4111-
@support.requires_freebsd_version(8)
41124110
def test_interrupted_write_text(self):
41134111
self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
41144112

Lib/test/test_logging.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -773,14 +773,7 @@ def serve_forever(self, poll_interval):
773773
:func:`select` or :func:`poll` call by
774774
:func:`asyncore.loop`.
775775
"""
776-
try:
777-
asyncore.loop(poll_interval, map=self._map)
778-
except OSError:
779-
# On FreeBSD 8, closing the server repeatably
780-
# raises this error. We swallow it if the
781-
# server has been closed.
782-
if self.connected or self.accepting:
783-
raise
776+
asyncore.loop(poll_interval, map=self._map)
784777

785778
def stop(self, timeout=None):
786779
"""

Lib/test/test_os.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,7 @@ def test_environb(self):
782782
value_str = value.decode(sys.getfilesystemencoding(), 'surrogateescape')
783783
self.assertEqual(os.environ['bytes'], value_str)
784784

785-
# On FreeBSD < 7 and OS X < 10.6, unsetenv() doesn't return a value (issue
786-
# #13415).
787-
@support.requires_freebsd_version(7)
785+
# On OS X < 10.6, unsetenv() doesn't return a value (bpo-13415).
788786
@support.requires_mac_ver(10, 6)
789787
def test_unset_error(self):
790788
if sys.platform == "win32":

Lib/test/test_posix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ def test_makedev(self):
559559
self.assertRaises(TypeError, posix.minor)
560560
self.assertRaises((ValueError, OverflowError), posix.minor, -1)
561561

562+
# FIXME: reenable these tests on FreeBSD with the kernel fix
562563
if sys.platform.startswith('freebsd') and dev >= 0x1_0000_0000:
563564
self.skipTest("bpo-31044: on FreeBSD CURRENT, minor() truncates "
564565
"64-bit dev to 32-bit")

Lib/test/test_resource.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def test_linux_constants(self):
138138
with contextlib.suppress(AttributeError):
139139
self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)
140140

141-
@support.requires_freebsd_version(9)
142141
def test_freebsd_contants(self):
143142
for attr in ['SWAP', 'SBSIZE', 'NPTS']:
144143
with contextlib.suppress(AttributeError):

Lib/test/test_signal.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ def test_getsignal(self):
5656
self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
5757

5858
# Issue 3864, unknown if this affects earlier versions of freebsd also
59-
@unittest.skipIf(sys.platform=='freebsd6',
60-
'inter process signals not reliable (do not mix well with threading) '
61-
'on freebsd6')
6259
def test_interprocess_signal(self):
6360
dirname = os.path.dirname(__file__)
6461
script = os.path.join(dirname, 'signalinterproctester.py')
@@ -651,7 +648,7 @@ def test_itimer_real(self):
651648
self.assertEqual(self.hndl_called, True)
652649

653650
# Issue 3864, unknown if this affects earlier versions of freebsd also
654-
@unittest.skipIf(sys.platform in ('freebsd6', 'netbsd5'),
651+
@unittest.skipIf(sys.platform in ('netbsd5',),
655652
'itimer not reliable (does not mix well with threading) on some BSDs.')
656653
def test_itimer_virtual(self):
657654
self.itimer = signal.ITIMER_VIRTUAL
@@ -673,9 +670,6 @@ def test_itimer_virtual(self):
673670
# and the handler should have been called
674671
self.assertEqual(self.hndl_called, True)
675672

676-
# Issue 3864, unknown if this affects earlier versions of freebsd also
677-
@unittest.skipIf(sys.platform=='freebsd6',
678-
'itimer not reliable (does not mix well with threading) on freebsd6')
679673
def test_itimer_prof(self):
680674
self.itimer = signal.ITIMER_PROF
681675
signal.signal(signal.SIGPROF, self.sig_prof)
@@ -762,16 +756,6 @@ def handler(signum, frame):
762756
763757
signal.signal(signum, handler)
764758
765-
if sys.platform == 'freebsd6':
766-
# Issue #12392 and #12469: send a signal to the main thread
767-
# doesn't work before the creation of the first thread on
768-
# FreeBSD 6
769-
def noop():
770-
pass
771-
thread = threading.Thread(target=noop)
772-
thread.start()
773-
thread.join()
774-
775759
tid = threading.get_ident()
776760
try:
777761
signal.pthread_kill(tid, signum)
@@ -1010,9 +994,6 @@ def read_sigmask():
1010994
"""
1011995
assert_python_ok('-c', code)
1012996

1013-
@unittest.skipIf(sys.platform == 'freebsd6',
1014-
"issue #12392: send a signal to the main thread doesn't work "
1015-
"before the creation of the first thread on FreeBSD 6")
1016997
@unittest.skipUnless(hasattr(signal, 'pthread_kill'),
1017998
'need signal.pthread_kill()')
1018999
def test_pthread_kill_main_thread(self):

Lib/test/test_socket.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,9 +2598,6 @@ def testRecvmsgShorter(self):
25982598
def _testRecvmsgShorter(self):
25992599
self.sendToServer(MSG)
26002600

2601-
# FreeBSD < 8 doesn't always set the MSG_TRUNC flag when a truncated
2602-
# datagram is received (issue #13001).
2603-
@support.requires_freebsd_version(8)
26042601
def testRecvmsgTrunc(self):
26052602
# Receive part of message, check for truncation indicators.
26062603
msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock,
@@ -2610,7 +2607,6 @@ def testRecvmsgTrunc(self):
26102607
self.assertEqual(ancdata, [])
26112608
self.checkFlags(flags, eor=False)
26122609

2613-
@support.requires_freebsd_version(8)
26142610
def _testRecvmsgTrunc(self):
26152611
self.sendToServer(MSG)
26162612

Lib/test/test_threading.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
# #12316 and #11870), and fork() from a worker thread is known to trigger
2626
# problems with some operating systems (issue #3863): skip problematic tests
2727
# on platforms known to behave badly.
28-
platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
29-
'hp-ux11')
28+
platforms_to_skip = ('netbsd5', 'hp-ux11')
3029

3130

3231
# A trivial mutable counter.

Lib/unittest/test/test_break.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
1212
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
13-
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
14-
"if threads have been used")
1513
class TestBreak(unittest.TestCase):
1614
int_handler = None
1715

@@ -267,22 +265,16 @@ def test():
267265

268266
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
269267
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
270-
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
271-
"if threads have been used")
272268
class TestBreakDefaultIntHandler(TestBreak):
273269
int_handler = signal.default_int_handler
274270

275271
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
276272
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
277-
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
278-
"if threads have been used")
279273
class TestBreakSignalIgnored(TestBreak):
280274
int_handler = signal.SIG_IGN
281275

282276
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
283277
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
284-
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
285-
"if threads have been used")
286278
class TestBreakSignalDefault(TestBreak):
287279
int_handler = signal.SIG_DFL
288280

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support of FreeBSD 9 and older.

Python/thread_pthread.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@
5656
#endif
5757
#endif
5858

59-
/* Before FreeBSD 5.4, system scope threads was very limited resource
60-
in default setting. So the process scope is preferred to get
61-
enough number of threads to work. */
62-
#ifdef __FreeBSD__
63-
#include <osreldate.h>
64-
#if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101
65-
#undef PTHREAD_SYSTEM_SCHED_SUPPORTED
66-
#endif
67-
#endif
68-
6959
#if !defined(pthread_attr_default)
7060
# define pthread_attr_default ((pthread_attr_t *)NULL)
7161
#endif

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,6 @@ case $ac_sys_system/$ac_sys_release in
481481
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
482482
SCO_SV/3.2)
483483
define_xopen_source=no;;
484-
# On FreeBSD 4, the math functions C89 does not cover are never defined
485-
# with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
486-
FreeBSD/4.*)
487-
define_xopen_source=no;;
488484
# On MacOS X 10.2, a bug in ncurses.h means that it craps out if
489485
# _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
490486
# identifies itself as Darwin/7.*

setup.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,12 +1571,6 @@ class db_found(Exception): pass
15711571
macros = dict()
15721572
libraries = []
15731573

1574-
elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
1575-
# FreeBSD's P1003.1b semaphore support is very experimental
1576-
# and has many known problems. (as of June 2008)
1577-
macros = dict()
1578-
libraries = []
1579-
15801574
elif host_platform.startswith('openbsd'):
15811575
macros = dict()
15821576
libraries = []

0 commit comments

Comments
 (0)