Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package trytond for openSUSE:Factory checked in at 2021-07-28 19:19:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trytond (Old) and /work/SRC/openSUSE:Factory/.trytond.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trytond" Wed Jul 28 19:19:52 2021 rev:62 rq:908627 version:5.0.36 Changes: -------- --- /work/SRC/openSUSE:Factory/trytond/trytond.changes 2021-06-19 23:05:23.891889520 +0200 +++ /work/SRC/openSUSE:Factory/.trytond.new.1899/trytond.changes 2021-07-28 19:20:47.887575849 +0200 @@ -1,0 +2,5 @@ +Tue Jul 27 14:04:30 UTC 2021 - Axel Braun <axel.br...@gmx.de> + +- fix_werkzeug_2.x.patch added for python-Werkzeug 2.x compatibility + +------------------------------------------------------------------- New: ---- fix_werkzeug_2.x.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trytond.spec ++++++ --- /var/tmp/diff_new_pack.XkjKCu/_old 2021-07-28 19:20:48.339575256 +0200 +++ /var/tmp/diff_new_pack.XkjKCu/_new 2021-07-28 19:20:48.343575251 +0200 @@ -36,6 +36,7 @@ Source20: %{name}.service Patch0: fix_werkzeug.patch Patch1: revert_werkzeug_setup.patch +Patch2: fix_werkzeug_2.x.patch BuildRequires: fdupes BuildRequires: python3-Werkzeug BuildRequires: python3-bcrypt @@ -84,6 +85,12 @@ %patch0 -p1 %patch1 -p1 +#Werkzeug2 is not compatible with Werkzeug 1.x, so we need a conditional patch +echo 0%{?suse_version} +%if 0%{?suse_version} >= 1550 +%patch2 -p1 +%endif + %build %python3_build ++++++ fix_werkzeug_2.x.patch ++++++ diff -U 3 -dHrN -- a/trytond/protocols/wrappers.py b/trytond/protocols/wrappers.py --- a/trytond/protocols/wrappers.py 2019-08-11 19:34:43.000000000 +0200 +++ b/trytond/protocols/wrappers.py 2021-07-27 15:59:38.213817153 +0200 @@ -8,7 +8,6 @@ from werkzeug.wrappers import Request as _Request, Response from werkzeug.utils import cached_property -from werkzeug.http import wsgi_to_bytes, bytes_to_wsgi from werkzeug.datastructures import Authorization from werkzeug.exceptions import abort, HTTPException @@ -84,7 +83,8 @@ def parse_authorization_header(value): if not value: return - value = wsgi_to_bytes(value) + if not isinstance(value, bytes): + value = value.encode('latin1') try: auth_type, auth_info = value.split(None, 1) auth_type = auth_type.lower() @@ -98,9 +98,9 @@ except Exception: return return Authorization('session', { - 'username': bytes_to_wsgi(username), + 'username': username.decode("latin1"), 'userid': userid, - 'session': bytes_to_wsgi(session), + 'session': session.decode("latin1"), }) @@ -171,16 +171,17 @@ pool = Pool() UserApplication = pool.get('res.user.application') - authorization = wsgi_to_bytes(request.headers['Authorization']) + authorization = request.headers['Authorization'] try: auth_type, auth_info = authorization.split(None, 1) auth_type = auth_type.lower() except ValueError: abort(401) - if auth_type != b'bearer': + if auth_type != 'bearer': abort(403) - application = UserApplication.check(bytes_to_wsgi(auth_info), name) + application = UserApplication.check(auth_info, name) + if not application: abort(403) transaction = Transaction()