``(os_name, os_version, os_arch)``. Values which cannot be determined are set to
the defaults given as parameters (which all default to ``''``).
+ .. deprecated-removed:: 3.13 3.15
+ It was largely untested, had a confusing API,
+ and was only useful for Jython support.
+
Windows Platform
----------------
* The undocumented and unused ``tarfile`` attribute of :class:`tarfile.TarFile`
is deprecated and scheduled for removal in Python 3.16.
+* :func:`platform.java_ver` is deprecated and will be removed in 3.15.
+ It was largely untested, had a confusing API,
+ and was only useful for Jython support.
+ (Contributed by Nikita Sobolev in :gh:`116349`.)
Pending Removal in Python 3.14
------------------------------
They will be removed in Python 3.15.
(Contributed by Victor Stinner in :gh:`105096`.)
+* :func:`platform.java_ver` is deprecated and will be removed in 3.15.
+ It was largely untested, had a confusing API,
+ and was only useful for Jython support.
+ (Contributed by Nikita Sobolev in :gh:`116349`.)
+
Pending Removal in Python 3.16
------------------------------
return release, versioninfo, machine
def _java_getprop(name, default):
-
+ """This private helper is deprecated in 3.13 and will be removed in 3.15"""
from java.lang import System
try:
value = System.getProperty(name)
given as parameters (which all default to '').
"""
+ import warnings
+ warnings._deprecated('java_ver', remove=(3, 15))
# Import the needed APIs
try:
import java.lang
platform._uname_cache = None
def test_java_ver(self):
- res = platform.java_ver()
- if sys.platform == 'java': # Is never actually checked in CI
- self.assertTrue(all(res))
+ import re
+ msg = re.escape(
+ "'java_ver' is deprecated and slated for removal in Python 3.15"
+ )
+ with self.assertWarnsRegex(DeprecationWarning, msg):
+ res = platform.java_ver()
+ self.assertEqual(len(res), 4)
def test_win32_ver(self):
res = platform.win32_ver()
--- /dev/null
+:func:`platform.java_ver` is deprecated and will be removed in 3.15.
+It was largely untested, had a confusing API,
+and was only useful for Jython support.