Twisted has a new version which causes failure #SYNAPSE
-
Error Message: AttributeError: 'Headers' object has no attribute '_encodeName'
Workaround: Replace this code: [ Mine was from here: synapse-3.8/env/lib/python3.8/site-packages/synapse/http/proxy.py line 72 ]
if hasattr(Headers, "_canonicalNameCaps"): # Twisted < 24.7.0rc1 _canonicalHeaderName = Headers()._canonicalNameCaps # type: ignore[attr-defined] else: # Twisted >= 24.7.0rc1 # But note that `_encodeName` still exists on prior versions, # it just encodes differently _canonicalHeaderName = Headers()._encodeNameWith this:
def _canonicalHeaderName(name): if isinstance(name, unicode): return name.lower().encode('iso-8859-1') return name.lower()