Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Sample server / client does not work, Python 3.6.4 #30

Open
thomasclifford opened this issue Sep 13, 2018 · 3 comments
Open

Sample server / client does not work, Python 3.6.4 #30

thomasclifford opened this issue Sep 13, 2018 · 3 comments

Comments

@thomasclifford
Copy link

Good day, thank you all for your efforts on SOAPpy-py3.
I'm trying to run the sample server and client and while the server runs with no error,
when I try to run the client, the client produces:

Traceback (most recent call last):
File "client01.py", line 3, in
print('from server: ' + server.hello() )
File "/usr/lib/python3.6/site-packages/SOAPpy/Client.py", line 639, in call
return self.__r_call(*args, **kw)
File "/usr/lib/python3.6/site-packages/SOAPpy/Client.py", line 661, in __r_call
self.__hd, self.__ma)
File "/usr/lib/python3.6/site-packages/SOAPpy/Client.py", line 524, in __call
timeout = self.timeout)
File "/usr/lib/python3.6/site-packages/SOAPpy/Client.py", line 385, in call
data = f.read()
ValueError: read of closed file

The server produces:

*** Internal exception initial_value must be str or None, not bytes ****
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/SOAPpy/Server.py", line 230, in do_POST
parseSOAPRPC(data, header = 1, body = 1, attrs = 1, ignore_ext=self.ignore_ext)
File "/usr/lib/python3.6/site-packages/SOAPpy/Parser.py", line 1102, in parseSOAPRPC
t = _parseSOAP(xml_str, rules = rules, ignore_ext=ignore_ext)
File "/usr/lib/python3.6/site-packages/SOAPpy/Parser.py", line 1053, in _parseSOAP
inpsrc.setByteStream(StringIO(xml_str))
TypeError: initial_value must be str or None, not bytes


My SOAPpy-py3 is v0.52.24

should I change the return in the server to return (b'Hello World') ?
Maybe then have the client do something like
response = server.hello().decode('utf-8') ?

Thanks......

@mohsendehshiri
Copy link

i have same issue

@ugarte16423
Copy link

I have similar issue

ERROR jp odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/http.py", line 941, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/extra_addons/ours/shipping_rates/models/order.py", line 29, in get_drupal_shipping_rates
getattr(server, "test")()
File "/usr/local/lib/python3.6/dist-packages/SOAPpy/Client.py", line 639, in call
return self.__r_call(*args, **kw)
File "/usr/local/lib/python3.6/dist-packages/SOAPpy/Client.py", line 661, in __r_call
self.__hd, self.__ma)
File "/usr/local/lib/python3.6/dist-packages/SOAPpy/Client.py", line 524, in __call
timeout = self.timeout)
File "/usr/local/lib/python3.6/dist-packages/SOAPpy/Client.py", line 388, in call
data = f.read(message_len)
ValueError: read of closed file

@piqoni
Copy link

piqoni commented Sep 3, 2020

Same issue, has anyone found a workaround?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants