[New-bugs-announce] [issue33988] [EASY] [3.7] test_platform fails when run with -Werror

STINNER Victor report at bugs.python.org
Thu Jun 28 06:37:19 EDT 2018


New submission from STINNER Victor <vstinner at redhat.com>:

vstinner at apu$ ./python -Werror -m test -v test_platform

======================================================================
ERROR: test_dist (test.test_platform.PlatformTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/prog/python/3.7/Lib/test/test_platform.py", line 270, in test_dist
    res = platform.dist()
  File "/home/vstinner/prog/python/3.7/Lib/platform.py", line 379, in dist
    "in Python 3.5", DeprecationWarning, stacklevel=2)
DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5

======================================================================
ERROR: test_linux_distribution_encoding (test.test_platform.PlatformTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/prog/python/3.7/Lib/test/test_platform.py", line 346, in test_linux_distribution_encoding
    distname, version, distid = platform.linux_distribution()
  File "/home/vstinner/prog/python/3.7/Lib/platform.py", line 305, in linux_distribution
    "in Python 3.5", DeprecationWarning, stacklevel=2)
DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5

The code calling the deprecated function should be surrounded by something like that:

with support.check_warnings(('cgi.parse_qs is deprecated', DeprecationWarning)):

----------
components: Tests
keywords: easy
messages: 320657
nosy: vstinner
priority: normal
severity: normal
status: open
title: [EASY] [3.7] test_platform fails when run with -Werror
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33988>
_______________________________________


More information about the New-bugs-announce mailing list