[issue33911] [EASY] test_docxmlrpc fails when run with -Werror

STINNER Victor report at bugs.python.org
Wed Jun 20 05:56:55 EDT 2018


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

Ok, but notice the two warnings:

vstinner at apu$ ./python -m test test_docxmlrpc
Run tests sequentially
0:00:00 load avg: 1.19 [1/1] test_docxmlrpc
/home/vstinner/prog/python/master/Lib/xmlrpc/server.py:791: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  formatvalue=self.formatvalue)
/home/vstinner/prog/python/master/Lib/xmlrpc/server.py:784: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  formatvalue=self.formatvalue

== Tests result: SUCCESS ==

1 test OK.

Total duration: 2 sec 698 ms
Tests result: SUCCESS


Fail:

vstinner at apu$ ./python -Werror -m test -v test_docxmlrpc 
test_annotations (test.test_docxmlrpc.DocXMLRPCHTTPGETServer)
Test that annotations works as expected ... ----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 45060)
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 313, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 344, in process_request
    self.finish_request(request, client_address)
  File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 357, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 717, in __init__
    self.handle()
  File "/home/vstinner/prog/python/master/Lib/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/home/vstinner/prog/python/master/Lib/http/server.py", line 414, in handle_one_request
    method()
  File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 936, in do_GET
    response = self.server.generate_html_documentation().encode('utf-8')
  File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 910, in generate_html_documentation
    methods
  File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 828, in docserver
    contents.append(self.docroutine(value, key, funcs=fdict))
  File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 791, in docroutine
    formatvalue=self.formatvalue)
  File "/home/vstinner/prog/python/master/Lib/inspect.py", line 1225, in formatargspec
    stacklevel=2)
DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
----------------------------------------
ERROR
(...)
== Tests result: FAILURE ==

1 test failed:
    test_docxmlrpc

Total duration: 3 sec 234 ms
Tests result: FAILURE



It seems like the fix is explained in the error message:

Lib/xmlrpc/server.py, line 791, in docroutine():

DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly

----------
keywords: easy
messages: 320043
nosy: vstinner
priority: normal
severity: normal
status: open
title: [EASY] test_docxmlrpc fails when run with -Werror
versions: Python 3.8

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


More information about the Python-bugs-list mailing list