Bug in password complexity

Version
erpnext 11.1.25
frappe 11.1.26

I get this error when trying to enter a password like
“before2011” while I am typing the password
If I disable password complexity the problem goes away

On the screen I get this message
Server Error: Please check your server logs or contact tech support.

In the logs I see this
127.0.0.1 - - [07/May/2019 09:14:32] “POST / HTTP/1.0” 200 -
09:14:34 web.1 | 127.0.0.1 - - [07/May/2019 09:14:34] “POST / HTTP/1.0” 200 -
09:14:36 web.1 | Traceback (most recent call last):
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
09:14:36 web.1 | response = frappe.handler.handle()
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 32, in handle
09:14:36 web.1 | return build_response(“json”)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 51, in build_response
09:14:36 web.1 | return response_type_mapfrappe.response.get(‘type’) or response_type
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 85, in as_json
09:14:36 web.1 | response.data = json.dumps(frappe.local.response, default=json_handler, separators=(’,’,’:’))
09:14:36 web.1 | File “/usr/lib/python2.7/json/init.py”, line 251, in dumps
09:14:36 web.1 | sort_keys=sort_keys, **kw).encode(obj)
09:14:36 web.1 | File “/usr/lib/python2.7/json/encoder.py”, line 207, in encode
09:14:36 web.1 | chunks = self.iterencode(o, _one_shot=True)
09:14:36 web.1 | File “/usr/lib/python2.7/json/encoder.py”, line 270, in iterencode
09:14:36 web.1 | return _iterencode(o, 0)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 148, in json_handler
09:14:36 web.1 | (type(obj), repr(obj)))
09:14:36 web.1 | TypeError: Object of type <type ‘_sre.SRE_Match’> with value of <_sre.SRE_Match object at 0x7fce88181238> is not JSON serializable
09:14:36 web.1 |
09:14:36 web.1 | 127.0.0.1 - - [07/May/2019 09:14:36] “POST / HTTP/1.0” 500 -
09:14:36 web.1 | Traceback (most recent call last):
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/middlewares.py”, line 15, in call
09:14:36 web.1 | return super(StaticDataMiddleware, self).call(environ, start_response)
09:14:36 web.1 | File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/werkzeug/wsgi.py”, line 766, in call
09:14:36 web.1 | return self.app(environ, start_response)
09:14:36 web.1 | File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/werkzeug/wsgi.py”, line 766, in call
09:14:36 web.1 | return self.app(environ, start_response)
09:14:36 web.1 | File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/werkzeug/local.py”, line 228, in application
09:14:36 web.1 | return ClosingIterator(app(environ, start_response), self.cleanup)
09:14:36 web.1 | File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/werkzeug/wrappers.py”, line 308, in application
09:14:36 web.1 | resp = f(*args[:-2] + (request,))
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 87, in application
09:14:36 web.1 | response = handle_exception(e)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 148, in handle_exception
09:14:36 web.1 | response = frappe.utils.response.report_error(http_status_code)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 32, in report_error
09:14:36 web.1 | response = build_response(“json”)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 51, in build_response
09:14:36 web.1 | return response_type_mapfrappe.response.get(‘type’) or response_type
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 85, in as_json
09:14:36 web.1 | response.data = json.dumps(frappe.local.response, default=json_handler, separators=(’,’,’:’))
09:14:36 web.1 | File “/usr/lib/python2.7/json/init.py”, line 251, in dumps
09:14:36 web.1 | sort_keys=sort_keys, **kw).encode(obj)
09:14:36 web.1 | File “/usr/lib/python2.7/json/encoder.py”, line 207, in encode
09:14:36 web.1 | chunks = self.iterencode(o, _one_shot=True)
09:14:36 web.1 | File “/usr/lib/python2.7/json/encoder.py”, line 270, in iterencode
09:14:36 web.1 | return _iterencode(o, 0)
09:14:36 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py”, line 148, in json_handler
09:14:36 web.1 | (type(obj), repr(obj)))
09:14:36 web.1 | TypeError: Object of type <type ‘_sre.SRE_Match’> with value of <_sre.SRE_Match object at 0x7fce88181238> is not JSON serializable

I have tried this on 2 erpnext installations with duplicate results.