From e8743447f87a79357a458daf35c94c84d834633f Mon Sep 17 00:00:00 2001 From: Samuel Gulliksson Date: Thu, 20 Jul 2023 21:55:40 +0200 Subject: [PATCH] Migrate from legacy API of importlib_resources. (#165) importlib_resources.read_binary was removed, see https://github.com/python/importlib_resources/pull/282 --- src/flask_pyoidc/flask_pyoidc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask_pyoidc/flask_pyoidc.py b/src/flask_pyoidc/flask_pyoidc.py index 89ddcea..42f6a1d 100644 --- a/src/flask_pyoidc/flask_pyoidc.py +++ b/src/flask_pyoidc/flask_pyoidc.py @@ -145,7 +145,7 @@ def _handle_authentication_response(self): return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No initialised user session.'}) if flask.session.pop('fragment_encoded_response', False): - return importlib_resources.read_binary('flask_pyoidc', 'parse_fragment.html').decode('utf-8') + return (importlib_resources.files('flask_pyoidc') / 'parse_fragment.html').read_text(encoding='utf-8') if 'auth_request' not in flask.session: return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No authentication request stored.'})