Skip to content

Commit

Permalink
Fixes errors related to "could not decode" bad surrogate.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdc34 committed Nov 11, 2023
1 parent e9fd503 commit a39edc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion accounts/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def application(environ, start_response): # type: ignore
# in config.py or via an os.environ var loaded by config.py.
if key == 'SERVER_NAME':
continue
os.environ[key] = str(value)
try:
os.environ[key] = str(value)
except UnicodeEncodeError as uee:
print(f"{__file__} Could not decode bytes '{value}' for '{key}' most likely due to a surrogate. {uee}")

global __flask_app__
if __flask_app__ is None:
Expand Down

0 comments on commit a39edc8

Please sign in to comment.